How to check a filesystem on a remotely deployed device?

I am wondering how you would do a filesystem check (e.g. fsck) on a remote system (e.g. logged in via SSH)?

You need to unmount the filesystem before checking it, but once you unmount it you have nothing left to execute from? We have a custom board based on the BeagleBone that uses ext3 on a uSD card as the rfs.

Thanks,
Fred

google search yielded . . .

http://www.cyberciti.biz/faq/linux-force-fsck-on-the-next-reboot-or-boot-sequence/

Thank you, damn should’ve found that myself.

The only thing I am worried about is rebooting into fsck mode and then having it make changes and making the system unbootable. Not much I can do about that I suppose as I only have Ethernet access via a cell modem…

Thank you, damn should’ve found that myself.

The only thing I am worried about is rebooting into fsck mode and then having it make changes and making the system unbootable. Not much I can do about that I suppose as I only have Ethernet access via a cell modem…

In that case, you should use a read only filesystem that you don’t have to check and another which is writeable. You can unmount the writeable partition and run fsck. Either use two storage devices (eMMC and SDCard) or use two partitions on one device.

Regards,
John

And if you really need to fix this remotely without risk of the system
not coming back, you can craft a chroot rescue environment in a ram
based file-system, pivot-root to that, and fsck the unmounted flash
drive. You could even pivot-root back to the fixed filesystem without
rebooting unless you need to update the kernel.

Yes you are correct of course. I’m just picking up the pieces from the previous developers. The next system I roll out will incorporate your suggestion.