dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Checking file system

Sun Mar 09, 2014 9:40 pm

First off I have never had an SD card failure in using many Pi systems run 24/7. One for almost a year.

That being said this morning I found one system giving read/write errors and read only errors with lots of errors in the log. I figured I had lost an SD card but after a reboot all was fine. Not sure what happened but I had to pull the power as commands would not execute.

Anyhow when it came back up fine I decided to do a file check at the next boot so I put the /forcefsck file in and rebooted. I don't seem to see anywhere that it actually does this. I assume it does it before mounting R/W on the next boot. Here are the pertinent parts of dmesg

2.240976] mmc0: read SD Status register (SSR) after 3 attempts
[ 2.261965] mmc0: new high speed SDHC card at address aaaa
[ 2.269523] mmcblk0: mmc0:aaaa SU16G 14.8 GiB
[ 2.277019] mmcblk0: p1 p2
[ 2.351249] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 2.362156] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 2.370781] devtmpfs: mounted
......
[ 12.288007] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 34.161759] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 42.907205] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

I don't see any mention of the file check being done. I also assume the FAT error can be ignored.

So how can I determine if the file check is actaully happening?

Also is there any downside to put a touch /forcefsck in rc.local to force a file check at each reboot?

User avatar
DougieLawson
Posts: 36557
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Checking file system

Sun Mar 09, 2014 9:44 pm

Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Re: Checking file system

Sun Mar 09, 2014 10:06 pm

Thanks. That fixed the insignificant fat error but what about the overall file check questions?

dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Re: Checking file system

Mon Mar 10, 2014 4:17 am

I researched this and I think I can answer my own question on this unless someone else has a better answer.

When you do a force file check at boot it does it on an unmounted root filesystem and it cannot write to a file on the SD card. I often see it written that /var/log/fsck or some such is where the log it. I use a /var/log tmpfs and not directory of this name exists.

I believe the checks are written to dmesg and retrieved by the dmesg command or viewed in the /var/log/dmesg file.

so - grep /var/log/dmesg fsck

would find any occurences in dmesg.

Return to “Raspbian”