LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   External Hard Drives for Linux (https://www.linuxquestions.org/questions/linux-hardware-18/external-hard-drives-for-linux-192367/)

Electro 06-13-2004 05:41 AM

Firewire has the least overhead than USB, so Firewire is much faster. Both Firewire and USB is still unstable in LINUX. Use SATA, its a lot faster and it has much, much less overhead than Firewire and USB. With SATA you can get about 60 megabytes per second (if there is no filesystem overhead) and the transfer will not stall like USB or Firewire. What I read in this forum, USB 2.0 under Linux can not transfer more than 1 megabyte per second. I have used USB 1.0, I only get less than 500 kilobytes per second and copying large files stalls for a few seconds.

eccles23 06-13-2004 06:30 AM

I just set up a USB harddrive (actually it was a plain normal western digital IDE drive in a more or less no-name external USB harddrive box that I got for it) under debian.

I don't know what the support is like under earlier kernels, but I compiled by hand the 2.6.6 kernel (there were just a couple of things I needed to update/add first, but you can find a list of the most important stuff in docs/Changes (I think) in the kernel source tree).

The most important thing I wanted to say (and the reason I am writing this post) is that in order to ensure you have USB *2.0* support, and not just USB support, you must load the driver ehci-hcd. If you don't, you WILL be able to mount the drive, but you will wonder why you get continual I/O errors after you start reading from it and it just drops off the device tree. PROBLEMS (I imagine exactly the same style of problem you'd have if you tried to add one to a motherboard that was not USB 2.0 compatible).

so... ehci-hcd (as well as uhci-hcd which is your generic usb driver).

Also you will need the sd_mod installed. this is the SCSI disk module. You need this because it mounts the drive as a scsi device (so I imagine you would also need 'allow SCSI emulation' compiled (you should find this in the ATA/IDE/whatever section under 'device drivers' in the kernel config).

and just so you know when you are on the right track, here is a selection of relevant output from dmesg:



SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
ehci_hcd 0000:00:1d.7: Intel Corp. 82801EB USB2
ehci_hcd 0000:00:1d.7: irq 23, pci mem f8830000
ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:1d.7: USB 2.0 enabled, EHCI 1.00, driver 2003-Dec-29
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 8 ports detected
USB Universal Host Controller Interface driver v2.2
uhci_hcd 0000:00:1d.0: Intel Corp. 82801EB USB
uhci_hcd 0000:00:1d.0: irq 16, io base 0000bc00
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
uhci_hcd 0000:00:1d.1: Intel Corp. 82801EB USB
uhci_hcd 0000:00:1d.1: irq 19, io base 0000b000
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 3
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
uhci_hcd 0000:00:1d.2: Intel Corp. 82801EB USB
uhci_hcd 0000:00:1d.2: irq 18, io base 0000b400
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 4
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 2 ports detected
uhci_hcd 0000:00:1d.3: Intel Corp. 82801EB USB
uhci_hcd 0000:00:1d.3: irq 16, io base 0000b800
uhci_hcd 0000:00:1d.3: new USB bus registered, assigned bus number 5
hub 5-0:1.0: USB hub found
hub 5-0:1.0: 2 ports detected
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb 1-4: new high speed USB device using address 2
scsi2 : SCSI emulation for USB Mass Storage devices
Vendor: Genesys Model: USB to IDE Disk Rev: 0002
Type: Direct-Access ANSI SCSI revision: 02
USB Mass Storage device found at 2
SCSI device sda: 390721968 512-byte hdwr sectors (200050 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
sda: sda1
Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0



I have picked out the more important bits in bold.

SoI *think* the modules needed (which can be compiled as modules or into the kernel) are:
usbcore
usbfs
hub
ehci_hcd
uhci_hcd
usb-storage
(scsi2 ?)
ide-scsi (scsi emulation)
sd_mod

maybe one or two more.
But just make sure you enable EHCI :)

oh and one more thing - as you can see - it's added the device as /dev/sda... and the single partition I put on the drive is called sda1. But the first time you mount the drive after buying it, you will need to run 'cfdisk /dev/sda' to partition the drive, and then run 'mkfs.ext3 /dev/sda1' (or whatever the partitions you put on it are, and whatever the filesystem you want is) to format it.
Then you can stick lines in /etc/fstab to have the partitions automounted at boot - just like you do with anything else.

However keep in mind that if you unplug it, and plug it back in - it will then be on the NEXT scsi channel... not sda but sdb (I think) and so on... it will keep incrementing by one each time.

I think with this info you should be able to muddle though - after all mine is working now ;) and that's more or less what I found I needed to do.


enyawix 06-13-2004 08:28 AM

Electro you have bad info i just served a file with apache from a usb2 drive at 11.1mb/sec
usb2 must be faster but that is as fast as i can move a file over my 10/100 network.
this was on Apache 2.0.49-r3 Gentoo Linux 3.3.2-r5 gcc 3.3.2 CFLAGS="-O3 -march=athlon-xp -funroll-loops -fprefetch-loop-arrays -pipe" on asus a7n8x dx 512mb ram

KingofBLASH 06-13-2004 08:37 AM

This is like 802.11g. Do you need the extra bandwidth? Firewire is faster than USB 2.0, which is faster than USB 1.0. However, will the OP be doing the kind of bandwidth hungry applications where it will be noticed?


All times are GMT -5. The time now is 02:16 AM.