Click to See Complete Forum and Search --> : USB Travel (Flash) Drive
mishmo43
07-28-2004, 05:24 PM
I'm really just a beginner with Linux and have Red Hat 7.2 installed on a laptop that runs a milling machine. I just bought a USB Travel (flash) drive that is Linux 2.4X compatible. It gave me a line of code to type into the command console to mount the drive. The line is:
mkdir -p /mnt/trek ;mount -tvfat /dev/sda1 /mnt/trek
It made the directory but then gave me the error message:
mount: /dev/sda1 is not a valid block device
I have searched through a bunch of posts here, but I can't seem to solve the problem. I did try loading usb-storage and one other command (that I found on someone's post) that gave me an error. I believe my problem probably stems from not knowing ENOUGH about Linux and the commands. In any case, I have been trying everything that seems relevant, but nothing works. :confused:
Please help!
banzaikai
07-29-2004, 09:48 AM
Okay, one more time, from the top:
:D
Open up a terminal. Type>
/sbin/lsmod
There should be something like this:
Module Size Used by Tainted: P
ide-cd 32256 0 (autoclean)
sr_mod 16632 0 (autoclean)
cdrom 32128 0 (autoclean)
[I]blah... blah...
vfat 12092 3 (autoclean)
fat 36984 0 (autoclean) [vfat]
usb-storage 69184 1
usb-uhci 24676 0 (unused)
usbcore 73792 1 [usb-storage usb-uhci]
ext3 65984 2
jbd 47500 2 [ext3]
aic7xxx 133248 0
sd_mod 12828 2
scsi_mod 107548 5 [sr_mod usb-storage aic7xxx sd_mod]
Of course, your mileage may vary...
Now, the lines we're looking for deal with usb and scsi:
usb-storage 69184 1
usb-uhci 24676 0 (unused)
usbcore 73792 1 [usb-storage usb-uhci]
scsi_mod 107548 5 [sr_mod usb-storage aic7xxx sd_mod]
aic7xxx 133248 0
sd_mod 12828 2
In my case, I actually have a scsi card (aic-78xx), and a zip drive hooked up (sd-mod), so we can ignore those for your case. This leaves us with:
usb-storage 69184 1
usb-uhci 24676 0 (unused)
usbcore 73792 1 [usb-storage usb-uhci]
scsi_mod 107548 5 [usb-storage]
The key here is to look at the "Used by..." column. Here's the rundown: the usb-uhci/ohci and usbcore modules load to get the usb up and running. The usb-storage then looks for your flash drive (I have both the Lexar 64M and 256M Jumpdrives), and proceeds to detect them, via the scsi_mod, as /dev/sda# (in my case, /dev/sdb1&2). If you have all these loaded, and the "Used by" matches up, then you'll need to:
mkdir /mnt/whatever-fancy-name-you-want
and
mount -tvfat /dev/sda1 /mnt/whatever
You should then be able to "ls /mnt/whatever". If you still have the error, check to see if your drive is at some other ID (as mentioned, mine are at sdb1 because my scsi card grabs sda# IDs). It may be that another device (usb or ide-scsi emulation) has already used the sda#. You can see what's already there by using "mount -l". Mine looks like:
usbdevfs on /proc/bus/usb type usbdevfs
/dev/sdb1 on /mnt/jumpdrive type vfat
Oops. Once I put a disk into my zip or cdrw:
usbdevfs on /proc/bus/usb type usbdevfs
/dev/sdb1 on /mnt/jumpdrive type vfat
/dev/cdrom on /mnt/cdrom type iso9660
/dev/sda4 on /mnt/zip100.0 type vfat
Ahh. Much better. Note that on a scsi card, the number reflects the actual ID (my zip is set to id4, so it's sda4; my cdrw is set to id3, so it's sda3; etc.). The usb/scsi routine takes them as they find them. Start at sda0, and work up from there.
Once you find it/them, you can add it in your fstab so that you can right-click on the desktop and mount/umount it from the menu. Neat. Of course, hotplug would work as well...
Hope this gets you started and running...
banzai "cold feet for hotplug" kai
mishmo43
07-29-2004, 05:30 PM
Thank you for your response.
When I run "lsmod" on the machine with Red Hat 7.2 there is nothing that even implies that there are USB ports connected to the machine. Is there a way to tell it that the ports are there? They did work fine when the laptop was a Windows based machine.
I installed Fedora on another laptop, ran "lsmod" and did see the whole list of modules as you said I should see. I ran the above mounting code on the Fedora machine and it worked fine.
The big problem is the software that runs my CNC mill is on the Red Hat laptop, and won't seem to work with Fedora. I don't want to take too many chances with the Red Hat machine, because I don't want the milling software to stop working. I had a lot of difficulty getting it to work in the first place. I am using this Flash Drive to transfer CNC files from my desktop to the CNC laptop - or at least that is the intention if it ever works!
Is there any way to make the Red Hat laptop see those USB ports? Is there a series of commands that I should be entering to enable USB?
banzaikai
07-30-2004, 09:33 AM
Which modules do you have/have not?
First, we need to see which usb chipset you have, so:
/sbin/lspci
will get you something like this:
00:07.0 ISA bridge: Intel Corporation 82371AB PIIX4 ISA (rev 02)
00:07.1 IDE interface: Intel Corporation 82371AB PIIX4 IDE (rev 01)
00:07.2 USB Controller: Intel Corporation 82371AB PIIX4 USB (rev 01)
00:07.3 Bridge: Intel Corporation 82371AB PIIX4 ACPI (rev 02)
My motherboard uses the Intel 82371 controller, which is 100% supported by RH7.2.
You may have any one of a number of chipsets, one of which may not have been supported by 7.2 because it hadn't been invented yet. Anyhow,
You'll then have to check for the modules:
/sbin/modprobe usbcore
/sbin/modprobe usb-ohci
/sbin/modprobe usb-uhci
/sbin/modprobe usb-storage
(Note: usb-uhci is the usb 1.1 controller, and usb-ohci is the usb2. Use the appropriate version for your device.)
If you have recompiled your kernel or tweaked the system in any way, those modules may not have been loaded, but since you mentioned "WinXP" and "laptop", my guess is the chipset wasn't recognized, and the modules were skipped.
Another quick trick to try is to plug in a usb hub, and plug the drive into that. It may like the chipset on the hub better than the one on the mobo (my Belkin 4-port hub works fine, as does a cheap no-name one I found).
Now, if modprobing works, then you can insmod the modules to make 'em "stick":
/sbin/insmod usbcore
/sbin/insmod usb-ohci
/sbin/insmod usbc-uhci
/sbin/insmod usb-storage
You could also do this by running the kernel configuration through the GUI, and answering "yes" to the usb stuff. Only do this if you have the sources for everything, otherwise stick to modprobe and insmod.
Lastly, you may want to look into updating the CNC program, or try using tar to transfer the program to a machine that does have usb working (your Fedora box). Maybe try using wi-fi to transfer via network. Maybe even burn CDRs to transfer (and backup!).
We'll figure this out, yet...
banzai "modprobe usbhardcore" kai