LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 07-18-2004, 06:15 PM   #1
ziox
Member
 
Registered: Apr 2004
Distribution: RedHat, Fedora, Suse, Debian, Gentoo, Mandrake
Posts: 132

Rep: Reputation: 15
How to access USB falsh memory on linux


HellO...
..i've 256 USB flash Memory ....


...in steps what i should mount to access the data on this device ???..


__________________
 
Old 07-18-2004, 06:49 PM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,939

Rep: Reputation: 129Reputation: 129
RedHat may have some GUI to do this. Or you can always plug the flash drive in,
then in a terminal (console, konsole) as root issue
bash-2.05b# lsusb
which will show your usb devices ->
Code:
Bus 004 Device 001: ID 0000:0000  
Bus 003 Device 001: ID 0000:0000  
Bus 003 Device 002: ID 045e:0059 Microsoft Corp. Wireless IntelliMouse Explorer
Bus 002 Device 001: ID 0000:0000  
Bus 002 Device 002: ID 058f:9254 Alcor Micro Corp. Hub
Bus 002 Device 004: ID 05da:30d9 Microtek International, Inc. 
Bus 002 Device 005: ID 03f0:1504 Hewlett-Packard DeskJet 920c
Bus 002 Device 006: ID 0ed1:6680 WinMaxGroup   < -- this is my OnData USB flash drive
Bus 002 Device 003: ID 046d:c309 Logitech, Inc. Internet Keyboard
Bus 001 Device 001: ID 0000:0000
and then issue
bash-2.05b# ls -alc /mnt
Code:
total 5
drwxr-xr-x  10 root root 240 2004-07-18 18:39 .
drwxr-xr-x  21 root root 504 2004-07-19 07:33 ..
drwxr-xr-x   2 root root  48 2004-07-18 06:55 cdrom
drwxr-xr-x   2 root root  48 2004-07-18 18:39 cdrw
drwxr-xr-x   2 root root  48 2004-07-18 18:39 dvd
drwxr-xr-x   2 root root  48 2004-07-18 06:55 floppy
drwxr-xr-x   2 root root  48 2004-07-18 06:55 hd   < -- you should have this by default
drwxr-xr-x   2 root root  48 2004-07-18 18:39 sda1
drwxr-xr-x   2 root root  48 2004-07-18 18:39 sdb1
drwxr-xr-x   2 root root  48 2004-07-18 18:39 sdc1
which will show your mount points (places you may mount a drive)
and then if you have it issue
bash-2.05b# mount /dev/sda1 /mnt/hd
where sda1 is the first scsi drive, and sdb1 is the second, etc.
Then to check and see if it's mounted you can issue
bash-2.05b$ mount
which will show you what you presently have mounted on your box ->
Code:
/dev/hdc2 on / type reiserfs (rw)
proc on /proc type proc (rw)
/dev/hdc5 on /home type reiserfs (rw)
/dev/hdc1 on /boot type reiserfs (rw)
/dev/hdc3 on /usr type reiserfs (rw)
/dev/hdc6 on /var type reiserfs (rw)
/dev/hdc7 on /tmp type reiserfs (rw)
/dev/hda6 on /DATA_NTFS type ntfs (ro,noexec,nosuid,nodev,umask=1000)
/dev/hda7 on /DATA_FAT32 type vfat (rw,noexec,nosuid,nodev,umask=1000)
/dev/hda8 on /TEMP_FAT32 type vfat (rw,noexec,nosuid,nodev,umask=1000)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /mnt/sda1 type vfat (rw,noexec,nosuid,nodev,umask=1000,user=mingdao)   < -- this is my OnData USB flash drive
NB: You must have generic scsi and usb mass storage support in your kernel for this
to work. If the above steps do not work, post your error messages.
 
Old 07-18-2004, 07:33 PM   #3
CloudBuilder
Member
 
Registered: May 2003
Location: Netherlands
Distribution: Ubuntu, Puppy
Posts: 386

Rep: Reputation: 30
Thank You Chinaman, sorry for interrupting....

I have a similar problem. I'm using YDL (Red Hat Clone) on an iBook.
I am using a stick, an usbdrive, an usb cardreader and an usb player.
(also an usb keybord and mouse but in this context they are not important)
All devices are recognized. If I look in the hardwarebrowser, I can see what number of device they are. I use an usbhub and everything is connected to that (powers) hub otherwise it wouldn't work.
The devices are give the names sda1 - sda2 and so on.

My trouble was, that the devices are not always connected with the same connector on the hub. Sometimes the card reader is plugged and later on the usb drive, or the music thing.... The card reader can read 6 types of cards, but it seems that only if a card is actually plugged in, it becomes accessible.

This means I never can be sure if I have to mount on sda1 or 2 or 3....

Of course I can see this in the hardeware browser and then mount manually. I even wrote a script for it, so I can mount with one command (and unmount)

What I am asking myself is, is n't there a command I can use, that shows me on which specific sdax or sdbx there is a device present and which device, because that would give me the opportunity to ask the system on which sd(a)(b)x port the device is, and as I know the mount point I could create some workable solution.

In this context I have a second question (I looked in Uleashed and some other books , but couldn't find a clue - after some googling I found this reply) If I want to use the mountpoint as a user, does the user need to have access rights to the mount point? In other words does root have to make the mount point accessible for users?

Your answer is appreciated very much.

CloudBuilder
 
Old 07-18-2004, 08:49 PM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,939

Rep: Reputation: 129Reputation: 129
CloudBuilder,

I know you meant no harm, but you should not hijack someone
else's thread. It's rude, sort of like picking up the phone extension
while they're in the middle of the call and saying, "While you just
happen
to be on the phone, can you fix my problem, too?"

Just a quick answer as it will apply to ziox also, with a recommendation
that you read man pages (man mount) and read some more of your
search results. Then if you can't find it out, please post your own thread.
If you will read that link in my sig about How To Ask Questions The Smart Way,
you'll learn much about forums, mailing lists, etc.

Now I don't use any type of gui interface such as the hardware browser,
so this may not help. I use a terminal.

First, in the kernels before the 2.6.x series, these devices must use scsi emulation
for the kernel to see them. You must also have other support in your kernel, such as
usb mass storage, etc. I'm not getting into that now, and I can't tell you if the
2.6.x kernels do it that way, for I haven't tried it yet...

Second, /dev/sda1 signifies scsi device, a is the first one mounted, and 1 is the
first partition on that device. Therefore, sdb1 would be the second scsi device mounted,
sdc1 the third, etc. I have been unable to mount or read more than one partition on a
scsi device, so /dev/sda2 has never worked for me. (I probably need to read more to
learn about that myself.) I just format my flash disk, usb drives, etc. with one partition.

Third, you can have devices mounted when you boot, or you can mount them later. I
like all of my usb devices to be mounted as a user, for this reason - when I mount them
I intend to use them, not just have them "hanging around." And since I do not run
my system as root (superuser), I want the normal user to be able to read and write to
them. And I don't automount usb devices, just drives attached to the ide controllers.

Fourth, to have these mount points for users, the easiest thing is to set it up in your
/etc/fstab file. You can issue "man fstab" to learn about that. I've posted mine in other
threads as examples, so you can search LQ if you want to see how I do them.

Last, you may want to check out the app usbmgr (USB Manager) for this purpose.

Hope this helps...
 
Old 07-19-2004, 01:39 PM   #5
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
CloudBuilder - I think I'd agree with Chinaman that it's generally best not to add secondary questions into a thread that aren't closely related to the original post, as that can make it more difficult for future visitors to find relevant information efficiently. As for whether a user needs permissions on a mountpoint in order to access it, the answer is Yes -- users who don't have permission on a mountpoint can't access it. Chinaman's post is very informative about /dev/sd* devices, and as he explains in the paragraph about fstab, you can cause a mountpoint to be automatically mounted by including it in the fstab file.

That being said, I think it would be best all the way around for the thread to focus on ziox's original question about getting USB flash memory to work, rather than to be about the mount command. Thanks -- J.W.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Sony CLIE MS Access / USB Memory Card brenwaterys Linux - Hardware 1 09-23-2004 03:46 PM
Gpio Twiddling In Embedded Linux? or How to access PCI memory space regs? jds-linux Programming 1 07-11-2004 02:17 AM
Can't access USB Memory Card reader rhauff Linux - Hardware 1 12-05-2003 08:10 AM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 12:50 PM
Linux dist on usb memory stick Cyth Linux - Software 2 03-13-2003 04:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:46 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration