LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Usb Hdd? (https://www.linuxquestions.org/questions/linux-hardware-18/usb-hdd-285581/)

phishphan420 02-02-2005 09:34 PM

Usb Hdd?
 
I just got Debian Sarge installed, and have many questions. One at a time I guess. I've got a 20 GB USB HDD formatted FAT32, that I'd like to use on my debian system as well. It works under knoppix, but when i plug it into my Deb system, there's no handy notification of new hardware found, nothing to indicate that i even plugged it in. Any clues as to where to start? I really have no clue, but seem to remember someone mentioning the /etc/hotplug folder as pertaining to this? and maybe MODPROBE? Am i gonna have to edit FSTab? And then when i'm done using it, how to safely unmount it(umount?)?

I'm running Debian Sarge, 2.4(not sure) kernel. If I left anything else out, Let me know and I'll fill you in as best i can.

One thing i gotta say is, using the net install, downloading a 50 MB ISO, and then watching it download the other 1.5 GB is pretty damn cool. Made me feel 1337 even. ;)

koheleth 02-02-2005 10:09 PM

Quick Method
 
Might as well try the fast test:

(as root)
Code:

# mkdir /media/usb
# mount /dev/sda1 /media/usb

If /dev/sda1 doesn't work, you may want to try /dev/sda3

Anyway... here's some of the other info you wanted:

Information about the drive (for 2.4 kernels) lives in /proc/bus/usb

To find out what devices are attached to USB, do:

Code:

# cat /proc/bus/usb/devices
USB drives are treated like SCSI drives. You ought to be able to see info about them in /proc/scsi/scsi

Code:

# cat /proc/scsi/scsi
If neither of those work, you may have to modprobe the right modules. You will mainly want (I hope I remember this... I just upgraded my new Sarge install to the 2.6 kernel) usb-storage. That should automatically insmod all of the other stuff (note: usb-uhci might be usb-ohci on yours):

Code:

# modprobe usb-uhci usb-storage
Finally, when you get it all installed, you can edit /etc/fstab. My line for my USB key thingy looks like this:
Code:

/dev/sda1      /media/usbkey  auto    rw,user,noauto  0      0
If you want it all to happen automatically, you will probably need to:

1) add the right modules to /etc/modules to be automatically loaded at boot.
2) install something like supermount or autofs to handle mounting and unmounting (I don't know for sure, but I've heard that hotplug is not the ideal solution, though you may be able to make do with it).

phishphan420 02-03-2005 12:11 PM

Thanks! I'm gonna try this after work tonight.
Could you decipher that FSTab line for me?

MarkhamNR 02-03-2005 05:38 PM

Re: Quick Method
 
koheleth, maybe you (or someone else) can help me with a similar problem I'm having. I have a USB HDD I'm trying to use with Knoppix. (It works fine with FC2.) The drive shows up in /proc/bus/usb/devices and in the output of lsusb and dmesg. It doesn't show up in /proc/scs/scsi, nor can I mount it. (I tried /dev/sd[abcd].)

lsmod shows usb-storage, usb-uhci and usbcore loaded, if that's any help.

Thanks in advance.

Brian1 02-03-2005 06:00 PM

Heres some stuf I have learned messing with USB devices. Some kernel releases may not work with some USB controllers or USB storage devices. Then the next release may see all and work fine. Then the next may not work with the controller again. Later release the controller is fine then the storage device does not. Some devices may work some may not. Currently 2.6.10-fc2 kernel works very well for me It sees and works well with all of my current hardware. The 2.6.9 would see all my hardware ( Printers, 20 storage drive, couple of sandisk cards) but would not my removable MP3 player in the notebook. It new there was something there but failed to recognise it. Kernel 2.6.7 seen it and so does 2.6.10, but 2.6.9 does not. Might see what version each use and go from there. On might even compile a kernel of the same release as the knoppix on fc3 and see if the stitution can be duplicated.

Brian1
" Google the Linux way @ http://www.google.com/linux "

phishphan420 02-03-2005 10:51 PM

The quick test gets:
Code:

P2:/home/david# mkdir /media/usb
P2:/home/david# mount /dev/sda1 /media/usb
mount: you must specify the filesystem type

So i went deeper:
Code:

P2:/home/david# cat /proc/bus/usb/devices
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=1020
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=  8 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0702 Rev= 0.02
S:  Product=USB TO IDE
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 96mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

I think this means that it's detecting my USB HDD, and also that it's supported. I also did cat /proc/scsi/scsi, which gives the following:
Code:

Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: MITBISHI Model: LS-120 COSM  05 Rev: 0515
  Type:  Direct-Access                    ANSI SCSI revision: ffffffff
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: IC25N020 Model: ATMR04-0        Rev: 0811
  Type:  Direct-Access                    ANSI SCSI revision: 02

The first entry I recognize as my LS-120 superdrive. The second is the drive attached to the USB-IDE adapter.
Typing simply 'mount' gives:
Code:

/dev/hda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/hda5 on /home type ext3 (rw)
usbfs on /proc/bus/usb type usbfs (rw)

I got it!!!
Code:

P2:/proc/bus/usb/001# mount -t vfat  /dev/sdb1 /media/usb
it occurred to me that because of the LS-120 drive, USB must be on SDB! Cheers!

-Dave

phishphan420 02-03-2005 11:09 PM

Uh- Oh. Having trouble with umount.
Code:

P2:/media/usb# umount /media/usb
umount: /media/usb: device is busy
umount: /media/usb: device is busy
P2:/media/usb# umount /dev/sdb1
umount: /media/usb: device is busy
umount: /media/usb: device is busy

I'd also like to make some sort of shortcut on my desktop to mount and umount this drive.
Quote:

Originally Posted by koheleth
If you want it all to happen automatically, you will probably need to:

1) add the right modules to /etc/modules to be automatically loaded at boot.
2) install something like supermount or autofs to handle mounting and unmounting (I don't know for sure, but I've heard that hotplug is not the ideal solution, though you may be able to make do with it).

I'd like to know the best, easiest way to do this.

nnsg 02-04-2005 04:40 AM

You are in the /media/usb directory, so it won't umount. :p

"cd" to another directory first.


All times are GMT -5. The time now is 11:20 PM.