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?
Are you using a particular distribution? On Debian based distributions it would be as simple as adjusting
If you want to force a full fsck after every boot, then you could simply write create an empty file named
|show 2 more comments|
If there had been a power loss fsck will run anyway since the filesystem will not be marked as "clean". You can use