[Buildroot] Check root file system at boot time

Yann E. MORIN yann.morin.1998 at free.fr
Fri Jun 6 16:27:37 UTC 2014


Pedro, All,

On 2014-06-06 06:46 -0700, psnsilva spake thusly:
> Analysing dmesg I have the following:
> *[    2.035620] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly
> filesystem*
> *[    2.042939] EXT4-fs (mmcblk0p2): write access will be enabled during
> recovery*
> [    2.113153] usb 1-1: new high-speed USB device number 2 using dwc_otg
> [    2.119785] Indeed it is in host mode hprt0 = 00001101
> [    2.333461] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
> [    2.341438] usb 1-1: New USB device strings: Mfr=0, Product=0,
> SerialNumber=0
> [    2.349484] hub 1-1:1.0: USB hub found
> [    2.353421] hub 1-1:1.0: 5 ports detected
> [    2.633280] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
> *[    2.698021] EXT4-fs (mmcblk0p2): recovery complete*
> *[    2.713363] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data
> mode. Opts: (null)*
> [    2.721530] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
> [    2.729450] devtmpfs: mounted
> [    2.732899] Freeing unused kernel memory: 136K (c0570000 - c0592000)
> [    2.753632] usb 1-1.1: New USB device found, idVendor=0424,
> idProduct=ec00
> [    2.760523] usb 1-1.1: New USB device strings: Mfr=0, Product=0,
> SerialNumber=0
> [    2.771391] smsc95xx v1.0.4
> *[    2.837447] EXT4-fs (mmcblk0p2): warning: maximal mount count reached,
> running e2fsck is recommended*
> [    2.846996] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at
> usb-bcm2708_usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:be:e9:89
> [    2.861325] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
> 
> So, as far I understood, despite the warning "maximal mount count reached,
> running e2fsck is recommended",

How do you build your ext4 filesystem? The way it is generated by
Buildroot is that the maximal mount count is disabled for the ext
familly of filesystems. It looks like you are generating your ext4
filesystem outside of Buildroot, correct? (Note: this has no impact
on the fact that the filesystem would be or would not be checked
after an unclean shutdown.)

> the SD card checking is actuality happening
> (recovery complete)... Is it?

Yes it is.

However, it is anyway highly suggested that you do an fsck pass on a
filesystem which was not properly unmounted. You could o either:

  - boot into an initramfs which would do the fsck, then pivot-root into
    the real filesystem

  - run fsck from the ereal root, and reboot in case fsck did some
    changes to the filesystem

The first case is the cleanest solution, since you delegate the entire
check to fsck, rather than let the filesystem "dirver" in the kernel do
the check.

For the second solution, the check-and-fixing done by the kernel will
anyway occur even before you would have a chance to run fsck.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'


More information about the buildroot mailing list