• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: How to mount USB drive at startup  (Read 7114 times)
jmknapp
Newbie
*

Karma: 0
Posts: 45



View Profile
« on: April 27, 2009, 07:26:00 AM »

I connected a Seagate USB drive to the USB port, formatted ext3 and it works fine, except that I can't seem to get it to automatically mount on boot-up. I added a line to /etc/fstab:

/dev/sda1 /home2 ext3 defaults 0 0

...and indeed 'mount -a' or 'mount /home2' will mount the drive, but I have to do it manually from the command line. I'm guessing that somehow the USB drive isn't recognized at the time that /etc/init.d/mountall.sh is run at boot-up?

Anyway, any tip on how best to mount this drive automatically is appreciated.

Joe
« Last Edit: April 27, 2009, 07:30:43 AM by jmknapp » Logged

plugit
Global Moderator
Full Member
*****

Karma: 0
Posts: 139



View Profile
« Reply #1 on: April 27, 2009, 10:05:47 AM »

Try adding rootdelay=10 (or longer) to your bootargs. It may simply be that when the fstab is being processed, the drive hasn't yet spun up.
Logged

kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« Reply #2 on: April 27, 2009, 10:24:33 AM »

Try changing the last number in your fstab line to 2 so it tries to mount the partition in pass 2.  That way the mount point should be ready.
Logged

plugit
Global Moderator
Full Member
*****

Karma: 0
Posts: 139



View Profile
« Reply #3 on: April 27, 2009, 10:33:04 AM »

Oh, nifty. I'm going to have to try that. Thanks, kw!

Edit: maybe I'm not understanding the manpage correctly, but it looks like that number specifies the order in which fscks take place... Out of the box, the rootfs isn't subject to file system checks. Hmmm.

I'm going to have to google this one.
« Last Edit: April 27, 2009, 10:37:05 AM by plugit » Logged

jmknapp
Newbie
*

Karma: 0
Posts: 45



View Profile
« Reply #4 on: April 27, 2009, 11:23:04 AM »

I changed the last number to 2, but then the plug wouldn't boot, or at least I wasn't able to ssh to it. I took out the SD card, mounted it on another Linux box to edit the file back to having a 0 in that field & it comes up as before.

EDIT: per plugit above, I checked the man page. Maybe it was indeed going to come up eventually, but only after fsck'ing my 1.5TB filesystem on the USB drive. In any case, I don't think I want that to happen.
« Last Edit: April 27, 2009, 11:28:12 AM by jmknapp » Logged

plugit
Global Moderator
Full Member
*****

Karma: 0
Posts: 139



View Profile
« Reply #5 on: April 27, 2009, 11:39:45 AM »

Did you try the rootdelay thing yet?

Failing that, you could always do something cheesy in a (later) rc script, something along the lines of:

cat /proc/self/mounts | grep -q mountpoint || mount /mountpoint

 Roll Eyes
Logged

kilowatt
Global Moderator
Full Member
*****

Karma: 3
Posts: 106


View Profile
« Reply #6 on: April 27, 2009, 11:49:32 AM »

It should not fsck it every time. Only if it hasn't been checked for so many mounts or when it is found unclean.

Did you try the rootdelay=10 that plugit suggested?  This is needed to successfully use a usb drive as root because the kernel take a few seconds to start the usb subsystem.  I'm not sure if you will need it if your just mounting a partition.  That depends if the usb subsystem has started by the time it tries to run the mountall.sh script.
Logged

jmknapp
Newbie
*

Karma: 0
Posts: 45



View Profile
« Reply #7 on: April 27, 2009, 05:23:30 PM »

OK, I tried the rootdelay=10 trick--a little more involved since I had to get into U-boot, but I made the change and it works. I put rootdelay=10 right after root=/dev/mmcblk0p1 in the bootargs string. Thanks!
Logged

plugit
Global Moderator
Full Member
*****

Karma: 0
Posts: 139



View Profile
« Reply #8 on: April 27, 2009, 05:46:50 PM »

Cool. Smiley

I need to do the same with my plug, next time I get it serial'd in.
Logged

bfmorgan
Guest
« Reply #9 on: April 27, 2009, 05:59:31 PM »

I have a Transcend 128 GB SSD and the rootdelay=10 works for this USB drive as well.

Thanks,
Logged

khklatt
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #10 on: June 18, 2009, 12:17:56 PM »

I have a Transcend 128 GB SSD and the rootdelay=10 works for this USB drive as well.

Thanks,
Not being Debian versed, where is the rootdelay set?  Used to gentoo/redhat, stumbling a bit on Debian.. Still, getting farther on Shivaplug than I thought.. Along those lines, if I use a swap partition on one of the USB drives, how do you point to the partition, as the driver number (sda1, sdb1) may change.. On  ext partiiton, using a disklabel and calling mount -L label <mntpoint> in rc.local works..  Been logging in and setting up swap manually.  Thanks
Logged

bfmorgan
Guest
« Reply #11 on: June 18, 2009, 02:22:09 PM »

khklatt,
  In order to set the rootdelay=10 one needs to have a console connection established using the serial connection on the mini-USB port of the plug. Using a terminal emulator (I used Putty) that has been set up with the serial drivers supply with the plug (SheevaPlug_Host_SWsupportPackageWindowsHost.zip) reboot the plug by pressing the reset button on the side of the plug (this will require a paper-clip to get into the hole where the reset button is next to the SD card slot).

  As the plug boots the console on the terminal software will get to a point where it starts to count down from 3. Press enter before it gets to 0 (it will finish booting if it get to 0). The console will the say:

Marvell>>

  At this point type:

Marvell>> printenv

 This will list all the Uboot env values. Follow the step outlined above to add the rootdelay=10 and don't forget to type "saveenv" before you "reset" (reboot).

This is covered in some detail in the SheevaPlug Development Kit README-Rev1.2.pdf file included in with the plug.

Hope this helps,
Logged

Pages: [1]
Print
Jump to: