Views:
7,138β
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:
September 15, 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