LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-02-2007, 08:03 AM   #1
altella
Member
 
Registered: Dec 2005
Posts: 84

Rep: Reputation: 16
accesing USB pendrives from bash console


Hello to everyone;

I have a very basic installation of Debian (the smallest footprint 250 Mb aprox.) in an embedded machine. This machine has USB connectors, and I need one of them to get access to a pendrive for file sharing.

When I insert the USB pendrive, Debian recognises it,and if I execute "lsusb", the pendrive appears.

The thing is that I donīt know how to mount it, or how to access it, because I doesnīt appear in the /etc/fstab file.

Could anyone tell me the process to access this type of devices???

Thank you all in advance.
 
Old 07-02-2007, 08:46 AM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Make a mount point somewhere e.g. mkdir /mnt/usb
Check dmesg a few secs after plugging in usb stick - it should say which device it is e.g. /dev/sda1
Edit /etc/fstab and make an entry for it e.g.

Code:
/dev/sda1         /mnt/usb      vfat        noauto,user,uid=dive,sync  0   0
Then you can mount it with 'mount /mnt/usb' as root
 
Old 07-02-2007, 01:32 PM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I usually do the following.

tail -f /var/log/messages

Plugin the USB flash drive or card reader, watch for what the system identifies it as..

Code:
it-etch:~# tail -f /var/log/messages
Jul  2 11:04:08 it-etch -- MARK --
Jul  2 11:24:08 it-etch -- MARK --
Jul  2 11:44:08 it-etch -- MARK --
Jul  2 12:04:09 it-etch -- MARK --
Jul  2 14:23:20 it-etch kernel: usb 6-7: new high speed USB device using ehci_hcd and address 3
Jul  2 14:23:20 it-etch kernel: usb 6-7: configuration #1 chosen from 1 choice
Jul  2 14:23:20 it-etch kernel: Initializing USB Mass Storage driver...
Jul  2 14:23:20 it-etch kernel: scsi4 : SCSI emulation for USB Mass Storage devices
Jul  2 14:23:20 it-etch kernel: usbcore: registered new driver usb-storage
Jul  2 14:23:20 it-etch kernel: USB Mass Storage support registered.
Jul  2 14:23:25 it-etch kernel:   Vendor: SanDisk   Model: Cruzer Titanium   Rev: 2000
Jul  2 14:23:25 it-etch kernel:   Type:   Direct-Access                      ANSI SCSI revision: 00
Jul  2 14:23:25 it-etch kernel: SCSI device sdb: 1014784 512-byte hdwr sectors (520 MB)
Jul  2 14:23:25 it-etch kernel: sdb: Write Protect is off
Jul  2 14:23:25 it-etch kernel: SCSI device sdb: 1014784 512-byte hdwr sectors (520 MB)
Jul  2 14:23:25 it-etch kernel: sdb: Write Protect is off
then I check to see if I have a directory to mount it to..

Code:
it-etch:/# ls /media
cdrom  cdrom0  usbdisk  winmount
since I have a usbdisk directory already created I can just use the mount command. if there was no directory there to mount the drive You would need to create one.. mkdir /media/usbdrive

mount /dev/sdb1 /media/usbdisk

If you want to mount the drive as a normal user (not root) which is probably the case, you must add the appropriate line to /etc/fstab as mentioned above.

Debian uses the /media directory instead of the /mnt directory by default for user mounted drives. don't ask me why. realistically you could create a directory anywhere to mount it to..
 
  


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
mounting pendrives as user (without being root) matrix13 Linux - General 3 01-31-2007 09:16 AM
pendrives rajas3 Conectiva 3 05-29-2005 08:47 AM
USB Pendrives cuscus1986 Linux - Newbie 6 01-08-2005 04:41 PM
Accesing Creative Nomad USB storage device? cucolin@ Red Hat 5 03-10-2004 09:31 AM
Accesing removable USB storage device? cucolin@ Linux - Hardware 2 02-19-2004 08:10 AM

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

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