*
The moose likes Linux / UNIX and the fly likes How do I read my usb flash drive content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "How do I read my usb flash drive content" Watch "How do I read my usb flash drive content" New topic
Author

How do I read my usb flash drive content

MI Mohammed
Ranch Hand

Joined: Feb 16, 2005
Posts: 146
I just installed Redhat 9.0 on my system but
the problem, am having right now is reading
the content of my removable flash drive.
Can someone help me pls.


SCJP 1.4 SCJA


SCJA(Beta) SCJP 1.4 SCWCD 1.4 SCBCD 1.3 SCBCD 5.0 beta <br />The more practice we get, the better we are at the exams and in life in general. Pls join me at My DEN.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16020
    
  20

I don't know about helping your pls, but in RedHat 9, a USB device presents an MS-DOS FAT filesystem, so you need to check the /var/log/messages file to see what device it brought online and mount it. Typically, this will be /dev/sda1, though some devices might see it simply as /dev/sda.

You have to check the log to be certain, since sda is the most likely device for the drive to appear at, but circumstances may make it show up on sdb, c, d, etc. It will look to Linux like a SCSI device, however.

The recent Fedora releases can detect and mount these devices automatically and (if you're running a GUI desktop, display icons for them). They'll mount as devices under the /media filesystem subtree.


Customer surveys are for companies who didn't pay proper attention to begin with.
Robert Aragon
Greenhorn

Joined: Jul 11, 2005
Posts: 18
Flash Drive reading and writing, here is the way I do it.

Find the correct "/dev/sda1" on my machine.

Do this "BEFORE" you plug in your flash.

tail -f /var/log/messages
Plug in your flash drive, and watch for a "/dev/sda1" or "/dev/sda" or
something similar to print out. For example, once you find it, say it is
"/dev/sda1", like on my machine.

Make a directory like: "mkdir /mnt/usbdrive1", then mount the flash on it.
mount /dev/sda1 /mnt/usbdrive1

To view the contents go to "/mnt/usbdrive1" however you want.
When done with the flash, unmount it with "umount /mnt/usbdrive1"

That's it. Let me know what happens O.K.?


SCJP
Saravanan Gujula Mohan
Greenhorn

Joined: May 16, 2005
Posts: 1
Quoted by Tim Holloway
----------------------------------------------------------------------------
I don't know about helping your pls, but in RedHat 9, a USB device presents an MS-DOS FAT filesystem, so you need to check the /var/log/messages file to see what device it brought online and mount it. Typically, this will be /dev/sda1, though some devices might see it simply as /dev/sda .
---------------------------------------------------------------------------

Hi ,
Does that mean that i can't write in my USB flash drive in linux OS ?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Originally posted by SARAVANAN GM:

Does that mean that i can't write in my USB flash drive in linux OS ?


Not sure where you got this from. As long as you have a read/write driver for the appropriate filesystem type (FAT32, most likely, as given above) then you can mount the drive read/write. If you've got a flash drive formatted as NTFS, well, then it might be a little dodgy!


[Jess in Action][AskingGoodQuestions]
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

While I don't see much problems in using vfat-filesystems for usb-drives, I don't expect a problem in creating an ext2-filesystem on a flashdrive.

If you exchange data with windows-systems sometimes, vfat will be more easy to access from both systems.
If you never use windows to read/ write the usbdrive, linux-file-attributes (user, group, rwxr-xr-x) are much more comfortable to use on an ext2-filesystem.


http://home.arcor.de/hirnstrom/bewerbung
 
 
subject: How do I read my usb flash drive content