You are not logged in.

#1 2009-09-07 15:45:16

hencethus
Member
From: Port Orange, FL
Registered: 2008-02-11
Posts: 15

Can't mount USB hard drive with fstab

The drive is formatted to ext3, and I can mount it manually with no problems:

[root@hypatia ~]# mount /dev/sdb1 /media/mybook
[root@hypatia ~]# df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda3     ext3    7.3G  782M  6.1G  12% /
none         tmpfs    473M  172K  473M   1% /dev
none         tmpfs    473M     0  473M   0% /dev/shm
/dev/sda1     ext2     99M   11M   84M  12% /boot
/dev/sda4     ext3     48G  180M   45G   1% /home
/dev/sdb1     ext3    917G  200M  917G   1% /media/mybook
[root@hypatia ~]# mount
/dev/sda3 on / type ext3 (rw)
none on /dev type tmpfs (rw,relatime,mode=755)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
none on /dev/pts type devpts (rw)
none on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext2 (rw)
/dev/sda4 on /home type ext3 (rw)
/dev/sdb1 on /media/mybook type ext3 (rw)
[root@hypatia ~]#

Here's my /etc/fstab:

[root@hypatia ~]# cat /etc/fstab
#
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
none                   /dev/pts      devpts    defaults            0      0
none                   /dev/shm      tmpfs     defaults            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/sda1       /boot           ext2    defaults        0       1
/dev/sda2       swap            swap    defaults        0       0
/dev/sda3       /               ext3    defaults        0       1
/dev/sda4       /home           ext3    defaults        0       1
/dev/sdb1       /media/mybook   ext3    defaults        0       0
[root@hypatia ~]#

When I boot up I get this message:

mount: special device /dev/sdb1 does not exist

I've tried using the drive's LABEL and UUID instead and I have the same problem in both cases.

If I change the <pass> column to 2 instead of 0 so that fsck looks at the disk I get an error something like this:

The superblock could not be read or does not describe a correct ext2 filesystem.

This is a little weird, because the disk is formatted to ext3. I don't know if that has something to do with my problem.

I'm thinking more likely the problem is arises from my ignorance and hopefully the solution is something very simple.

Does anyone know what's going on here? Thanks in advance! smile

Oh, and here's the output from fdisk -l in case that's helpful in any way:

[root@hypatia ~]# fdisk -l

Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4b36bdea

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104422   83  Linux
/dev/sda2              14          46      265072+  82  Linux swap / Solaris
/dev/sda3              47        1003     7687102+  83  Linux
/dev/sda4            1004        7296    50548522+  83  Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3db05424

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      121601   976760001   83  Linux

Last edited by hencethus (2009-09-07 15:53:54)

Offline

#2 2009-09-07 16:29:51

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Can't mount USB hard drive with fstab

Perhaps you need to establish mount point  "/media/mybook" ?


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#3 2009-09-07 17:09:52

hencethus
Member
From: Port Orange, FL
Registered: 2008-02-11
Posts: 15

Re: Can't mount USB hard drive with fstab

Do you mean make sure the directory /media/mybook exists? Because it does. I'm able to mount the volume to it manually.

Or does "establish mount point" have a special meaning that I'm not aware of?

Offline

#4 2009-09-07 17:14:48

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Can't mount USB hard drive with fstab

You have the mount point OK..........................

Perhaps there is a typo ......................


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#5 2009-09-07 17:20:24

hencethus
Member
From: Port Orange, FL
Registered: 2008-02-11
Posts: 15

Re: Can't mount USB hard drive with fstab

Well, I posted the command that I used to mount the volume manually, along with the output of df and mount to verify that it mounted properly.

I also posted the full contents of my /etc/fstab, so any typos should be apparent.

Offline

#6 2009-09-07 17:30:04

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: Can't mount USB hard drive with fstab

Likely that the drive is not ID'ed consistently....UUID would solve that problem.

EDIT:  Using /mnt for the mount point may give you a mounted drive in /mnt/disk...................

Last edited by lilsirecho (2009-09-07 17:31:59)


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#7 2009-09-07 17:30:29

Acecero
Member
Registered: 2008-06-21
Posts: 1,373

Re: Can't mount USB hard drive with fstab

If you are able to mount it manually after it boots, the device file should exist without complaints. Otherwise I would take a look to see what other partitions exist with ls /dev/sd*

Maybe you need to reformat the drive again?

Offline

#8 2009-09-07 17:38:19

hencethus
Member
From: Port Orange, FL
Registered: 2008-02-11
Posts: 15

Re: Can't mount USB hard drive with fstab

I tried both the UID and the LABEL in /etc/fstab and I had the same problem. I have also reformatted twice. The drive is brand new and I don't have any reason to suspect that it's defective, especially since it mounts fine when I do it manually after boot.

Relevant directories in /dev are:
/dev/sdb
/dev/sdb1

Offline

#9 2009-09-07 18:07:50

hencethus
Member
From: Port Orange, FL
Registered: 2008-02-11
Posts: 15

Re: Can't mount USB hard drive with fstab

Is it possible that this has something to do with when the device is detected and made available? So /dev/sdb1 really doesn't exist until after /etc/fstab does its thing?

Offline

#10 2009-09-07 18:25:04

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: Can't mount USB hard drive with fstab

