View Full Version : USB HD install, almost complete one issue
snowmirage
2007-12-25, 02:07 PM CST
I have 2 WD 500GB hard drives I am trying to setup on my Fedora box.
I am able to mount the first drive, however i can not get it to auto mount by adding the commands to fstab.
At first I thought I was just not follow the nessicary syntax for the fstab file.
However, if I reboot the PC with the usb HD plugged in, when the PC finishes booting, the drive doesnt show up in /dev.
If I unplug the drive and plug it back in while the computer is running at a command line, it sees the drive and attaches it to /dev/sdb1.
Anyone have any ideas on how I can automate this on boot?
I've only been dabbling with linux for 6 months or so now and I'm still trying to get my feet wet.
Thank you for any help you can lend!
-Brandon
joe.pelayo
2007-12-25, 03:13 PM CST
I have 2 WD 500GB hard drives I am trying to setup on my Fedora box.
I am able to mount the first drive, however i can not get it to auto mount by adding the commands to fstab.
At first I thought I was just not follow the nessicary syntax for the fstab file.
However, if I reboot the PC with the usb HD plugged in, when the PC finishes booting, the drive doesnt show up in /dev.
If I unplug the drive and plug it back in while the computer is running at a command line, it sees the drive and attaches it to /dev/sdb1.
Anyone have any ideas on how I can automate this on boot?
I've only been dabbling with linux for 6 months or so now and I'm still trying to get my feet wet.
Thank you for any help you can lend!
-Brandon
Hello Brandon.
First question: Are you dealing with three HDs? (2 WD and a USB one).
Second question: Which file system are you using in both?
Third question: Do both drives show up in the BIOS?
Fourth question: Are they IDE or SATA drives?
Joe.
snowmirage
2007-12-25, 09:31 PM CST
***First question: Are you dealing with three HDs? (2 WD and a USB one).
I have 3 drives in the PC that I am using the OS (fedora) is installed on an internal IDE drive.
The 2 drives I am trying to mount are both USB Western Digital 500GB drives.
***Second question: Which file system are you using in both?
Both drives are formated with FAT32
***Third question: Do both drives show up in the BIOS?
No neither do they are USB drives and the motherboard is a bit out dated and does not support booting from USB.
***Fourth question: Are they IDE or SATA drives?
That is a good question... based on the price I paid I assume they are IDE drives in USB enclosures. However when I plug them in while the OS is loaded they are detected as
sdb
and
sdc
in /dev
(oddly enough my primary internal IDE 8GB drive on the standard IDE controller is also detected as sda now that I think about it not hda)
I am able to get both drives to work, and can read/write to them (at least as root), but I have to jump through hoops to do it.
First boot the PC then log in. Unplug both USB drives. Plug in drive 1 after a few seconds it sees it and registers it in /dev/sdb1 then plug in the 2nd drive which gets registered as /dev/sdc1
I then made a short script that I run for the time being containing then following...
mount -t vfat /dev/sdb1 /mnt/500GBWD1
monnt -t vfat /dev/sdc1 /mnt/500GBWD2
after I do all that and run that script it works i can see the FAT32 partitions and access the files.
But if I turn off the PC (or do a soft reboot) and attempt to have those drives mounted in fstab, it cant find the drives.
After the PC boots if I look in /dev all I see is my internal OS Hard drive (sda) and the USB drives (sdb and sdc) dont show up until I go through and reconnect both drives.
On a second note as I have been working on this all night, I simply CAN NOT change the permissions on these mnt points, no matter what I do I can not change the owner or permissions on 500GBWD1 or 500GBWD2, which I need to do in order to access them via samba. I wonder if this is a USB drive related issue. From what I have read when you mount a drive in fstab you can pass it read and write permission for certain groups in the line of code in fstab.
Something like this..
/dev/sdb1 /mnt/500GBWD1 vfat user,rw,auto,umask=0000
but as I cant mount the drives using fstab I cant test this yet.
Thank you again
-Brandon
joe.pelayo
2007-12-25, 10:04 PM CST
Ok, I misunderstood your post, thought they were all internal devices.
It seems it is a matter of permissions, I remember having something like that in Fedora 7 in two occasions:
The first one I solved it like this: http://www.fedoraforum.org/forum/showpost.php?p=840424&postcount=61
The second one I edited /etc/fstab to delete some lines referring to the device (sdc1) in my case, dunno how did it make its way through inside.
Hope this helps.
Joe.
stevea
2007-12-25, 11:52 PM CST
I am able to get both drives to work, and can read/write to them (at least as root), but I have to jump through hoops to do it.
First boot the PC then log in. Unplug both USB drives. Plug in drive 1 after a few seconds it sees it and registers it in /dev/sdb1 then plug in the 2nd drive which gets registered as /dev/sdc1
I then made a short script that I run for the time being containing then following...
mount -t vfat /dev/sdb1 /mnt/500GBWD1
monnt -t vfat /dev/sdc1 /mnt/500GBWD2
after I do all that and run that script it works i can see the FAT32 partitions and access the files.
I've seen a few USB drives that require a lot of time (seconds) for the system to scan them, figure out they are disks and then create the devices (/dev/sdb...) via udev.
My initial concern was that this was the problem, and that the delay meant that mount -a (uses fstab) ran before the usb disks were available. I doubt this is the the problem. Instead I think there must be something fundamentally wrong in the USB initialization.
It would the useful to reboot the system so the USBs drives are not accessible and collect a little information. Type "lsusb" as root and you should see the devices - perhaps like this:
# lsusb
Bus 001 Device 003: ID 090c:1000 Feiya Technology Corp. Memory Bar
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 002: ID 046d:c521 Logitech, Inc.
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
For more detail on my memory stick I can type:
lsusb -v -s 001:003
You should do the same for your usb disks.
If they absolutely don't appear then please post the output of:
dmesg | grep -i usb
snowmirage
2007-12-26, 09:43 AM CST
Here we go
[root@localhost ~]# lsusb
Bus 001 Device 003: ID 1058:0910 Western Digital Technologies, Inc.
Bus 001 Device 002: ID 1058:0910 Western Digital Technologies, Inc.
Bus 001 Device 001: ID 0000:0000
[root@localhost etc]# lsusb -v -s 001:003
Bus 001 Device 003: ID 1058:0910 Western Digital Technologies, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1058 Western Digital Technologies, Inc.
idProduct 0x0910
bcdDevice 1.06
iManufacturer 1 Western Digital
iProduct 2 External HDD
iSerial 3 574341533831343635333037
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
[root@localhost etc]# lsusb -v -s 001:002
Bus 001 Device 002: ID 1058:0910 Western Digital Technologies, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x1058 Western Digital Technologies, Inc.
idProduct 0x0910
bcdDevice 1.06
iManufacturer 1 Western Digital
iProduct 2 External HDD
iSerial 3 574341533831343739363731
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
[root@localhost dev]# ls
agpgart fd0u1920 null ram9 tty18 tty43 ttyS2
bus fd0u360 nvram ramdisk tty19 tty44 ttyS3
cdrom fd0u720 oldmem random tty2 tty45 urandom
cdrom-sr0 fd0u800 par0 root tty20 tty46 usbdev1.1_ep00
cdrw fd0u820 parport0 rtc tty21 tty47 usbdev1.1_ep81
cdrw-sr0 fd0u830 parport1 scd0 tty22 tty48 usbdev1.2_ep00
cdwriter floppy parport2 sda tty23 tty49 usbdev1.2_ep02
cdwriter-sr0 floppy-fd0 parport3 sda1 tty24 tty5 usbdev1.2_ep81
console full port sda2 tty25 tty50 usbdev1.3_ep00
core fuse ppp sg0 tty26 tty51 usbdev1.3_ep02
disk gpmctl ptmx sg1 tty27 tty52 usbdev1.3_ep81
dvd initctl pts shm tty28 tty53 vcs
dvdrw input ram snapshot tty29 tty54 vcs1
dvdrw-sr0 kmsg ram0 stderr tty3 tty55 vcs2
dvd-sr0 log ram1 stdin tty30 tty56 vcs3
dvdwriter loop0 ram10 stdout tty31 tty57 vcs4
dvdwriter-sr0 loop1 ram11 systty tty32 tty58 vcs5
fd loop2 ram12 tty tty33 tty59 vcs6
fd0 loop3 ram13 tty0 tty34 tty6 vcsa
fd0u1040 loop4 ram14 tty1 tty35 tty60 vcsa1
fd0u1120 loop5 ram15 tty10 tty36 tty61 vcsa2
fd0u1440 loop6 ram2 tty11 tty37 tty62 vcsa3
fd0u1600 loop7 ram3 tty12 tty38 tty63 vcsa4
fd0u1680 lp0 ram4 tty13 tty39 tty7 vcsa5
fd0u1722 MAKEDEV ram5 tty14 tty4 tty8 vcsa6
fd0u1743 mapper ram6 tty15 tty40 tty9 VolGroup00
fd0u1760 mem ram7 tty16 tty41 ttyS0 X0R
fd0u1840 net ram8 tty17 tty42 ttyS1 zero
Contents of fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
So it seems to me that the PC does see the drives on boot it just is not assigning them to a device id in /dev. Or at least not one that I can find. I do notice there are devices in /dev like "usbdev1.1_ep00" and there are acctually about 8 or so now where as before when I was trying to get just one drive to work i only had about 4 maybe 6 i think. I had originally tried using fdisk then I think it was the 'p' option to show me the partitions on the drive, and on all those devices (and a few others in /dev i tried) it never found anything.
snowmirage
2007-12-26, 09:44 AM CST
After I unplug both usb drives...
[root@localhost /]# lsusb
Bus 001 Device 001: ID 0000:0000
[root@localhost /]# cd dev
[root@localhost dev]# ls
agpgart fd0u1920 null ram9 tty18 tty43 ttyS2
bus fd0u360 nvram ramdisk tty19 tty44 ttyS3
cdrom fd0u720 oldmem random tty2 tty45 urandom
cdrom-sr0 fd0u800 par0 root tty20 tty46 usbdev1.1_ep00
cdrw fd0u820 parport0 rtc tty21 tty47 usbdev1.1_ep81
cdrw-sr0 fd0u830 parport1 scd0 tty22 tty48 vcs
cdwriter floppy parport2 sda tty23 tty49 vcs1
cdwriter-sr0 floppy-fd0 parport3 sda1 tty24 tty5 vcs2
console full port sda2 tty25 tty50 vcs3
core fuse ppp sg0 tty26 tty51 vcs4
disk gpmctl ptmx sg1 tty27 tty52 vcs5
dvd initctl pts shm tty28 tty53 vcs6
dvdrw input ram snapshot tty29 tty54 vcsa
dvdrw-sr0 kmsg ram0 stderr tty3 tty55 vcsa1
dvd-sr0 log ram1 stdin tty30 tty56 vcsa2
dvdwriter loop0 ram10 stdout tty31 tty57 vcsa3
dvdwriter-sr0 loop1 ram11 systty tty32 tty58 vcsa4
fd loop2 ram12 tty tty33 tty59 vcsa5
fd0 loop3 ram13 tty0 tty34 tty6 vcsa6
fd0u1040 loop4 ram14 tty1 tty35 tty60 VolGroup00
fd0u1120 loop5 ram15 tty10 tty36 tty61 X0R
fd0u1440 loop6 ram2 tty11 tty37 tty62 zero
fd0u1600 loop7 ram3 tty12 tty38 tty63
fd0u1680 lp0 ram4 tty13 tty39 tty7
fd0u1722 MAKEDEV ram5 tty14 tty4 tty8
fd0u1743 mapper ram6 tty15 tty40 tty9
fd0u1760 mem ram7 tty16 tty41 ttyS0
fd0u1840 net ram8 tty17 tty42 ttyS1
When I plug in the first drive again
[root@localhost dev]# dmesg | tail -12
scsi 4:0:0:0: Direct-Access WD 5000AAJ External 1.06 PQ: 0 ANSI: 0
SCSI device sdb: 976773168 512-byte hdwr sectors (500108 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 00 00 00
sdb: assuming drive cache: write through
SCSI device sdb: 976773168 512-byte hdwr sectors (500108 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 00 00 00
sdb: assuming drive cache: write through
sdb: sdb1
sd 4:0:0:0: Attached scsi disk sdb
sd 4:0:0:0: Attached scsi generic sg2 type 0
and when i plug in the 2nd drive
[root@localhost dev]# dmesg | tail -12
scsi 5:0:0:0: Direct-Access WD 5000AAJ External 1.06 PQ: 0 ANSI: 0
SCSI device sdc: 976773168 512-byte hdwr sectors (500108 MB)
sdc: Write Protect is off
sdc: Mode Sense: 00 00 00 00
sdc: assuming drive cache: write through
SCSI device sdc: 976773168 512-byte hdwr sectors (500108 MB)
sdc: Write Protect is off
sdc: Mode Sense: 00 00 00 00
sdc: assuming drive cache: write through
sdc: sdc1
sd 5:0:0:0: Attached scsi disk sdc
sd 5:0:0:0: Attached scsi generic sg3 type 0
root@localhost dev]# ls
agpgart fd0u360 oldmem root tty16 tty42 ttyS2
bus fd0u720 par0 rtc tty17 tty43 ttyS3
cdrom fd0u800 parport0 scd0 tty18 tty44 urandom
cdrom-sr0 fd0u820 parport1 sda tty19 tty45 usbdev1.1_ep00
cdrw fd0u830 parport2 sda1 tty2 tty46 usbdev1.1_ep81
cdrw-sr0 floppy parport3 sda2 tty20 tty47 usbdev1.4_ep00
cdwriter floppy-fd0 port sdb tty21 tty48 usbdev1.4_ep02
cdwriter-sr0 full ppp sdb1 tty22 tty49 usbdev1.4_ep81
console fuse ptmx sdc tty23 tty5 usbdev1.5_ep00
core gpmctl pts sdc1 tty24 tty50 usbdev1.5_ep02
disk initctl ram sg0 tty25 tty51 usbdev1.5_ep81
dvd input ram0 sg1 tty26 tty52 vcs
dvdrw kmsg ram1 sg2 tty27 tty53 vcs1
dvdrw-sr0 log ram10 sg3 tty28 tty54 vcs2
dvd-sr0 loop0 ram11 shm tty29 tty55 vcs3
dvdwriter loop1 ram12 snapshot tty3 tty56 vcs4
dvdwriter-sr0 loop2 ram13 stderr tty30 tty57 vcs5
fd loop3 ram14 stdin tty31 tty58 vcs6
fd0 loop4 ram15 stdout tty32 tty59 vcsa
fd0u1040 loop5 ram2 systty tty33 tty6 vcsa1
fd0u1120 loop6 ram3 tty tty34 tty60 vcsa2
fd0u1440 loop7 ram4 tty0 tty35 tty61 vcsa3
fd0u1600 lp0 ram5 tty1 tty36 tty62 vcsa4
fd0u1680 MAKEDEV ram6 tty10 tty37 tty63 vcsa5
fd0u1722 mapper ram7 tty11 tty38 tty7 vcsa6
fd0u1743 mem ram8 tty12 tty39 tty8 VolGroup00
fd0u1760 net ram9 tty13 tty4 tty9 X0R
fd0u1840 null ramdisk tty14 tty40 ttyS0 zero
fd0u1920 nvram random tty15 tty41 ttyS1
now in /dev I have sdb and sdc coming up, and as I said I can mount these using the mount command.
[root@localhost dev]# lsusb
Bus 001 Device 005: ID 1058:0910 Western Digital Technologies, Inc.
Bus 001 Device 004: ID 1058:0910 Western Digital Technologies, Inc.
Bus 001 Device 001: ID 0000:0000
lsusb seems to be the same (assigns ID 4 and 5 instead of 3 and 2 I assume this is due
to the fact they were already plugged in once)
as far as the permissions, maybe I simply need to mount the drives in the users folder, instead of in /mnt/something do /home/username/something I would think that the user should then have read write execute permissions by default.
Once again thank you for all the help
rbo83
2007-12-26, 10:05 AM CST
Please note that vfat(FAT32) is a Microsoft format that does not support unix-style permissions, so that the fstab should not contain the umask parameter. Just mount the drive to a partition accessible by all users, if that's what you want. Your /mnt/something permissions should be 0777 if all users should read/write/execute
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.