LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Mounting USB device (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-usb-device-261183/)

Valhalla 12-01-2004 12:19 AM

Mounting USB device
 
I have a lexar jumpdrive. I attempted to mount it. (please note I am a linux newbie).
as root:
mkdir /mnt/jumpdrive
added the following lines to /etc/fstab
/dev/sda1 /mnt/jumpdrive vfat user,noauto 0 0

as root:
mount -t vfat /dev/sda1 /mnt/jumpdrive

and I get the error /dev/sda1 is not a valid block device

i also tried w/ /dev/sda because I read somewhere that worked.

I just installed Mandrake 10.1 the other day if that helps at all. I also tried mounting the usb as fat32, but when I tried that, it said it is not a supported file type.

dierigen 12-01-2004 04:17 AM

try to create a partition: fdisk /dev/sda
then you have /dev/sda1 as your first partition on the lexar

abisko00 12-01-2004 04:20 AM

First you should try to find out if there is some kind of automounter in mdk, that could interfere with manual mounting (I am a SuSE user, so I have no idea).

Next you should try to find out to which device the drive is connected (and if it is recognized at all). After you plugged in the drive, type dmesg on console and look at the last messages. You should get something like this:
Code:

usb 4-1: new full speed USB device using address 2
Initializing USB Mass Storage driver...
scsi2 : SCSI emulation for USB Mass Storage devices
  Vendor: TwinMOS  Model: Mobile Disk      Rev: 1.11
  Type:  Direct-Access                      ANSI SCSI revision: 02
SCSI device sdb: 258048 512-byte hdwr sectors (132 MB)
sdb: assuming Write Enabled
sdb: assuming drive cache: write through
 sdb: sdb1
Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 0
Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0,  type 0
USB Mass Storage device found at 2
usbcore: registered new driver usb-storage
USB Mass Storage support registered.

In this example it tells me, that the drive is /dev/sdb1. So edit /etc/fstab accordingly.

If you are not sure which filesystem is on the drive, you could try 'auto' instead of 'vfat'.

In a recent thread it turned out that the USB2 port couldn't be used. Changing the port helped in this case.

Valhalla 12-01-2004 08:36 AM

I'm not sure, but I think there is some kind of auto mounter, Whenever I try and open the hard disk icon on my desktop a program tries to mount the device then fails.

Valhalla 12-01-2004 08:46 AM

so I did dmesg and I got
USB Mass Storage device found at 4
USB Mass Storage Support Registered
SCSI device sda: 512000 512-byt hdwr sectors (262mb) <--- my drive is only 256

Assuming this, I editied my fstab as
/dev/sda4 /mnt/jumpdrive auto user,noauto 0 0

and then tried
mount -t auto /dev/sda4 /mnt/jumpdrive

and I got
mount: special device /dev/sda4 does not exist


grrr....

abisko00 12-01-2004 09:01 AM

Quote:

USB Mass Storage device found at 4
...does not mean that the device is sda4 !!! Just that the USB bus is #4.

How does the message continue? The important part is this:

Code:

sdb: assuming Write Enabled
sdb: assuming drive cache: write through
 sdb: sdb1

Normally the kernel module usbstorage should be used. Maybe it helps if you load it with modprobe usbstorage (need to be root), But actually this should be done by hotplug.

Don't worry about the size, my 128 MB stick shows up as 132 MB.

Valhalla 12-01-2004 09:26 AM

ok, so this is the complete message starting at what I think is the begiinning, I put it in a different port this time cuz it wasn't lighting up in the old one.

It gave me:

usb 5-8: new high speed USB device using address 5
scsi3: SCSI emulation for U SB Mass Storage Devices
Vendor:Generic Module: STORAGE DEVICE Rev: 1.25
Type: Direct-Access ANSI revision: 02
SCSI device sda: 512000 512-byte hdwr sectors (262 MB)
sda: Write Protect is off
sda: Mode Sense: 02 00 00 00
sda: assuming drive cash: write through
/dev/scsi/host3/bus0/target0/lun0: pl
Attached scsi removable disk at scsi3, channel 0 id 0, lun 0
USB Mass Storage device found at 5

abisko00 12-01-2004 09:32 AM

It doesn't seem to recognise any partition. You should try to do what dierigen suggested in post#2: create a partition with fdisk /dev/sda and format it (is it mkfloppyfs /dev/sda1 ?! I am on a windows machine right now :( )

Valhalla 12-01-2004 10:24 PM

I attempted fdisk /dev/sda and /dev/sda1

first try:
unable to open /dev/sda

second try:
unable to open /dev/sda1



Its not working :(

Valhalla 12-02-2004 06:29 PM

Ok, so anyway, I did sfdisk /dev/sda 1 256 and it seemed to create /sda1 that covered my entire disk. Then I did mount -t vfat /dev/sda1 /mnt/jumpdrive and it seemed to work. The sexy part is that all my files were still there. However, I could only access /mnt/jumpdrive as root, even though the owner is set to my normal account. Then when I unplugged the device I couldn't get it to remount. I think I did something wrong in just unplugging it, but I couldn't think of what else to do.

abisko00 12-03-2004 02:14 AM

Add umask=000 to the options in your /etc/fstab. This will allow access of normal users.

Always unmount before you unplug.

cyberhawk 12-03-2004 04:16 AM

if you have hotplug support then you might need to stop the hotplug service and then restart it

you do this by typing
/etc/rc.d/rc.d.hotplug stop
and then
/etc/rc.d/rc.d.hotplug start

thenyou should be able to mount your drive again

I found this out by accident when my usb flash disk would not mount the other day. the hotplug service is supposed to detect plug and play hardware (i think) and somehow the service stopped responding. so i stopped it and restarted it and voila my usb flash disk remounted again.

one thing i love aout the usb2 support in linux is that once you get it working its lightning quick. copying large files is way faster than on windoze. eat that mr gates:p

rphook 12-08-2004 05:33 PM

using dmesg and fdisk
 
I hope this message isn't posted too late. But I've been reading through this posting and have a quick question.

From post six, abisko00 you said that the mount point can be found using dmesg. In the past whenever I have used dmesg I have never been able to find the mount point. Does this mean that whenever I want to mount something I need to use fdisk, then alter /etc/fstab. That kinda cumbersome. I have looked through dmesg completely many, many times looking specifically for the mount point, and have no success. I have resorted to using blockdev --report in order to find the mount point on pieces of hardware.

So what I'm really getting at is, are there any other tools I can use to locate the mount point of devices.

Valhalla 12-08-2004 06:33 PM

I got it working by editing my /etc/sysconfig/hotplug to HOTPLUG_USE_SUBFS=no and then doing rchotplug restart as root. It works fine, but I have to mount manually, rather than getting automount. Hopefully somehwere down the line, SUSE Will come out with an automounting module that works on USBs without making my system crash.

abisko00 12-09-2004 02:29 AM

rhhook, I didn't mean mountpoint, I meant the device!

From my perspective there could be two reasons: whether your drive isn't recognized correctly (thus getting no device), or the way hotplug deals with new devices is different in you distro. Unfortunatley I can't help with both problems.

I have read in some other thread that the device /dev/usb was used to mount pendrives. I am not sure if this will work on your system. On SuSE, a hotplug script assigns scsi devices (sdx) to newly dicovered USB drives. Maybe this is done differently on your system.


All times are GMT -5. The time now is 01:27 AM.