Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to mount an usb memory stick?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
seteh
n00b
n00b


Joined: 13 Apr 2004
Posts: 3

PostPosted: Sat Jul 24, 2004 9:51 am    Post subject: How to mount an usb memory stick? Reply with quote

First of all: hi everyone, this is my first post. And sorry if I'm bringing up a topic that has already been discussed - searching didn't help me.

I'm trying to get my usb memory stick to work under Gentoo. I'm using kernel-2.6.7-gentoo-r8. This is what I get in /var/log/messages when I plug the stick in:

Jul 24 12:39:22 xxx usb 1-5: new high speed USB device using address 2
Jul 24 12:39:22 xxx Initializing USB Mass Storage driver...
Jul 24 12:39:22 xxx scsi0 : SCSI emulation for USB Mass Storage devices
Jul 24 12:39:22 xxx Vendor: SanDisk Model: Cruzer Mini Rev: 0.1
Jul 24 12:39:22 xxx Type: Direct-Access ANSI SCSI revision: 02
Jul 24 12:39:22 xxx Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0
Jul 24 12:39:22 xxx USB Mass Storage device found at 2
Jul 24 12:39:22 xxx usbcore: registered new driver usb-storage
Jul 24 12:39:22 xxx USB Mass Storage support registered.
Jul 24 12:39:22 xxx scsi.agent[7166]: disk at /devices/pci0000:00/0000:00:10.3/usb1/1-5/1-5:1.0/host0/0:0:0:0

So as far as I can tell, it seems to be recognized. But now, how do I mount/access it? Thanks for your help.
Back to top
View user's profile Send private message
sireyessire
Advocate
Advocate


Joined: 20 Mar 2003
Posts: 2991
Location: back in Paris, France

PostPosted: Sat Jul 24, 2004 9:59 am    Post subject: Re: How to mount an usb memory stick? Reply with quote

seteh wrote:

Jul 24 12:39:22 xxx scsi0 : SCSI emulation for USB Mass Storage devices
Jul 24 12:39:22 xxx Vendor: SanDisk Model: Cruzer Mini Rev: 0.1
Jul 24 12:39:22 xxx Type: Direct-Access ANSI SCSI revision: 02
Jul 24 12:39:22 xxx Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0


As you can read, linux uses a scsi emulation to deal with usb key. Fortunately your kernel seems to be well configured to recognize usbkey as scsi device. Now you have to mount it with:
Code:
# mkdir /mnt/usbkey
# mount /dev/sdg0 /mnt/usbkey

NB : # means you have to be root
But you should first check if your kernel can deal with the filesystem of your key (fat i think).
then you can enjoy your key. :mrgreen:

If you want users to use freely the usbkey you have to dive into /etc/fstab to configure it :wink:
_________________
I never think of the future. It comes soon enough.
Albert Einstein

Try simpler first
Shockley
Back to top
View user's profile Send private message
seteh
n00b
n00b


Joined: 13 Apr 2004
Posts: 3

PostPosted: Sat Jul 24, 2004 11:26 am    Post subject: Re: How to mount an usb memory stick? Reply with quote

Code:
# mkdir /mnt/usbkey
# mount /dev/sdg0 /mnt/usbkey


There's no /dev/sdg0. There is /dev/sg0 but trying to mount it I get "mount: /dev/sg0 is not a block device".
What am I missing here?
Back to top
View user's profile Send private message
bennettp
Guru
Guru


Joined: 22 Feb 2004
Posts: 335
Location: on my back and tumbling

PostPosted: Sat Jul 24, 2004 11:35 am    Post subject: Reply with quote

Try /dev/sda1.

I'm assuming you use devfs (the default/easiest option). When the kernel detects your usb drive, devfs will allocate the next available device node. If there are no other scsi devices, then this will be /dev/sda1.

So try # mount /dev/sda1 /mount/point

If you have other scsi devices, then try others: /dev/sdb1, sdc1, etc.
Back to top
View user's profile Send private message
bennettp
Guru
Guru


Joined: 22 Feb 2004
Posts: 335
Location: on my back and tumbling

PostPosted: Sat Jul 24, 2004 11:39 am    Post subject: Reply with quote

Also, my usb pen drive doesn't have a partition table (the 1 in sda1 refers to the partition number), so i need to mount mine using /dev/sda. If you have any trouble with sda1 (or sdb1, etc), try mounting sda (or sdb, etc).

Also, make sure you unmount the drive before you unplug it, otherwise the /dev/ entry will be stuck there. Until you reboot. Its a bug in devfs, which, as far as I know, can only be fixed by switching to udev.
Back to top
View user's profile Send private message
ctford0
l33t
l33t


Joined: 25 Oct 2002
Posts: 774
Location: Lexington, KY,USA

PostPosted: Sat Jul 24, 2004 12:33 pm    Post subject: Reply with quote

bennettp wrote:
Also, my usb pen drive doesn't have a partition table (the 1 in sda1 refers to the partition number), so i need to mount mine using /dev/sda. If you have any trouble with sda1 (or sdb1, etc), try mounting sda (or sdb, etc).


This is also a bug because sdax relates to a device number not a partition. My HP printers photo card reader is sda1 where as my usb zip drive is always sda4. BTW, the I've had the zip driver longer than the printer and it has always been sda4 so devfs somehow relates it to the device type.

EDIT: Not getting the correct device number could also be lack of usbfs support. I've never really messed with it enough to know if it's a bug in devfs or lack of usbfs support.

chris
Back to top
View user's profile Send private message
seteh
n00b
n00b


Joined: 13 Apr 2004
Posts: 3

PostPosted: Sat Jul 24, 2004 2:16 pm    Post subject: Reply with quote

Ok, I finally got it to work. There was still some scsi stuff missing from the kernel. Now i have one reason less to use windows :P
Back to top
View user's profile Send private message
bennettp
Guru
Guru


Joined: 22 Feb 2004
Posts: 335
Location: on my back and tumbling

PostPosted: Sat Jul 24, 2004 3:30 pm    Post subject: Reply with quote

ctford0 wrote:
bennettp wrote:
Also, my usb pen drive doesn't have a partition table (the 1 in sda1 refers to the partition number), so i need to mount mine using /dev/sda. If you have any trouble with sda1 (or sdb1, etc), try mounting sda (or sdb, etc).


This is also a bug because sdax relates to a device number not a partition. My HP printers photo card reader is sda1 where as my usb zip drive is always sda4. BTW, the I've had the zip driver longer than the printer and it has always been sda4 so devfs somehow relates it to the device type.

EDIT: Not getting the correct device number could also be lack of usbfs support. I've never really messed with it enough to know if it's a bug in devfs or lack of usbfs support.

chris

Are you sure about this? My pen drive has no partition table. So I need to mount /dev/sda. However, I've used a friends pen drive, that DID have a partition table, and I had to mount /dev/sda1. Edit: actually, now that I think about it, I don't know if it had a partition table...

Also, on the linux computers at uni, I need to mount my usb drive as /dev/sda, NOT /dev/sda1.
Back to top
View user's profile Send private message
bennettp
Guru
Guru


Joined: 22 Feb 2004
Posts: 335
Location: on my back and tumbling

PostPosted: Sat Jul 24, 2004 3:32 pm    Post subject: Reply with quote

seteh wrote:
Ok, I finally got it to work. There was still some scsi stuff missing from the kernel. Now i have one reason less to use windows :P

Nice one :)

Now try udev :)
Back to top
View user's profile Send private message
Ox53746F6E65
n00b
n00b


Joined: 17 Feb 2004
Posts: 35

PostPosted: Sat Jul 24, 2004 3:57 pm    Post subject: Reply with quote

maybe you would like to make a entry in your /etc/fstab file, so that you are able to mount your usb-stick with mount /mnt/usbstick or you can create a usb-link on your desktop.

see therefor the usb-stick how-to

https://forums.gentoo.org/viewtopic.php?t=53537&highlight=usb+stick
_________________
Ox is on
Gentoo on VMWare
Sys: Athlon XP 1800+, 1GB Ram, 340 GB HD, Dual Boot Sys with WinXP and GentooR6
Back to top
View user's profile Send private message
ctford0
l33t
l33t


Joined: 25 Oct 2002
Posts: 774
Location: Lexington, KY,USA

PostPosted: Tue Jul 27, 2004 12:22 pm    Post subject: Reply with quote

bennettp wrote:

Are you sure about this? My pen drive has no partition table. So I need to mount /dev/sda. However, I've used a friends pen drive, that DID have a partition table, and I had to mount /dev/sda1. Edit: actually, now that I think about it, I don't know if it had a partition table...

Also, on the linux computers at uni, I need to mount my usb drive as /dev/sda, NOT /dev/sda1.


Well I cant even get my usb zip working on my 2.4 system without a reboot :oops:. When it does work though it is seen as sda4. I've been pretty busy the past couple of days but I'm gonna take some time this morning and try to setup usbfs and see if that makes a difference. I'll let you know my findings

chris
Back to top
View user's profile Send private message
ctford0
l33t
l33t


Joined: 25 Oct 2002
Posts: 774
Location: Lexington, KY,USA

PostPosted: Tue Jul 27, 2004 1:31 pm    Post subject: Reply with quote

Well, setup usbfs (aka. usbdevfs on 2.4) and there is basically no difference. I noticed when i rebooted with the zip plugged in that it was actually setting it up as sdb :oops: and not sda anything because of the reason mentioned previoiusly in this thread. However, I still have the problem of needing to mount /dev/sdb before devfs creates the /dev/sdb4 device.
Code:

bash-2.05b# ls /dev/sd*
/dev/sda  /dev/sdb
bash-2.05b# mount /dev/sdb /mnt/zip/
mount: you must specify the filesystem type
bash-2.05b# ls /dev/sd*
/dev/sda  /dev/sdb  /dev/sdb4


So it must be either the "Preliminary" support in the 2.4 kernel for usbfs or devfs itself. I do not have this behavior on my laptop running 2.6.7 gentoo and udev. Upon pluggin in the zip drive /dev/sda4 is created for me.

Chris
Back to top
View user's profile Send private message
flickerfly
l33t
l33t


Joined: 08 Nov 2002
Posts: 677
Location: Lanham, MD

PostPosted: Fri Sep 24, 2004 4:21 pm    Post subject: Reply with quote

seteh wrote:
Ok, I finally got it to work. There was still some scsi stuff missing from the kernel. Now i have one reason less to use windows :P


What SCSI stuff were you missing?
_________________
An Evil Genious' Guide to Sheeple and How To Avoid Becoming One | 0x4C9EF4A
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum