LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   Mounting USB storage devices (http://www.linuxquestions.org/questions/debian-26/mounting-usb-storage-devices-348862/)

COKE CAN 08-01-2005 09:46 AM

Mounting USB storage devices
 
How do I go about adding a usb drive to Linux to make it as easily accessable as the cdrom, etc?

makuyl 08-01-2005 10:29 AM

Plug it in and type dmesg and something like the following should be at the bottom:
Code:

usb 1-1.4: new full speed USB device using uhci_hcd and address 5
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 5
usb-storage: waiting for device to settle before scanning
  Vendor: BUFFALO  Model: ClipDrive        Rev: 2.00
  Type:  Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
sda: Write Protect is off
sda: Mode Sense: 03 00 00 00
sda: assuming drive cache: write through
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
sda: Write Protect is off
sda: Mode Sense: 03 00 00 00
sda: assuming drive cache: write through
 sda: sda1
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
usb-storage: device scan complete

Then add a mountpoint, for instance: mkdir /pen
and set permissions with: chmod ug+rwx /pen and chgrp users /pen
to: ls -ld /pen
drwxrwx--- 2 root users 4096 Feb 28 16:35 /pen

Then add a line in /etc/fstab for it, for sda1 mine is:
/dev/sda1 /pen vfat noauto,users,exec,noatime,umask=000 0 0

You can then mount with: mount /pen
and unmount with: umount /pen
Add a desktop icon if you like.

rylan76 08-01-2005 10:31 AM

Don't know what you mean by as easily accessible as the CDRom but this is the comman line I use to mount USB flashdrives on my FC3 system:

mount -a -t vfat /dev/sda1 /mnt/flashdisk -o user,exec,dev,suid,rw,umask=000

after creating the /mnt/flashdisk mountpoint, of course.

COKE CAN 08-01-2005 10:48 AM

When I say easily accessable I am referring to how you can open your home directory and click on the cdrom icon.

COKE CAN 08-01-2005 11:05 AM

Code:

hub.c: new USB device 00:1f.2-2, assigned address 2
usb.c: USB device 2 (vend/prod 0x5dc/0xa410) 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 SPORT  Rev: 1000
  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.
usb.c: USB disconnect on device 00:1f.2-2 address 2

I adeed this to /etc/fstab:

Code:

# /etc/fstab: static file system information.
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
/dev/hda1      /              ext3    defaults,errors=remount-ro 0      1
/dev/hda5      none            swap    sw              0      0
/dev/hdc        /media/cdrom0  iso9660 ro,user,noauto  0      0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0      0
/dev/sda1      /pen            vfat    rw,user,noauto  0      0

I ran mount /pen:

Code:

# mount /pen
[mntent]: warning: no final newline at the end of /etc/fstab
mount: /dev/sda1 is not a valid block device
laptop:/home/cokecan# Mutex destroy failure: Device or resource busy
ICE default IO error handler doing an exit(), pid = 28353, errno = 0


slithy 08-01-2005 01:42 PM

Forget about all that for right now. Plug your flashdrive in, open up your terminal and as root do:
Code:

cd /dev
Code:

ls | grep sd
You should see some results like sda, sdb, or sda1. There should only be one if you have one USB Mass Storage Device hooked up. If you already have a folder in your /mnt directory for where you would like to mount the drive, skip this next step, if not
Code:

mkdir /mnt/removable
Now for the command that will actually mount the drive.
Code:

mount /dev/sda(or whatever yours was called) /mnt/removable
If this doesn't work and you have a FAT32 partition on your flashdrive try,

Code:

mount -t vfat /dev/sda(or whatever yours was called) /mnt/removable

COKE CAN 08-01-2005 01:49 PM

I have a usb drive and a usb mouse hooked up on my laptop. I got this while running
Code:

ls | grep sd
Code:

ptysd
sda
sda1
sda10
sda11
sda12
sda13
sda14
sda15
sda2
sda3
sda4
sda5
sda6
sda7
sda8
sda9
sdb


COKE CAN 08-01-2005 01:50 PM

Code:

# mount /dev/sda1 /mnt/removable
mount: you must specify the filesystem type


COKE CAN 08-01-2005 01:59 PM

Code:

# mount -t vfat /dev/sda1 /mnt/removable
mount: /dev/sda1 is not a valid block device


slithy 08-01-2005 02:02 PM

Quote:

Code:

hub.c: new USB device 00:1f.2-2, assigned address 2
usb.c: USB device 2 (vend/prod 0x5dc/0xa410) 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 SPORT  Rev: 1000
  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.
usb.c: USB disconnect on device 00:1f.2-2 address 2


From looking at your dmesg, I would say that this isn't a mount problem. After you plug in your usb flashdrive, the last few lines in dmesg should tell whether the drive is sda1 or whatever. Unless you didn't copy all of the dmesg pertaining to the flashdrive. Find out what the device is and then we can work on moutning it.

Quote:

Code:

usb 1-1.4: new full speed USB device using uhci_hcd and address 5
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 5
usb-storage: waiting for device to settle before scanning
  Vendor: BUFFALO  Model: ClipDrive        Rev: 2.00
  Type:  Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
sda: Write Protect is off
sda: Mode Sense: 03 00 00 00
sda: assuming drive cache: write through
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
sda: Write Protect is off
sda: Mode Sense: 03 00 00 00
sda: assuming drive cache: write through
 sda: sda1
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
usb-storage: device scan complete


In this example posted up by another user, you can see that his drive is sda

COKE CAN 08-01-2005 02:07 PM

Code:

hub.c: new USB device 00:1f.2-2, assigned address 2
usb.c: USB device 2 (vend/prod 0x5dc/0xa410) 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 SPORT  Rev: 1000
  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.
usb.c: USB disconnect on device 00:1f.2-2 address 2
e100: eth0 NIC Link is Down
e100: eth0 NIC Link is Up 100 Mbps Full duplex
e100: eth0 NIC Link is Down
e100: eth0 NIC Link is Up 10 Mbps Half duplex
e100: eth0 NIC Link is Down
e100: eth0 NIC Link is Up 100 Mbps Full duplex
ISO 9660 Extensions: Microsoft Joliet Level 1
ISOFS: changing to secondary root
orinoco_lock() called with hw_unavailable (dev=cd235000)
unloading Kernel Card Services
Linux Kernel Card Services 3.1.22
  options:  [pci] [cardbus] [pm]
PCI: Found IRQ 5 for device 02:00.0
PCI: Sharing IRQ 5 with 01:00.0
PCI: Found IRQ 11 for device 02:00.1
PCI: Sharing IRQ 11 with 00:1f.3
PCI: Sharing IRQ 11 with 00:1f.5
PCI: Sharing IRQ 11 with 00:1f.6
Yenta ISA IRQ mask 0x0698, PCI irq 5
Socket status: 30000410
Yenta ISA IRQ mask 0x0698, PCI irq 11
Socket status: 30000006
cs: IO port probe 0x0100-0x04ff: excluding 0x200-0x20f 0x378-0x37f 0x4d0-0x4d7
cs: IO port probe 0x0800-0x08ff: clean.
cs: IO port probe 0x0c00-0x0cff: clean.
cs: IO port probe 0x0a00-0x0aff: clean.
cs: memory probe 0xa0000000-0xa0ffffff: clean.
hermes.c: 4 Dec 2002 David Gibson <hermes@gibson.dropbear.id.au>
orinoco.c 0.13d (David Gibson <hermes@gibson.dropbear.id.au> and others)
orinoco_cs.c 0.13d (David Gibson <hermes@gibson.dropbear.id.au> and others)
eth1: Station identity 001f:0006:0001:0003
eth1: Looks like an Intersil firmware version 1.3.6
eth1: Ad-hoc demo mode supported
eth1: IEEE standard IBSS ad-hoc mode supported
eth1: WEP supported, 104-bit key
eth1: MAC address 00:09:5B:4B:4E:AF
eth1: Station name "Prism  I"
eth1: ready
eth1: index 0x01: Vcc 5.0, irq 3, io 0x0100-0x013f
Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
sda: Unit Not Ready, sense:
Info fld=0xa00 (nonstd), Current 00:00: sense key Not Ready
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Info fld=0xa00 (nonstd), Current sd00:00: sense key Not Ready
sda : block size assumed to be 512 bytes, disk size 1GB.
 /dev/scsi/host1/bus0/target0/lun0: I/O error: dev 08:00, sector 0
 I/O error: dev 08:00, sector 0
 unable to read partition table
sda: Unit Not Ready, sense:
Info fld=0xa00 (nonstd), Current 00:00: sense key Not Ready
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Info fld=0xa00 (nonstd), Current sd00:00: sense key Not Ready
sda : block size assumed to be 512 bytes, disk size 1GB.
sda: test WP failed, assume Write Enabled
 /dev/scsi/host1/bus0/target0/lun0: I/O error: dev 08:00, sector 0
 I/O error: dev 08:00, sector 0
 unable to read partition table
sda: Unit Not Ready, sense:
Info fld=0xa00 (nonstd), Current 00:00: sense key Not Ready
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Info fld=0xa00 (nonstd), Current sd00:00: sense key Not Ready
sda : block size assumed to be 512 bytes, disk size 1GB.
sda: test WP failed, assume Write Enabled
 /dev/scsi/host1/bus0/target0/lun0: I/O error: dev 08:00, sector 0
 I/O error: dev 08:00, sector 0
 unable to read partition table
sda: Unit Not Ready, sense:
Info fld=0xa00 (nonstd), Current 00:00: sense key Not Ready
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Info fld=0xa00 (nonstd), Current sd00:00: sense key Not Ready
sda : block size assumed to be 512 bytes, disk size 1GB.
sda: test WP failed, assume Write Enabled
 /dev/scsi/host1/bus0/target0/lun0: I/O error: dev 08:00, sector 0
 I/O error: dev 08:00, sector 0
 unable to read partition table

That is everything from the beginning where it first mentions the USB device

slithy 08-01-2005 03:03 PM

What happens when you do a
Code:

mount -t vfat /dev/sda /mnt/removable(or where ever you want it mounted)?

COKE CAN 08-01-2005 03:08 PM

Quote:

Originally posted by slithy
What happens when you do a
Code:

mount -t vfat /dev/sda /mnt/removable(or where ever you want it mounted)?

Quote:

Originally posted by COKE CAN
Code:

# mount -t vfat /dev/sda1 /mnt/removable
mount: /dev/sda1 is not a valid block device



slithy 08-01-2005 03:17 PM

From looking at your dmesg, sda is your flashdrive, not sda1, so again try
Code:

mount -t vfat /dev/sda /mnt/removable
Do you know if your filesystem on the flashdrive is FAT32?

COKE CAN 08-01-2005 03:27 PM

I have no clue


All times are GMT -5. The time now is 09:54 AM.