I have a similar issue where my external drive doesn't immediately exist to be mounted. When my system boots up, right before it starts the init scripts, I see something like "Waiting 10 seconds for device <my external drive>", and as it happens 10 seconds don't pass before it processes fstab and so the special device doesn't exist.

I work around this by simply issuing the mount command in /etc/rc.local, but I'm sure there's a better way.

Offline

#11 2009-09-07 20:46:55

hencethus
Member
From: Port Orange, FL
Registered: 2008-02-11
Posts: 15

Re: Can't mount USB hard drive with fstab

neddie_seagoon wrote:

I have a similar issue where my external drive doesn't immediately exist to be mounted. When my system boots up, right before it starts the init scripts, I see something like "Waiting 10 seconds for device <my external drive>", and as it happens 10 seconds don't pass before it processes fstab and so the special device doesn't exist.

I work around this by simply issuing the mount command in /etc/rc.local, but I'm sure there's a better way.

OK, I think you're right. I see the bit about waiting 10 seconds.

So I changed the line my /etc/fstab to look like this:

LABEL=mybook       /media/mybook   ext3    noauto          0       0

And I added this line to /etc/rc.local:

mount -t ext3 LABEL=mybook /media/mybook

The only problem is it only works sometimes. Most of the time I still get the "does not exist" error. I think the startup script must be running right at the threshold so that occasionally the drive is already available by the time it runs.

Is there a way that I could delay the startup script a little more?

Even so, that's sort of an ugly hack. There's got to be a more elegant way to fix this. hmm

Offline

#12 2009-10-17 18:12:14

zajca
Member
From: Czech Republic
Registered: 2008-11-24
Posts: 35

Re: Can't mount USB hard drive with fstab

I have same problem.

$ cat /etc/fstab

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


/dev/sr0 /media/cdrom   auto    ro,user,noauto,unhide   0      0
/dev/sr0 /media/dvd   auto    ro,user,noauto,unhide   0      0
UUID=4ca742e5-c01d-496b-8c86-9a9383e565a6 / reiserfs defaults 0 1
UUID=a45cdead-dbe1-4e4e-bf10-9735e1cbe41a /home reiserfs defaults 0 1
UUID=f98075a7-c0db-4caa-8ea0-4a0a2765008a swap swap defaults 0 0
UUID=bca3a41e-7944-4ac7-9711-2844676db6ed /media/disk ext3 defaults 0 0
UUID=7D97-009A /media/Muj_book vfat umask=111,dmask=000,gid=500,uid=500,iocharset=utf8,codepage=852 0 0 0 0
UUID=d9472c6a-4124-441c-a38b-1ef674c2d982 /media/pul_tera ext3 defaults 0 0

message on boot

mount: special device UUID=7D97-009A does not exist
mount: special device UUID=d9472c6a-4124-441c-a38b-1ef674c2d982 does not exist

$ blkid

/dev/sda1: UUID="4ca742e5-c01d-496b-8c86-9a9383e565a6" TYPE="reiserfs"
/dev/sda5: UUID="a45cdead-dbe1-4e4e-bf10-9735e1cbe41a" TYPE="reiserfs"
/dev/sda6: TYPE="swap" UUID="f98075a7-c0db-4caa-8ea0-4a0a2765008a"
/dev/sdb1: UUID="bca3a41e-7944-4ac7-9711-2844676db6ed" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdd1: LABEL="Muj_book" UUID="7D97-009A" TYPE="vfat"
/dev/sde1: LABEL="pul_tera" UUID="d9472c6a-4124-441c-a38b-1ef674c2d982" SEC_TYPE="ext2" TYPE="ext3"

after start I type # mount -a
and both USB hard drive are successfully mounted

Offline

#13 2009-10-28 02:51:39

YoungGods
Member
From: Europa
Registered: 2007-09-02
Posts: 23

Re: Can't mount USB hard drive with fstab

Same problem here.
Any solutions other than the rc.local workaround?

Offline

#14 2009-10-28 06:31:35

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: Can't mount USB hard drive with fstab

You could look into writing a custom udev rule for the device. The usual scenario for these rules is that they fire when you insert the device, so I don't know if it would work if the device is there right from the start.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#15 2009-10-28 13:09:27

chilebiker
Member
From: Zurich, Switzerland
Registered: 2006-07-18
Posts: 161

Re: Can't mount USB hard drive with fstab

I've got the same problem here with my external USB-HD. It used to work until a couple of months ago. Then I did the rc.local thing and it kept on working, but lately it doesn't anymore. I kind of got used to do it manually these days.

Some ideas for a sloution:
* put a (long) delay in rc.local
* maybe do something with a cronjob two or three minutes after startup

As I use that HD mostly for backups, I mount/umount them in my backupscripts - so it's not really bothering me. At least not enough to invest the time to find a good solution...


Don't panic!

Offline

#16 2009-10-29 19:16:32

mandog
Member
From: Peru
Registered: 2008-09-17
Posts: 218

Re: Can't mount USB hard drive with fstab

I don't know if this is relevant but I don't have any entries for my external HD in fstab, 
It mounts automatically when plugged in or if booted up plugged in.


I'm dyslexic Please do not complain about puntuation or spelling and remember most dyslexic people have above average iq.

Offline

Board footer

Powered by FluxBB