The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 6,766β€…    Votes:  3β€…    βœ… Solution
Tags: boot   filesystem  
Link: πŸ” See Original Answer on Ask Ubuntu ⧉ πŸ”—

URL: https://askubuntu.com/q/819806
Title: How to automatically fix fileystem?
ID: /2016/09/01/How-to-automatically-fix-fileystem_
Created: September 1, 2016    Edited:  November 25, 2023
Upload: April 8, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


Ubuntu 16.04 and later with systemd

You do an fsck at every boot with some kernel parameters…

sudo nano /etc/default/grub

find the line that says

GRUB_CMDLINE_LINUX_DEFAULT

and add

fsck.mode=force  fsck.repair=yes

to the existing things there.

Credit:

Ubuntu 16.04 and earlier without systemd

The answer to your question is here [How can I make fsck run non-interactively at boot time?1

File System Check (fsck) isn’t run every boot so your β€œonce in a while” could mean errors are always there but fsck isn’t run when no errors are reported.

Finding the source of file system errors is important. I would take a look at the error messages in /var/log/boot.log and post a new question of what errors there you need help with. Fsck error messages can be in other locations depending on whether upstart or systemd is used for init at boot time.

To force Ubuntu to fix all disk errors at boot you need to add FSCKFIX=yes to the file /etc/default/rcS. This tells fsck to run with the -y flag. 1

⇧ Ubuntu 16.04 does not see SSD Screen brightness stuck at maximum  β‡©