LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-05-2005, 11:51 PM   #1
tuxuser19
Member
 
Registered: Oct 2005
Posts: 67

Rep: Reputation: 15
How to mount a USB flash drive?


I got a 64MB Lexar USB flash drive. I want to mount it on my pc. I use Debian 3.1 with 2.4 kernel.

When I look in /etc/fstab I get:
--------------------
# /etc/fstab: static file system information.

# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hdb3 / reiserfs notail 0 1
/dev/hdd /media/cdrom0 iso9660 ro,user,noauto 0 0
/dev/hdc /media/cdrom1 iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
----------------------
 
Old 11-06-2005, 12:10 AM   #2
elfoozo
Member
 
Registered: Feb 2004
Location: Washington, USA
Distribution: Debian
Posts: 265

Rep: Reputation: 32
Use the command dmesg | more and verify that your system "sees" it. They usually show up as /dev/sda so you might look for a reference to Lexar and /dev/sda paired up in dmesg.
 
Old 11-06-2005, 12:21 AM   #3
tuxuser19
Member
 
Registered: Oct 2005
Posts: 67

Original Poster
Rep: Reputation: 15
When I dmesg | more I get a whole lot of messages about the hardware devices....but at the bottom of the messages I can see these:

hub.c: new USB device 00:1f.2-2, assigned address 2
usb.c: USB device 2 (vend/prod 0x5dc/0x80) is not claimed by any active driver.
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi1 : SCSI emulation for USB Mass Storage devices
Vendor: LEXAR Model: JUMPDRIVE Rev: 1.11
Type: Direct-Access ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
USB Mass Storage support registered. <<<<<<------IS IT ALREADY MOUNTED?????

I can see the Lexar Jumpdrive listing but how to mount it?
 
Old 11-06-2005, 12:28 AM   #4
elfoozo
Member
 
Registered: Feb 2004
Location: Washington, USA
Distribution: Debian
Posts: 265

Rep: Reputation: 32
View the contents of /etc/mtab to see if it's already mounted. Probably not mounted though.

Flash drives usually come formatted with at least one partition. You can use fdisk /dev/sda to verify if it has partitions already. To mount it, you'll need somewhere to mount it too so mkdir /mnt/sda1 where sda1 can be whatever you want.
Then mount /dev/sda1 /mnt/sda1
 
Old 11-06-2005, 12:31 AM   #5
uberNUT69
Member
 
Registered: Jan 2005
Location: Tasmania
Distribution: Xen Debian Lenny/Sid
Posts: 578

Rep: Reputation: 30
Open a terminal or console, su to root, and:
# ls -l /var/tail/messages

Then plug in your USB drive.

You should see (after a slight delay) some messages like this:
Nov 6 18:19:41 venice kernel: usb 1-2: new full speed USB device using uhci_hcd and address 3
Nov 6 18:19:41 venice kernel: scsi3 : SCSI emulation for USB Mass Storage devices
Nov 6 18:19:44 venice usb.agent[22682]: usb-storage: already loaded
Nov 6 18:19:46 venice kernel: Vendor: Generic Model: USB SD Reader Rev: 2.00
Nov 6 18:19:46 venice kernel: Type: Direct-Access ANSI SCSI revision: 00
Nov 6 18:19:46 venice kernel: SCSI device sda: 31360 512-byte hdwr sectors (16 MB)
Nov 6 18:19:46 venice kernel: sda: Write Protect is off
Nov 6 18:19:46 venice kernel: SCSI device sda: 31360 512-byte hdwr sectors (16 MB)
Nov 6 18:19:46 venice kernel: sda: Write Protect is off
Nov 6 18:19:46 venice kernel: /dev/scsi/host3/bus0/target0/lun0: p1
Nov 6 18:19:46 venice kernel: Attached scsi removable disk sda at scsi3, channel 0, id 0, lun 0
Nov 6 18:19:47 venice scsi.agent[22727]: sd_mod: loaded successfully (for disk)

So, you can see here that the flash drive is sda.
Assuming you only have one partition on the drive (most likely)
you will be interested in partition #1.

Make somewhere to mount it:
# mkdir /media/USBflash

Mount it manually:
# mount /dev/sda1 /media/USBflash

All things being equal, the partition type will be automatically
detected, and the contents of the partition will be available at /media/USBflash.

I suspect that you'll find the flash is a fat(16) partition formatted
as vfat (long filenames).
So to be able to write to the flash drive as a user (rather than root)
you will need to add a umask to the mount option:
# mount -o umask=002 /dev/sda1 /media/USBflash

To unmount it (make sure you wait for it!!!!)
# umount /media/USBflash

to make this as easy as "$ mount /media/USBflash"
# echo " /dev/sda1 /media/USBflash vfat user,umask=002 0 0" >> /etc/fstab
 
Old 11-09-2005, 06:05 PM   #6
tuxuser19
Member
 
Registered: Oct 2005
Posts: 67

Original Poster
Rep: Reputation: 15
Sorry mates I am bit a late in posting....it worked...and thank you for your help...
 
  


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
USB flash drive mount problem servnov Linux - General 4 10-10-2005 08:08 PM
Can't mount USB Flash Drive on debian woody Chrysalid Linux - Hardware 1 07-31-2005 06:37 AM
USB Flash drive don't want mount hackman Linux - Hardware 4 02-12-2005 12:34 AM
Upgraded to 2.6.9, now I can't mount usb flash drive DigitalCubano Linux - Hardware 3 01-23-2005 05:23 PM
usb flash drive won't mount Snocrash Linux - Hardware 7 01-22-2004 03:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:39 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
Open Source Consulting | Domain Registration