• Home
  • Help
  • Search
  • Login
  • Register
Pages: 1 2 [3]
Author Topic: Managing a USB hard drive on the Plug  (Read 33313 times)
birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #30 on: November 14, 2010, 07:26:22 PM »

Quote
# If /etc/fstab has been configured to mount a USB drive, pause to give
# the USB drive devices time to show up in /dev.
Are you setting a rootdelay in your u-boot environment?
Logged

nhoeller
Newbie
*

Karma: 0
Posts: 9


View Profile
« Reply #31 on: August 05, 2014, 07:54:50 AM »

I tried the code provided by mgillespie (post #11) without success - mountall.sh is running before wait4usbdrives gets a chance to slow down the process.  It may be my setup: I am running Debian Squeeze and the USB harddrive is connected to a hub - it takes 8 seconds before the drive is recognized and added to /dev.  rcconf slotted wait4usbdisks after checkfs.sh and before mountall.sh but based on https://wiki.debian.org/LSBInitScripts/ it appears Debian Squeeze is running boot scripts according to dependency information provided by the scripts rather than the older numeric Snn sequence.  The FAQ at the bottom of https://wiki.debian.org/LSBInitScripts/ implies that there is no standard way to get wait4usbdrives to run before checkfs.sh without modifying the headers in checkfs.sh. 

For the moment, I have modified checkfs.sh at the beginning of the do_start routine to include the code from restamp amd mgillespie.  I will play around with the X-Start-Before and X-Stop-After headers mentioned in the FAQ when I get some time.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #32 on: August 05, 2014, 04:42:42 PM »

Quote
...there is no standard way to get wait4usbdrives to run before checkfs.sh without modifying the headers in checkfs.sh.
Well, you could edit the checkfs.sh script to add a requirement for something which is provided by the wait4usbdrives script (so you might have to edit that too, to actually say what it is providing)?
Logged

nhoeller
Newbie
*

Karma: 0
Posts: 9


View Profile
« Reply #33 on: August 06, 2014, 02:38:17 PM »

@birdman, that is definitely an option.  Unfortunately, I am still having problems getting my head around the LSB-compliant init scripts stuff.  I can read the words but the detailed logic still eludes me.  The right solution would be to have wait4usbdisks finish before checkfs.sh starts, without having to modify 'stock' initialization scripts. 
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #34 on: August 07, 2014, 05:29:03 PM »

he right solution would be to have wait4usbdisks finish before checkfs.sh starts, without having to modify 'stock' initialization scripts. 
AFAIK wait4usbdisks is not a "stock" initialization script.  Indeed - it seems to have been posted in the first entry in this thread.

Does your copy include the debian headers, as given by mgillespie in: http://www.plugcomputer.org/plugforum/index.php?topic=485.0#msg5425

Have you made it executable?

Have you ensured that it gets run at the right time by running
Code:
update-rc.d wait4usbdisks defaults

Have you considered using a rootdelay in the boot environment settings?  I only have /boot on an SDcard, with everything else (including /) on a USB drive (which is running through a hub) so I must have the USB drive up, running and available before I can even boot.  It's always worked well.
Logged

birdman
Sr. Member
****

Karma: 4
Posts: 443


View Profile WWW
« Reply #35 on: August 07, 2014, 05:40:19 PM »

Does your copy include the debian headers, as given by mgillespie in: http://www.plugcomputer.org/plugforum/index.php?topic=485.0#msg5425
Mind you, on looking at that more closely it appears to be wrong.  The
Quote
Required-Start; checkfs
part means that it will run after checkfs, but I suspect you need it to run before checkfs.

To do that you can leave the
Quote
Required-Start:
in wait4usbdisks empty, (i.e. you'll need to edit it to remove the checkfs that is there) but add wait4usbdisks to that line in the checkfs.sh script (after checkroot - with a space in between them).

Then run
Code:
update-rc.d wait4usbdisks defaults
Logged

nhoeller
Newbie
*

Karma: 0
Posts: 9


View Profile
« Reply #36 on: August 31, 2014, 08:53:02 AM »

@birdman, I had a chance to play around with the various INIT options.  The following has worked so far for me in terms of running wait4usbdisks until just before checkfs.sh but also ensuring that checkfs.sh does not start before wait4usbdisks has finished.

Code:
### BEGIN INIT INFO
# Provides:          wait4usbdisks
# Required-Start:    checkroot
# Required-Stop:
# Should-Start:
# Should-stop:
# Default-Start:     S
# Default-Stop:
# X-Interactive:     true
# X-Start-Before:    checkfs
# X-Stop-After:
# Short-Description: Delays boot to ensure USB disks are connected.
### END INIT INFO

I also removed the "exit 1" from the "start)" logic to prevent errors being posted after wait4usbdisks had finished. 
Logged

Pages: 1 2 [3]
Print
Jump to: