You are not logged in.

#1 2010-06-20 00:51:10

iamblum
Member
Registered: 2010-06-20
Posts: 13

[SOLVED] Error when mounting external hard drive at boot

Hi all.  I'm new here (to both Arch and Linux in general) and loving it.  So far I have been able to resolve every issue I've had by doing my research, but not with this.

I have a WD My Passport USB external hard drive.  When I try to mount it with fstab I get the following error message at bootup:

MOUNT: Special Device /dev/sdb does not exist.

However, after my boot up is complete and I login as root I can immediately run

mount -a

and the hard drive is mounted with no problems.

Here is the information contained in fstab:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0
#/dev/fd0               /media/fl   auto    user,noauto             0      0
/dev/sdb1     /media/external  ext4   defaults,rw,user                 0      0

UUID=12015e6d-eca5-49cb-bf2c-94e35a8379eb swap swap defaults 0 0
UUID=5601b6ec-d519-446b-ad7b-3fa31fd74a8f /home ext4 defaults 0 1
UUID=84651bf5-7d02-4589-8330-14e7283a926e /boot ext2 defaults 0 1
UUID=9953b984-ec84-4db1-9808-03e1ab3e0628 / ext4 defaults 0 1

I have tried mounting /dev/sdb, /dev/sdb0, etc. but to no avail.  What is the problem here?  The only logical answer to me is that the mounting process at bootup is started before my USB connections are detected.  If that's the case, how can I correct that?

Thanks in advance and if I have not provided enough information I do apologize.

--blum

Last edited by iamblum (2010-06-20 04:21:43)

Offline

#2 2010-06-20 01:47:16

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: [SOLVED] Error when mounting external hard drive at boot

See this wiki article.
Welcome to Arch.
Enjoy.

Offline

#3 2010-06-20 02:33:02

iamblum
Member
Registered: 2010-06-20
Posts: 13

Re: [SOLVED] Error when mounting external hard drive at boot

Thank you Misfit for your reply; this article will come in handy...especially the by-label feature.  However, I've edited the fstab so that it refrences my external hard drive va the uuid.  I did this as I noticed my internal partitions were as well.  I still get a similar error at bootup:

MOUNT: Special Device cf697fd6-006b-46f6-b508-77a5d8667ec7 does not exist.

However when i run

mount -a

the external hard drive mounts with no problems.

Below is the updated fstab:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0

#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0
#/dev/fd0               /media/fl   auto    user,noauto             0      0

UUID=12015e6d-eca5-49cb-bf2c-94e35a8379eb swap swap defaults 0 0
UUID=5601b6ec-d519-446b-ad7b-3fa31fd74a8f /home ext4 defaults 0 1
UUID=84651bf5-7d02-4589-8330-14e7283a926e /boot ext2 defaults 0 1
UUID=9953b984-ec84-4db1-9808-03e1ab3e0628 / ext4 defaults 0 1
UUID=cf697fd6-006b-46f6-b508-77a5d8667ec7 /media/external ext4 defaults 0 0

Thanks again.

--blum

Last edited by iamblum (2010-06-20 02:34:08)

Offline

#4 2010-06-20 02:48:35

rransom
Member
Registered: 2010-04-26
Posts: 92

Re: [SOLVED] Error when mounting external hard drive at boot

See [wiki=mkinitcpio]mkinitcpio.conf[/wiki].  (Specifically, you need the 'usb' hook.)

Offline

#5 2010-06-20 03:02:52

iamblum
Member
Registered: 2010-06-20
Posts: 13

Re: [SOLVED] Error when mounting external hard drive at boot

rransom wrote:

See [wiki=mkinitcpio]mkinitcpio.conf[/wiki].  (Specifically, you need the 'usb' hook.)

Thanks.  I tried that just before you posted your comment.  I tried placing it before and after the 'autodetect' hook (but always after the 'udev' hook), but with the same result: external hard drive still not mounting at boot sad

Offline

#6 2010-06-20 03:19:02

iamblum
Member
Registered: 2010-06-20
Posts: 13

Re: [SOLVED] Error when mounting external hard drive at boot

Also, I just tried placing the following in /etc/rc.local:

mount /media/external

