LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Cannot Mount Ext. USB Hard Drive (https://www.linuxquestions.org/questions/linux-hardware-18/cannot-mount-ext-usb-hard-drive-342922/)

sall 07-13-2005 05:12 PM

Cannot Mount Ext. USB Hard Drive
 
I am fairly new to Linux and I am having trouble getting my External USB Hard drive to automount or mount on boot up. I have tried to create the mount point in the terminal as:

mkdir /mnt/usbdrive

Okay, fairly simple. It creates the mountpoint in the directory I specified. Now, I go to edit the /etc/fstab file in the terminal as:

sudo gedit /etc/fstab

This is what comes up:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 ro,user,noauto 0 0

Okay, now I shall add the information for the External USB Hard Drive as:

/dev/sda1 /mnt/usbdrive vfat defaults,user 0 0

and then save the file and reboot.

But this what comes up in the boot sequence:

mount: special device /dev/sd1 does not exist

now I know that the USb Hard Drive is using the /dev/sda1 path does anyone know what the problem is. All help is appreciated!

Thank you,
Sall

Ateo 07-13-2005 06:51 PM

Reread your post. Either it's a typo here in the forum or a typo in your configuration.
Quote:

Okay, now I shall add the information for the External USB Hard Drive as:

/dev/sda1 /mnt/usbdrive vfat defaults,user 0 0

and then save the file and reboot.

But this what comes up in the boot sequence:

mount: special device /dev/sd1 does not exist
How do you know which device your drive is? What is the output of "dmesg |grep -i sda"?

sall 07-13-2005 07:00 PM

Here is my output from dmesg |grep -i sda

craig@laptop:~$ dmesg |grep -i sda
SCSI device sda: 156301488 512-byte hdwr sectors (80026 MB)
sda: assuming drive cache: write through
SCSI device sda: 156301488 512-byte hdwr sectors (80026 MB)
sda: assuming drive cache: write through
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
craig@laptop:~$


Notice something I didn't catch?

Brian1 07-13-2005 07:24 PM

Add the auto opiton to your fstab line. It will not mount till usb modules are loaded. Once USB modules are loaded then the drive will automount.
/dev/sda1 /mnt/usbdrive vfat defaults,auto,user 0 0

sall 07-13-2005 07:46 PM

I tried your suggestion Brian1 and still had the same result. When Ubuntu was loading devices it states as before:

mount: special device sda1 does not exist

Any other suggestions?

IamDaniel 07-13-2005 08:03 PM

Quote:

Originally posted by sall
I tried your suggestion Brian1 and still had the same result. When Ubuntu was loading devices it states as before:

mount: special device sda1 does not exist

Any other suggestions?

If it does not exist...you need to create it...

First, determine whether it is indeed already there:

Code:

~$ cat /proc/partitions
examine the `diff' before and after you plugged your ext. drive.

sall 07-13-2005 08:29 PM

I am Daniel I looked into your suggestion and checked to see if it was already there. I used the command:

~$ cat /proc/partitions

& this is what I received with it:

craig@laptop:~$ cat /proc/partitions
major minor #blocks name

3 0 39070080 hda
3 1 37744686 hda1
3 2 1 hda2
3 5 1325331 hda5
254 0 37744686 dm-0
254 1 1325331 dm-1
8 0 78150744 sda
8 1 78140128 sda1

Also I tried experimenting with /etc/fstab file and found then only when I use:

/dev/sda1 /mnt/usbdrive vfat noauto,user 0 0

&

/dev/sda1 /mnt/usbdrive vfat noauto 0 0

I do NOT receive the error when booting up that states:

mount: special device sda1 does not exist

but of course this does not do the job I want.

Pondering other ideas right now.... thank for the help, keep posting

IamDaniel 07-14-2005 08:07 PM

Quote:

Originally posted by sall
I am Daniel I looked into your suggestion and checked to see if it was already there. I used the command:

~$ cat /proc/partitions

& this is what I received with it:

craig@laptop:~$ cat /proc/partitions
major minor #blocks name

3 0 39070080 hda
3 1 37744686 hda1
3 2 1 hda2
3 5 1325331 hda5
254 0 37744686 dm-0
254 1 1325331 dm-1
8 0 78150744 sda
8 1 78140128 sda1

Also I tried experimenting with /etc/fstab file and found then only when I use:

/dev/sda1 /mnt/usbdrive vfat noauto,user 0 0

&

/dev/sda1 /mnt/usbdrive vfat noauto 0 0

I do NOT receive the error when booting up that states:

mount: special device sda1 does not exist

but of course this does not do the job I want.

Pondering other ideas right now.... thank for the help, keep posting

Is it the device that marked with red color?

which filesystem the drive formatted?

As root, try the following:

Code:

~# /sbin/fdisk -l /dev/sda

michaelk 07-14-2005 10:10 PM

BTW what distribution / version of linux are you running?
In most cases the USB modules are not loaded when the OS mounts the filesystems via fstab and AFAIK the OS will not wait until the modules are loaded. There are several ways to fix this problem. Compile the USB modules into the kernel, add a line to mount the drive by adding a command to the /etc/rc.local file or add the usb modules to the initrd image if your linux distro uses one. The /etc/rc.local file method is the easiest to accomplish by adding a mount command.

Ben2210 07-15-2005 07:02 AM

Wait a minute .... you say you get this message :
Code:

mount: special device sda1 does not exist
OK, then perhaps it REALLY doesn't exist, in which case you might consider creating it !

What is the output of the following command ?
Code:

ls -l /dev/sda1
If it shows nothing, then create the special device with the following command :
Code:

mknod /dev/sda1 b 8 1
Note that :
1) the numbers "8 1" are found in the output of cat /proc/partitions ;
2) you'll probably want to modify your udev configuration to have this device added permanently.

sall 07-15-2005 08:11 AM

The operating system I use is Ubuntu 5.04 with 2.6.10-5-386 kernel running KDE 3.4.0. I tried to edit the /etc/rc.local file but it does not exist on the sytem.

And also I tried the $ ls -l /dev/sda1 command and received this:

craig@laptop:~$ ls -l /dev/sda1
brw-r----- 1 root plugdev 8, 1 2005-07-15 08:56 /dev/sda1
craig@laptop:~$ /sbin/fdisk -l /dev/sda

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 9728 78140128+ c W95 FAT32 (LBA)

which is what I expected and should use the vfat type correct if I am not mistaken?


And I tried the $ ls -l /dev/sda1 command and the output was:

craig@laptop:~$ ls -l /dev/sda1
brw-r----- 1 root plugdev 8, 1 2005-07-15 08:56 /dev/sda1
craig@laptop:~$

So I know the device does indeed exists..
I have no clue what is up?? Maybe it comes back to the USB modules not being loaded whe the system mounts as michaelk suggested?

Ben2210 07-15-2005 08:25 AM

OK.

1) Show us the exact command you use to mount /dev/sda1. Looks like you've asked to mount sda1, not /dev/sda1.

You should be writing something like
mount /dev/sda1
and not
mount sda1

2) Try passing the -v option to mount, to make it verbose. Post the output here.

3) Look for useful info in the files syslog and messages in /var/log.
Also try the dmesg command.
It should mention your USB drive a few seconds after you plug it.

sall 07-15-2005 08:42 AM

Ben 2210 I can manually mount the hard drive, I am trying to mount the USb drive at boot so I odn't have to manually load it. This is the exact comand I use to attempt to automount in fstab:

/dev/sda1 /mnt/usb vfat defaults,user 0 0

Everytime when booting up it says the device does not exist, but as in later posts the device does exist, for just some reason it does not work.

Ben2210 07-15-2005 08:52 AM

OK,sorry.

If you want you usb-key mounted on bootup, and the standard automount doesn't work for you, you have to modify your boot scripts.
Probably it tries to mount your USB key too early in the boot process, before USB is properly handled.

The easiest solution is to add a command mounting your USB key, near the end of the boot process. I don't know Ubuntu or Debian, but I think that their boot scripts are in

/etc/init.d

try to cd to that directory. Or try /etc/rc.d

Then look for a file called rc.local. If it doesn't exist, type ls and post the output here.

Edit rc.local, and add (at the end of it) :
mount /dev/sda1

see if that works.

Another solution could be
rmmod usb_storage
modprobe usb_storage


EDIT : I see that it's exactly what michaelk has told you to do. Just check for the exact location of the rc.local file, and it'll work !

sall 07-15-2005 09:18 AM

Alright, I attempted that as well however could not find the rc.local file in either place. When i used the comand:

cd /etc/init.d

It went to that directory, but trying to find rc.local failed

The out put of ls in this directory was:

root@laptop:~ # cd /etc/init.d
root@laptop:/etc/init.d # ls
README fetchmail mdadm rmnologin
acpi-support gdm mdadm-raid rsync
acpid halt module-init-tools samba
alsa hdparm mountall.sh screen-cleanup
anacron hostname.sh mountnfs.sh sendsigs
apmd hotplug mountvirtfs single
atd hwclock.sh networking skeleton
bootclean.sh hwclockfirst.sh ntpdate stop-bootlogd
bootlogd ifupdown pcmcia sudo
bootmisc.sh ifupdown-clean postfix sysklogd
checkfs.sh inetd powernowd udev
checkroot.sh initrd-tools.sh ppp udev-mtab
console-screen.sh kdm pppd-dns umountfs
cron keymap.sh procps.sh umountnfs.sh
cupsys klogd rc urandom
dbus-1 libdevmapper1.00 rcS vbesave
dns-clean lvm readahead vmware
evms makedev reboot xorg-common

And also, the directory /etc/rc.d does not exist.

I'm not quite sure...


All times are GMT -5. The time now is 07:14 PM.