Skip to contentSkip to conversation

automatic fsck?

DISCUSSION JustinLove 2 participants 3 messages Mar 13, 2009 – Mar 16, 2009

lore
Share & tools
lore

JustinLove

author
#0 lore raw

I routinely had problems with ext2 that were fixed by fsck. I switched to ext3, but there are still occasions where the filesystem gets wedged, but a simple fsck restores it. Is it possible to run fsck automatically on startup, as many desktop systems do? The kernel startup messages are telling me

EXT3-fs warning: maximal mount count reached, running e2fsck is recommended

I realize that most of the mechanics involve files on root, which won't do much good if the filesystem is corrupted. Long term plan is to repartition and make root readonly, but I'd still like fsck for the other partitions.

Environment:

Linux beagleboard 2.6.27-omap1 #1 Wed Jan 14 07:47:57 CST 2009 armv7l unknown

Angstorm on beagleboard, running from SD card with 2 partitions, FAT/ext3

So far I've figured out:

- fstab has '1' in last column for rootfs
- Install e2fsprogs-fsck and/or e2fsprogs-e2fsck
- change ENABLE_ROOTFS_FSCK=yes in /etc/default/rcS
- Specify "ro" on kernel command line
- "shutdown -F -r now", but this has no effect, I still get the warning message

What am I missing?

Signature · 8 lines
Justin Love

Creative Electronics & Software
650 Sundown Road
South Elgin, IL 60177

Phone 847-695-0023 x233
FAX   847-695-0483
#1 lore raw
Quoted 10 lines · JustinLove

So far I've figured out:

- fstab has '1' in last column for rootfs
- Install e2fsprogs-fsck and/or e2fsprogs-e2fsck
- change ENABLE_ROOTFS_FSCK=yes in /etc/default/rcS
- Specify "ro" on kernel command line
- "shutdown -F -r now", but this has no effect, I still get the warning message

What am I missing?

If I remember correctly, you also need to specify your fs type (ext3 instead of auto) and real device (/dev/mmcblk0p2 instead of rootfs) in your fstab. Maybe that'll help.

In fact there's other problem, and much bigger - by default rootfs gets mounted with 'defaults' option, and it silently wears your flash, because 'defaults' imply atime turned on. It may be one of the causes of FS corruption too. Guess, I'll roll a patch fixing that.

Signature · 2 lines
Best regards,
Dmitry "MAD" Artamonow
author
#2 lore raw
Quoted 3 lines · Dmitry Artamonow

If I remember correctly, you also need to specify your fs type (ext3 instead of auto) and real device (/dev/mmcblk0p2 instead of rootfs) in your fstab. Maybe that'll help.

One or both of those was successful. Guess I was unscientific in applying both at once ;^)

Quoted 4 lines

In fact there's other problem, and much bigger - by default rootfs gets mounted with 'defaults' option, and it silently wears your flash, because 'defaults' imply atime turned on. It may be one of the causes of FS corruption too. Guess, I'll roll a patch fixing that.

I also added 'noatime' to fstab, but 'mount' does not show noatime set for either rootfs or /dev/root.

I tried using rootflags=noatime on the kernel command line, but it said it was an unrecognized mount option, and failed to mount root at all.

Signature · 8 lines
Justin Love

Creative Electronics & Software
650 Sundown Road
South Elgin, IL 60177

Phone 847-695-0023 x233
FAX   847-695-0483