[colug-432] On boot, can I get e2fsck to pause if disk isn't there?

Brian Miller bnmille at gmail.com
Sun May 3 16:17:40 EDT 2015


On 05/03/2015 03:37 PM, Joshua Kramer wrote:
> Hello,
>
> I have a Raspberry Pi set up.  I am putting the /var and /home
> partitions on an external USB hard drive, so as to not burn through flash.
>
> My problem is this: initd goes to run e2fsck on the hard drive
> partitions, before the kernel realizes that the hard drive is there.  So
> e2fsck always bombs, complaining that /dev/sda1 and /dev/sda2 do not
> exist.  If I drop to a maintenance prompt, I can e2fsck and mount both
> partitions just fine.
>
> How can I get e2fsck to wait and retry checking if the disk isn't there?
>
> Thanks!
> -JK
>
>
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432
>

Three options:
First, make sure the last column in your /etc/fstab for the /var and 
/home partitions is a "3".  That will ensure fsck runs a little later.

Two, set the option "noauto" for these file systems in /etc/fstab.  Then 
you will have to find the proper place in one of the /etc/init.d startup 
scripts that will mount those file systems BEFORE syslog (or some other 
daemon that uses /var) starts.  This might be a little difficult, as on 
my Pi, rsyslog has an "S01" on the start script.

Three, set the "nofail" option in /etc/fstab.  This would tell the 
system not to complain if the file system isn't there.  But then it also 
might not mount later, after the USB devices are available.  In this 
case, you would still have to get an /etc/init.d startup script to mount 
the file systems at an appropriate place.




More information about the colug-432 mailing list