This still didn't work (was shown same error twice), causing me to be certain that the problem is in the USB not being loading prior to mounting.  Is there possibly a module that I need to manually add to the mkinitcpio.conf?

Offline

#7 2010-06-20 03:57:05

rransom
Member
Registered: 2010-04-26
Posts: 92

Re: [SOLVED] Error when mounting external hard drive at boot

Did you rebuild the initrd?  (I use 'pacman -S kernel26' to do that.)

Offline

#8 2010-06-20 04:03:45

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Error when mounting external hard drive at boot

I would use udev to mount the drive at boot:

http://wiki.archlinux.org/index.php/Ude … SB_devices

Offline

#9 2010-06-20 04:20:28

iamblum
Member
Registered: 2010-06-20
Posts: 13

Re: [SOLVED] Error when mounting external hard drive at boot

Solved! Kinda....

So this is probably a crude solution, but for a newbie just messing around with ideas I think I've done alright.

I set my external hard drive to be loaded but not automatically mounted in fstab:

UUID=cf697fd6-006b-46f6-b508-77a5d8667ec7 /media/external ext4 defaults,rw,user,noauto 0 0

And in  rc.local I added a ten second pause, then mounted the drive:

#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#

for tty in /dev/tty?; do /usr/bin/setleds -D +num < "$tty"; done
sleep 10s
mount /media/external

I added a ten second pause here because I noticed that without it the USB still hadn't loaded by the time it was being mounted.  The ten seconds ensures that enough time has been allowed for the USB to load.

I tried this with both the "usb" hook in and not in the mkinitcpio.conf.  It works either way.

I'm sure there is a better solution but for me Occam's razor prevails.  When I decide to spend more time on this I might try coming up with another solution...for now I have plenty other things to work on....sound, printer, radio, monitor, etc.  I must say I love working with Arch.  I mean I liked the other distro's I've briefly used (Ubuntu, Fedora, Mandriva) but with Arch it's a lot more techinal and requires more problem solving.  This makes the solutions much more rewarding smile.

Thanks for all the speedy replies!

PS Can anyone, off the top of his/her head, tell me (or refer me to) what the default options in fstab are?  I'm wondering if the options I set (rw,users,noauto) are sufficient without needing the "defaults".

--blum

Last edited by iamblum (2010-06-20 04:24:49)

Offline

#10 2010-06-20 04:30:40

rransom
Member
Registered: 2010-04-26
Posts: 92

Re: [SOLVED] Error when mounting external hard drive at boot

iamblum wrote:

I tried this with both the "usb" hook in and not in the mkinitcpio.conf.  It works either way.

At that point in the boot process, your real root filesystem has been mounted, so all modules are available, not just the ones incorporated into and loaded by the initrd.

iamblum wrote:

PS Can anyone, off the top of his/her head, tell me (or refer me to) what the default options in fstab are?  I'm wondering if the options I set (rw,users,noauto) are sufficient without needing the "defaults".

man 8 mount |grep -C 3 -e defaults

Offline

#11 2010-06-20 04:38:04

iamblum
Member
Registered: 2010-06-20
Posts: 13

Re: [SOLVED] Error when mounting external hard drive at boot

Thanks rransom!!  That makes sense about initrd.  And thank you for the reference...I'm sure I could have looked around for it but at this point my brain's a bit fried...

Offline

#12 2010-06-20 14:11:01

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOLVED] Error when mounting external hard drive at boot

That's basically the same solution I came up with, except I first check that the disk is plugged in:

[ -e /dev/disk/by-label/Icy80 ] && mount /dev/disk/by-label/Icy80

If you don't need your external drive to be accessible right after rc.local, you could background the sleep & mount operation:

(sleep 10 && mount /media/external)&

Offline

#13 2010-06-20 20:08:09

iamblum
Member
Registered: 2010-06-20
Posts: 13

Re: [SOLVED] Error when mounting external hard drive at boot

I was thinking about backgrouding the sleep, but I like the pause so I can check that everything has been loaded properly.  Thanks for the disc check!

Also thanks anonymous_user.  Your method worked like a charm too!  Until I can better understand that proces, I feel as though I can control the mounting more through fstab.

Offline

Board footer

Powered by FluxBB