Sheevaplug – automount USB drive at boot

The problem with the Sheevaplug is that it boots too damn fast and the USB drive is too slow to be available for the fstab mount.

The solution, see here for my post on setting up the fstab file to mount your USB drive. When you edit the fstab on the Sheeva you will find it empty but you should end up with an entry similar to this.

/dev/sda1 /mnt/usbdrive ext3 auto,user,rw,exec 0 0

My usb drive is mounted at /dev/sda1 and I created a mount point called /mnt/usbdrive, the drive is formatted as ext3 but you can replace this with the format of your drive or just replace with the word auto for it to check.

Once you have your fstab in place you need to create a script which will slow down the boot for the USB drive to start. Thanks to restamp on the forum see here for the solution.
First navigate to the init.d folder, in a [Terminal] issue the command;

cd /etc/init.d

then using whatever text editor you have installed [I added nano], open a file called wait4usbdrive with;

nano wait4usbdrive

then copy into it restarts script;

# If /etc/fstab has been configured to mount a USB drive, pause to give
# the USB drive devices time to show up in /dev. If this is not done,
# will fail, requiring manual intervention…
case "$1" in
grep -q ^/dev/sda /etc/fstab &&
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
[ -b /dev/sda ] && exit 0
sleep 1
exit 1

Then make it executable with;

chmod +x wait4usbdrive

Then link it to the rcS.d folder with this command;

ln -s ../init.d/wait4usbdrive /etc/rcS.d/S25wait4usbdrive

Now you can shutdown and restart the plug and the USB drive should now auto-mount. My USB drive is a 1.5 TB iomega with it’s own power supply.


Tags: , , , , , , , , , , ,

10 Responses to “Sheevaplug – automount USB drive at boot”

  1. Ted Probosczz Says:

    Hi Martin:
    First of all I would like to thank you for all your trailblazing work on the Sheevaplug.

    I have tried the wait4usbdrive and it doesn’t work for me. I get a line in my /var/log/boot that says:
    Mounting local filesystems…mount: special device /dev/sda1 does not exist

    I use ext4 on my /dev/sda1 drive and it mounts fine if I issue a mount command “mount /dev/sda1” from the prompt after it has booted.

    Any thoughts?

    Ted Proboszcz

  2. Kumar Says:

    Should the sheevaplug be left at the default settings to boot from the internal flash? or should it be configured to boot from sda1 ?
    In either case it does not work for me.
    In the u-boot environment this is what I have done.
    setenv bootargs_root ‘root=/dev/sda1 rootdelay=10’

    setenv bootcmd_usb ‘usb start; ext2load usb 0:1 0x0800000 /boot/uInitrd; ext2load usb 0:1 0x400000 /boot/uImage’

    setenv bootcmd ‘setenv bootargs $(console) $(bootargs_root); run bootcmd_usb; bootm 0x400000 0x0800000’


    When I boot, it scans for the usb storage, and fails.
    Please let me know how this is to be done?

  3. Bolb Says:

    Worked for me! … Sweet, I’ve been trying to figure this out for a bit

  4. Griff Says:

    Is this line actually correct?

    case “$1″ in

    Or is it meant to be:

    case “$1” in


  5. Griff Says:

    Ah… so what happens if I “type “odd” numbers of quotes?

  6. Griff Says:

    If this was Drupal I’d say your input format was set up incorrectly 😉
    Thanks for the post, very helpful.

  7. Marco van de Voort Says:

    Had to comment the grep line because I mount by UUID (occasionally on my (original) sheeva USB is detected as SDB). At least it did with the original firmware

  8. Rafael Torrales Says:

    It works, Thanks

  9. patrick2 Says:


    your method is very laborious. There are much better solutions.

    screen -d -m at reboot for instance @reboot
    with crontab

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: