I have an embedded linux system. I use grub2 for the boot loader. I would like to run an fsck -y /dev/sda on /dev/sda every time it boots–even when the system had a power loss and the reboot command was not used. How can I do this?
Linux – Run fsck -y everytime at startup on the main partition Linux
fsckgrubgrub2linux
Related Topic
- Linux – Prevent data corruption on ext4/Linux drive on power loss
- Linux – How to install grub on multiple disks
- Ubuntu Server live cd rescue mode can’t run fsck
- Linux – High Server Crash Rates During Leap Second Day
- Linux – fsck on shutdown instead of startup
- Linux – Install debian 8 on a LVM Volume with Type RAID1 GRUB2 cant find volume group
- Linux – FSCK run and unmount issue
Best Answer
Are you using a particular distribution? On Debian based distributions it would be as simple as adjusting
/etc/default/rcS
and setFSCKFIX
to yes.If you want to force a full fsck after every boot, then you could simply write create an empty file named
/forcefsck
. Though I do not suggest you actually do this.