LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 01-16-2006, 01:28 PM   #1
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 316

Rep: Reputation: 30
Access USB flash drive?


When I plug in a USB flash drive, how do I access the files?
 
Old 01-16-2006, 01:36 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You'll need to mount it first. As you plug it in, run "dmesg" to see which device it's attached to. You would mount the device with something like:

# mount -t msdos /dev/sda1 /mnt/usb

The -t option specifies the filesystem type, which might be different for your drive. "msdos" works for mine.

You might need to change the device, also. This will depend on what dmesg tells you.

The last bit of that line is the mount point, you can mount your drive where you like, but just make sure that that folder exists (so, if you did want to mount to /mnt/usb and it wasn't there already, you'd just do "mkdir /mnt/usb" as root).

If it is mounted successfully, you can just go into the directory you mounted to:

$ cd /mnt/usb

and access your files.
 
Old 01-16-2006, 01:38 PM   #3
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
if it's not automatically mounted, you can mount it manually by creating a mountpoint (a directory) under /media/ and issuing in terminal:

sudo mount -t vfat /dev/sda1 /media/usbflash

or, if 'sudo' doesn't work, then su to become root and do

mount -t vfat /dev/sda1 /media/usbflash

where 'usbflash' would be the directory you want to mount (read and write) the usb-stick into. '-t vfat' means to use FAT32 as the filesystem, because most if not all of the usb flash memory sticks use fat32 as their filesystem..in most cases it can be dropped off, though.

EDIT: if that one above won't work, then try to use sda2, sda3, sda4 or such instead of sda1. sda1 is the first device _usually_ but not _always_. I've had many flash memory sticks that must me mounted as sda4 though there is no reason why they couldn't be sda1..I don't know why exactly. but that's a clue.

Last edited by b0uncer; 01-16-2006 at 01:40 PM.
 
Old 01-16-2006, 01:46 PM   #4
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 316

Original Poster
Rep: Reputation: 30
What do I need to do (if anything) when I'm done using it, and want to remove it?

Thanks so far. It was on sda1.
 
Old 01-16-2006, 01:47 PM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You umount the device with

# umount /dev/sda1

Last edited by Nylex; 01-16-2006 at 01:49 PM.
 
  


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
how can i access partitioned USB-flash? Mistreated Linux - Software 10 12-22-2005 07:53 PM
Flash Drive or MP3 Player, slow access underscorelinux Linux - Software 0 10-05-2005 11:48 AM
new user- can't access my flash drive kebi Linux - Software 1 08-17-2005 12:04 PM
flash drive shows in hardware browser but I can't access it stumblefingers Linux - Newbie 4 04-09-2004 04:19 AM
How to access a USB flash drive captainpicard Linux - Hardware 1 04-20-2003 01:19 PM


All times are GMT -5. The time now is 02:22 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration