fsck

Guys,

How do you manage to run fsck.ext2 if your rootfs is in your sd card?. How can you configure it to do the fsck checking before it mount the sd card during the boot up?.

Regards,

John

Guys,

How do you manage to run fsck.ext2 if your rootfs is in your sd card?. How
can you configure it to do the fsck checking before it mount the sd card
during the boot up?.

This is a pretty general ext2/Linux question, so you might have better
luck getting answers via Google. I imagine this is easiest to perform
at boot time, before you have a bunch of open files on the card. I
don't know what distribution you are using, but I pretty quickly found
a relevant Ubuntu how-to page[1]. It didn't take much to figure out
how to do the same thing within Angstrom:

root@beagleboard.org:~# opkg install e2fsprogs-tune2fs
root@beagleboard.org:~# tune2fs --help
root@beagleboard.org:~# tune2fs -l /dev/mmcblk0p2
root@beagleboard.org:~# tune2fs -c 1 /dev/mmcblk0p2

I wouldn't recommend leaving the settings like above!

[1] HowTo: Change disk checking/fsck at boot frequency

tune2fs is only for the tuning of the filesystem. What if I need to repair the filesystem?. I have to run the fsck in order to fix it. Since, the /dev/mmcblk0p2 is being used as the root filesystem of my board, I can’t issue a command fsck.ext2 /dev/mmcblk0p2 since it currently mounted.

tune2fs is only for the tuning of the filesystem. What if I need to repair
the filesystem?. I have to run the fsck in order to fix it. Since, the
/dev/mmcblk0p2 is being used as the root filesystem of my board, I can't
issue a command fsck.ext2 /dev/mmcblk0p2 since it currently mounted.

I'm unclear if you read the page at the link I gave you, but it seems
to me that you did not. Please correct me if I misunderstand.

With tune2fs, it is also possible to set the frequency of mounts for
which fsck is run. If you set the maximum number of mounts to 1
before it is checked, you can reboot and have fsck run when booting up
automatically. Then, you can reset the maximum number of mounts again
to a reasonable number. As we have both mentioned, you cannot run
fsck when the disk is mounted.

Does that make sense now?