LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-31-2003, 02:39 PM   #1
invictus
Member
 
Registered: Jun 2003
Location: Waterloo, ON, Canada
Distribution: Debian/Woody 2.4.19 kernel
Posts: 46

Rep: Reputation: 15
How do I mount a USB key?


Happy new year, everyone!

I'm running Woody Debian, kernel 2.4.21, with USB support compiled in, to the best of my knowledge. I've failed to mount a USB key. The following are the relevant lines (I think?) from my /etc/fstab and /etc/mtab files.

fstab:
Code:
# <file system> <mount point>   <type>  <options>               <dump>  <pass>
proc            /proc           proc    defaults                0       0
none            /proc/bus/usb   usbfs   defaults                0       0
mtab:
Code:
proc /proc proc rw 0 0
none /proc/bus/usb usbfs rw 0
I attempted the following:
alpha:~# mount -t usbfs /proc/bus/usb /usb

This had the unfortunate effect of mounting the contents of /pro/bus/usb onto /usb.

alpha:~# mount /proc/bus/usb/ /usb
mount: /proc/bus/usb/ is not a block device
(which means... what exactly?)

I also believe that the key was originally formatted to work with MacOS, so if you can tell me the likely file system type, that'd be great.

Thanks!
 
Old 12-31-2003, 03:11 PM   #2
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
the keys use the vfat (or fat?) filesystem for storage.

mount -t vfat /dev/sda1 /mnt/yourdir

That does it.

edit /etc/fstab as such also.
 
Old 12-31-2003, 05:36 PM   #3
invictus
Member
 
Registered: Jun 2003
Location: Waterloo, ON, Canada
Distribution: Debian/Woody 2.4.19 kernel
Posts: 46

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by llamakc
the keys use the vfat (or fat?) filesystem for storage.

mount -t vfat /dev/sda1 /mnt/yourdir

That does it.

edit /etc/fstab as such also.
Thanks, but it didn't quite do the trick.

The following error is returned:

alpha:~# mount -t vfat /dev/sda1 /usb
mount: /dev/sda1 is not a block device

The same is returned when trying /dev/usb, /dev/sda* (any of the ones tried), or /dev/usb/ez0

It's so close I can taste it!
 
Old 12-31-2003, 05:40 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
when you plug it in and run "dmesg" you should be able to clearly see the driver create a /dev entry...
 
Old 12-31-2003, 05:40 PM   #5
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
Since you are using Debian I can help more.

apt-get install hotplug sg3-utils

Then plug the USB in after those install. Now, do

sg_scan -i

this will give you RAW output from SCSI that looks like:

/dev/sg1: scsi1 channel=0 id=0 lun=0 [em] type=0

SOME PRODUCT NAME 1.00 [wide=0 sync=0 cmdq=0 sftre=0 pq=0x0]

# NOW do this:

sg_map

this will map your SCSI to the device table and will look like:

/dev/sg1 /dev/sda

Then my mount command should work. Sorry I forgot this.
 
Old 12-31-2003, 05:48 PM   #6
invictus
Member
 
Registered: Jun 2003
Location: Waterloo, ON, Canada
Distribution: Debian/Woody 2.4.19 kernel
Posts: 46

Original Poster
Rep: Reputation: 15
Hmmm... Thank you both, BUT...

First, dmesg has no mention of anything remotely resembling USB. The only thing it gives me is...
Code:
03:01: rw=0, want=16117, limit=1
Directory sread (sector 0x7de9) failed
attempt to access beyond end of device
03:01: rw=0, want=16117, limit=1
Directory sread (sector 0x7de9) failed
attempt to access beyond end of device
03:01: rw=0, want=16117, limit=1
Directory sread (sector 0x7de9) failed
Any clues as to the significance of that?

As for your suggestion, llamakc, here're the results.

Installed without problems, but sg_scan -i returns only my CDRW drive, as follows:
Code:
alpha:~# sg_scan -i
/dev/sg0: scsi0 channel=0 id=0 lun=0 [em]  type=5
    AOPEN     CD-RW CRW2440     2.02 [wide=0 sync=0 cmdq=0 sftre=0 pq=0x0] 

alpha:~# sg_map
/dev/sg0  /dev/scd0
This seems to say that USB support is not compiled/enabled on the system, which is passing strange.

Any suggestions on how I proceed are most welcome.
 
Old 12-31-2003, 05:52 PM   #7
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
Let's see the output of uname -r and lsmod.
 
Old 12-31-2003, 06:22 PM   #8
invictus
Member
 
Registered: Jun 2003
Location: Waterloo, ON, Canada
Distribution: Debian/Woody 2.4.19 kernel
Posts: 46

Original Poster
Rep: Reputation: 15
Here they are:
alpha:~# uname -r
2.4.21Test1
alpha:~# lsmod
Module Size Used by Not tainted
alpha:~#

I should mention that all the necessary modules were included in the kernel itself at compile time, so I'm not sure how to get at them. Modprobe keeps screaming about errors, too, for the same reason.
 
Old 12-31-2003, 06:25 PM   #9
llamakc
Member
 
Registered: Nov 2003
Distribution: Debian & Ubuntu
Posts: 402

Rep: Reputation: 31
You compiled your own kernel and forgot usb mass_storage support. If you continue to use your own kernel, you'll want a quick recompile. This will fix it. Any of the errors the modprobe spits out are related to the file /etc/modules which dictates modules that get loaded at boot. You can comment them out if you compiled that same functionality into the kernel.

Once you compile that function INTO the kernel, it's in. You can't remove it. That's the ease and coolness about modules: you can remove them from the kernel.

Recompile with usb support for mass storage devices. You'll be a-okay.
 
Old 01-01-2004, 04:41 PM   #10
r_jensen11
Senior Member
 
Registered: Apr 2003
Location: Minnesota, USA
Distribution: Slack 10.0 w/2.4.26
Posts: 1,032

Rep: Reputation: 45
Re: How do I mount a USB key?

Quote:
Originally posted by invictus
Happy new year, everyone!

I'm running Woody Debian, kernel 2.4.21, with USB support compiled in, to the best of my knowledge. I've failed to mount a USB key. The following are the relevant lines (I think?) from my /etc/fstab and /etc/mtab files.

fstab:
Code:
# <file system> <mount point>   <type>  <options>               <dump>  <pass>
proc            /proc           proc    defaults                0       0
none            /proc/bus/usb   usbfs   defaults                0       0
mtab:
Code:
proc /proc proc rw 0 0
none /proc/bus/usb usbfs rw 0
I attempted the following:
alpha:~# mount -t usbfs /proc/bus/usb /usb

This had the unfortunate effect of mounting the contents of /pro/bus/usb onto /usb.

alpha:~# mount /proc/bus/usb/ /usb
mount: /proc/bus/usb/ is not a block device
(which means... what exactly?)

I also believe that the key was originally formatted to work with MacOS, so if you can tell me the likely file system type, that'd be great.

Thanks!
use vfat instead of usbfs, that's how I have mine set up.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ivman/hal fail to mount my usb memory key Valhalla Linux - Hardware 0 11-01-2005 09:50 AM
USB LexarMedia 32MB Data-Key + KDE 3.2=USB/HD Access problems that_guy Slackware 0 02-03-2005 08:27 AM
how to mount disk on key with kernel 2.6.7 alexrait1 Slackware 10 07-22-2004 03:37 PM
mount usb module then mount usb hard drive guanyu Linux - Hardware 1 10-08-2003 11:50 AM
Trying to mount USB MP3 storage key (128Mb) hamster Linux - Hardware 5 04-06-2003 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration