i always have problems with the dirty bit when the energy in my house goes down,after come back or power on the electricity,many times i have to repair the sdcard manually on another pc using “fsck.vfat -trawl” command because sdcard gets corrupted.
sometimes i dont see when the electricity goes off after a fail of power,after the raspberry boots normally sometimes,but breaks something after a day or more and i need to pull of the sdcard and fsck the sdcard.
Im thinking if removing the dirty bit would resolve this breaks and eliminate the need to shutdown the raspberry and pull off the sdcard.
how i can check the dirty bit in every reboot ,so the dirty bit will always be repaired on every boot.
i have in crontab
@reboot sudo touch /forcefsck
so the ext4 is always repared when is possible,sometimes need a manual fsck
and i have the line in /boot/cmdline.txt the “fsck.repair=yes”
so i need to
sudo umount /boot
because if /boot is mounted will not correct correctly
sudo fsck.vfat -ar /dev/mmcblk0p1
sudo fsck.vfat -trawl /dev/mmcblk0p1
i need to mount /boot after
but i dont know how to make this working,if is possible, because when the raspberrypi start booting is using this partition vfat with /boot ,right?
where is the best place to insert this lines,for the next boot, to check when the “Dirty bit is set” and automatically remove the dirty bit.?