LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 12-01-2004, 12:19 AM   #1
Valhalla
Member
 
Registered: Nov 2004
Location: Atlanta
Distribution: Gentoo 2005.1, Ubuntu 5.10
Posts: 267

Rep: Reputation: 30
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.
 
Old 12-01-2004, 04:17 AM   #2
dierigen
LQ Newbie
 
Registered: Dec 2004
Posts: 2

Rep: Reputation: 0
try to create a partition: fdisk /dev/sda
then you have /dev/sda1 as your first partition on the lexar
 
Old 12-01-2004, 04:20 AM   #3
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
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.
 
Old 12-01-2004, 08:36 AM   #4
Valhalla
Member
 
Registered: Nov 2004
Location: Atlanta
Distribution: Gentoo 2005.1, Ubuntu 5.10
Posts: 267

Original Poster
Rep: Reputation: 30
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.
 
Old 12-01-2004, 08:46 AM   #5
Valhalla
Member
 
Registered: Nov 2004
Location: Atlanta
Distribution: Gentoo 2005.1, Ubuntu 5.10
Posts: 267

Original Poster
Rep: Reputation: 30
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....
 
Old 12-01-2004, 09:01 AM   #6
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
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.
 
Old 12-01-2004, 09:26 AM   #7
Valhalla
Member
 
Registered: Nov 2004
Location: Atlanta
Distribution: Gentoo 2005.1, Ubuntu 5.10
Posts: 267

Original Poster
Rep: Reputation: 30
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
 
Old 12-01-2004, 09:32 AM   #8
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
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 )
 
Old 12-01-2004, 10:24 PM   #9
Valhalla
Member
 
Registered: Nov 2004
Location: Atlanta
Distribution: Gentoo 2005.1, Ubuntu 5.10
Posts: 267

Original Poster
Rep: Reputation: 30
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
 
Old 12-02-2004, 06:29 PM   #10
Valhalla
Member
 
Registered: Nov 2004
Location: Atlanta
Distribution: Gentoo 2005.1, Ubuntu 5.10
Posts: 267

Original Poster
Rep: Reputation: 30
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.
 
Old 12-03-2004, 02:14 AM   #11
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

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

Always unmount before you unplug.

Last edited by abisko00; 12-03-2004 at 04:21 AM.
 
Old 12-03-2004, 04:16 AM   #12
cyberhawk
Member
 
Registered: May 2003
Distribution: Slackware 10
Posts: 34

Rep: Reputation: 15
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
 
Old 12-08-2004, 05:33 PM   #13
rphook
LQ Newbie
 
Registered: Sep 2004
Location: I don't have a clue
Distribution: something trendy
Posts: 19

Rep: Reputation: 0
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.
 
Old 12-08-2004, 06:33 PM   #14
Valhalla
Member
 
Registered: Nov 2004
Location: Atlanta
Distribution: Gentoo 2005.1, Ubuntu 5.10
Posts: 267

Original Poster
Rep: Reputation: 30
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.
 
Old 12-09-2004, 02:29 AM   #15
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 a recognized USB device harisund Linux - Hardware 2 09-24-2005 08:07 AM
Mounting a USB device jaakkop Linux - Hardware 4 05-29-2005 05:50 AM
mounting usb device (muvo2) YBA^[x] Slackware 20 12-21-2004 08:14 AM
Mounting a digital camera as a USB device??? Serenity Linux - Hardware 13 03-17-2004 01:20 AM
mounting usb mass storage device Joe47 Fedora 2 03-03-2004 07:58 PM


All times are GMT -5. The time now is 09:12 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration