Go Back   Cyber Tech Help Support Forums > Operating Systems > Linux

Notices

Reply
 
Topic Tools
  #1  
Old November 2nd, 2005, 01:02 PM
jethind jethind is offline
Member
 
Join Date: May 2004
Location: Planet Earth
Posts: 30
USB flash drive on linux

How do i use my USB flash drive on linux? Even if i do not have any drivers in my PC. thanks.
Reply With Quote
  #2  
Old November 2nd, 2005, 05:06 PM
kage's Avatar
kage kage is offline
Cyber Tech Help Moderator
 
Join Date: Apr 2004
O/S: Linux
Age: 19
Posts: 1,248
Open a terminal, plug in the usb device, run 'dmesg'. You'll see a lot of stuff go by, but you only need the bottom part. It should look something like this:

Code:
usb-storage: device found at 3
usb-storage: waiting for device to settle before scanning
  Vendor: USB2.0    Model: CardReader SD     Rev: 0100
  Type:   Direct-Access                      ANSI SCSI revision: 00
SCSI device sda: 1000448 512-byte hdwr sectors (512 MB)
sda: Write Protect is off
sda: Mode Sense: 03 00 00 00
sda: assuming drive cache: write through
SCSI device sda: 1000448 512-byte hdwr sectors (512 MB)
sda: Write Protect is off
sda: Mode Sense: 03 00 00 00
sda: assuming drive cache: write through
 /dev/scsi/host2/bus0/target0/lun0: p1
Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi2, channel 0, id 0, lun 0,  type 0
usb-storage: device scan complete
Notice the lines starting with 'sda'. That tells you the usb device is registered at /dev/sda. To find out which partition you want to mount (this will usually be /dev/sda1...) as root (su) run 'fdisk -l /dev/sda'. It will produce an output similar to this:

Code:
root# fdisk -l /dev/sda

Disk /dev/sda: 512 MB, 512229376 bytes
16 heads, 62 sectors/track, 1008 cylinders
Units = cylinders of 992 * 512 = 507904 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1008      499937   83  Linux
As you can see, my usb device has a linux (ext3) partition at /dev/sda1. To mount that (assuming we're going to mount it at /mnt/usb, and the folder is already there using mkdir) you would run, as root, 'mount -t ext3 /dev/sda1 /mnt/usb'. Now most usb sticks will be using the fat16/32 partition format, if thats the case you would use '-t vfat' instead of ext3.

For read/write priviledges, add the following line to your /etc/fstab file:

/dev/sda1 /mnt/sda1 vfat noauto,user,exec,umask=000 0 0

Hope that helps.

-kage
__________________
Tips for Linux Newcommers

If we have helped you, please consider supporting Cyber Tech Help with a subscription.

Reply With Quote
  #3  
Old November 3rd, 2005, 01:07 PM
jethind jethind is offline
Member
 
Join Date: May 2004
Location: Planet Earth
Posts: 30
Is there any need to "eject" the USB after you have finished using it like in windows 2000/XP?

Oh, and a follow-up question: Do i have to run "dmesg" only once or do i need to run this everytime i reboot? thanks.
Reply With Quote
  #4  
Old November 3rd, 2005, 07:24 PM
kage's Avatar
kage kage is offline
Cyber Tech Help Moderator
 
Join Date: Apr 2004
O/S: Linux
Age: 19
Posts: 1,248
Yes, if you have any filesystem mounted (hard drive, cd, usb, etc) you should run 'umount /dev/device' before removing it. Change 'device' to the actual device (sda, cd, etc).

No, you don't have to run dmesg everytime. Thats just to let you know where the device is registered to. Now if you go to mount /dev/sda1 with the usb drive plugged in, and it says it cannot be found, you should run dmesg to check if its listed at /dev/sdb1, sdc1, and so on.

-kage
__________________
Tips for Linux Newcommers

If we have helped you, please consider supporting Cyber Tech Help with a subscription.

Reply With Quote
  #5  
Old November 4th, 2005, 12:48 AM
DaveQB DaveQB is offline
Senior Member
 
Join Date: Nov 2004
O/S: Linux
Location: Sydney
Age: 30
Posts: 318
Any good distro will place an icon on your desktop (KDE,Gnome) upon insertion of a USB. Simply double click (or single click, depending on your configuration) and you can browse its contents.

When done, right click the item and click on 'umount drive' or similar command.

__________________
Linux david 2.6.22-14-generic #1 SMP Tue Dec 18 05:28:27 UTC 2007 x86_64 GNU/Linux

Chart of Linux equivalent Windows programs

"Talk is cheap. Show me the code." - Linus Torvalds
Reply With Quote
  #6  
Old November 4th, 2005, 11:00 AM
jethind jethind is offline
Member
 
Join Date: May 2004
Location: Planet Earth
Posts: 30
i tried running dmesg, but it gets me this info. from the looks of it, there's something wrong with me USB ports... what could be the problem?

----------------------------------------------------------------------
usb 1-5: new high speed USB device using ehci_hcd and address 2
usb 1-5: device not accepting address 2, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 3
usb 1-5: device not accepting address 3, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 5
usb 1-5: device not accepting address 5, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 6
usb 1-5: device not accepting address 6, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 7
usb 1-5: new high speed USB device using ehci_hcd and address 8
usb 1-5: device not accepting address 8, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 9
usb 1-5: device not accepting address 9, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 10
usb 1-5: device descriptor read/64, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 11
usb 1-5: device not accepting address 11, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 12
usb 1-5: device not accepting address 12, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 14
usb 1-5: device not accepting address 14, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 16
usb 1-5: device not accepting address 16, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 17
usb 1-5: device not accepting address 17, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 19
usb 1-5: device not accepting address 19, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 20
usb 1-5: device not accepting address 20, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 21
usb 1-5: device descriptor read/64, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 22
usb 1-5: device not accepting address 22, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 23
usb 1-5: device not accepting address 23, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 24
usb 1-5: device descriptor read/64, error -71
usb 1-5: device descriptor read/64, error -71
usb 1-5: new high speed USB device using ehci_hcd and address 25
usb 1-5: device descriptor read/64, error -71
usb 1-5: device descriptor read/64, error -71
-----------------------------------------------------------------------------

Last edited by jethind; November 4th, 2005 at 11:03 AM.
Reply With Quote
  #7  
Old December 4th, 2005, 09:26 AM
sergey sergey is offline
New Member
 
Join Date: Dec 2005
Posts: 2
Greetings!
I have the similar USB problem on xw9300 AMD64 running SuSE 10.0, KDE interface.
As far as I see, the needed kernel modules are loaded:

# lsmod | grep usb
usb_storage 102976 0
usbcore 159924 4 usb_storage,ehci_hcd,ohci_hcd
scsi_mod 181176 4 usb_storage,sg,libata,sd_mod
ide_core 179256 5 usb_storage,ide_cd,generic,amd74xx,ide_disk

Depending on a type of flash-disk, dmesg reveals the following:

(i) usb 2-5: new high speed USB device using ehci_hcd and address 8
usb 2-5: device descriptor read/8, error -110
usb 2-5: device descriptor read/8, error -71

(ii) usb 2-5: new high speed USB device using ehci_hcd and address 10
usb 2-5: unable to read config index 0 descriptor/all
usb 2-5: can't read configurations, error -110
usb 2-5: new high speed USB device using ehci_hcd and address 11
Initializing USB Mass Storage driver...
scsi4 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 11
usb 2-5: new high speed USB device using ehci_hcd and address 14
scsi6 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 14
usb-storage: waiting for device to settle before scanning
usb 2-5: reset high speed USB device using ehci_hcd and address 14
usb 2-5: can't restore configuration #1 (error=-110)
usb 2-5: USB disconnect, address 14
scsi: Device offlined - not ready after error recovery: host 6 channel 0 id 0 lun 0
usb-storage: device scan complete

I would be very grateful to receive a helpful advice...
Reply With Quote
  #8  
Old December 4th, 2005, 10:29 AM
kage's Avatar
kage kage is offline
Cyber Tech Help Moderator
 
Join Date: Apr 2004
O/S: Linux
Age: 19
Posts: 1,248
Appears to me the device is not getting enough power. What kinf of usb device is it? What kind of usb port are you plugging it into? (1.0/2.0)
__________________
Tips for Linux Newcommers

If we have helped you, please consider supporting Cyber Tech Help with a subscription.

Reply With Quote
  #9  
Old December 7th, 2005, 02:08 PM
sergey sergey is offline
New Member
 
Join Date: Dec 2005
Posts: 2
I used disks-on-key (or flash disk, whatever they are called), and the machine has 2.0 ports.
I have read on the net I should mount such device as /dev/sda1 with FAT 32 partition. The problem is sda is my system disk that has only Linux partitions.

It is much simple in the Windows, just plug it in...
Reply With Quote
  #10  
Old December 17th, 2005, 03:58 AM
DaveQB DaveQB is offline
Senior Member
 
Join Date: Nov 2004
O/S: Linux
Location: Sydney
Age: 30
Posts: 318
Hey look where google brought me to

New USB housing i bought for a spare laptop HDD. Has one small USB plug that goes into the housing and 2 'reg' USB plugs for the PC.

Seems it needs both to the system for power.
Worked fine at work on SuSe 10.0 but same OS at home heard the HDD 'ticking' over and this in dmesg

Code:
kernel: usb 3-6: reset high speed USB device using ehci_hcd
So read what you wrote here Kage about not enough power (as thatswhat it sounded like) and tried the USB ports in the back of my PC; straight into the motherboard.

All working now, icon on desktop and the whole shebang!
__________________
Linux david 2.6.22-14-generic #1 SMP Tue Dec 18 05:28:27 UTC 2007 x86_64 GNU/Linux

Chart of Linux equivalent Windows programs

"Talk is cheap. Show me the code." - Linus Torvalds
Reply With Quote
Reply

Bookmarks

Topic Tools

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 On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:46 AM.

[ RSS ]