LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-09-2005, 09:43 PM   #1
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Rep: Reputation: 30
USB flash drive mount problem


I can usually just plug in a USB device into a slot and type mount /dev/sda1 and everything is fine. But *sometimes* when I type mount /dev/sda1 I get:

Code:
mount: /dev/sda1 is not a valid block device
I ticks me off. How do I fix it?--I reboot the comp and then type mount /dev/sda1 and it just works. Why do I have to reboot the comp to do this?
 
Old 10-10-2005, 01:52 PM   #2
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
What's the output of dmesg?

Are you sure it's always at /dev/sda1? It you have other devices (scanners etc show up as SCSI devices), it may be something different.
It can also take a couple of seconds for the device to be "ready". Occasionally, I get a similar error, waiting a few seconds until the device is ready to talk usually suffices.

If you're using 2.6, you can use udev to assign a permanent name to the device. I haven't got around to setting up udev yet, so I can't offer any details.

In any case, you can always label the filesystem and use that instead of /dev/whatever. With ext2/3, you can use e2label:

Code:
e2label /dev/sda1 <label name>
The label name can be whatever you want. Then modify /etc/fstab, replacing /dev/sda1 with LABEL=<label name>.

Instead of using the device name or label with mount, it's better/easier to use the mount point, e.g.

Code:
mount /mnt/usb
or whatever.
 
Old 10-10-2005, 02:11 PM   #3
servnov
Member
 
Registered: Sep 2004
Distribution: Slackware 10.2
Posts: 276

Original Poster
Rep: Reputation: 30
Ok, I will try using the mount point instead of the device name. Its just so odd how sometimes it will work and sometimes it wont. Usually if I mount and then umount the device and then try to mount it again without rebooting it refuses. I got it in /etc/fstab already and I am using a 2.4 kern.
 
Old 10-10-2005, 02:55 PM   #4
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 30
Quote:
Usually if I mount and then umount the device and then try to mount it again without rebooting it refuses.
That certainly sounds strange. What happens if you unplug it and plug it back in? What does dmesg report?

You'd also get a "not a valid block device" error if one of the necessary modules was being unloaded for some reason (though a simple umount should not cause modules to be unloaded). You need usb-storage, scsi support of course, and sd_mod if it's not built into the kernel. A while back, I was using a kernel with scsi support configured as modules and sometimes sd_mod wasn't being modprobed but I can't remeber why. I currently have scsi support built into the kernel, with usb-storage as a module. Sometimes, a 'depmod -a' can fix that, though that should be run automatically by the pkg manager when you (re)install a kernel.

Another thing that can cause problems is the LUN (logical unit number) scan. I had an external SCSI drive years ago (like a zip, but a different make of course) that screwed up if I had the 'Probe all LUNs on each SCSI device' option set, though modern devices shouldn't have that problem.

On the other hand, if you have one of these multi-card readers (cf, sd, etc), you generally need that option turned ON for it to work. I have a multi-card reader which I seem to recall behaved similarly to what you describe until I turned on the LUN probe option, but a USB drive *should* just be a single device so the LUN option shouldn't matter. Unless the've set it up as mutiple logical devices for some reason.
 
Old 10-10-2005, 08:08 PM   #5
DeusExLinux
Member
 
Registered: May 2004
Location: Tampa, Fl
Distribution: Arch
Posts: 648

Rep: Reputation: 30
I have that problem sometimes ... What I do to fix it is the follwing:
Open up a terminal
log on as root
run : fidsk -l /dev/sda*

What this does is list everything connected to a /dev/sdaX, the computer will then regiester that the drive is there and you can mount it.. saves you a reboot.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to mount a USB flash drive? tuxuser19 Debian 5 11-09-2005 06:05 PM
Can't mount USB Flash Drive on debian woody Chrysalid Linux - Hardware 1 07-31-2005 06:37 AM
USB Flash drive don't want mount hackman Linux - Hardware 4 02-12-2005 12:34 AM
Upgraded to 2.6.9, now I can't mount usb flash drive DigitalCubano Linux - Hardware 3 01-23-2005 05:23 PM
usb flash drive won't mount Snocrash Linux - Hardware 7 01-22-2004 03:02 AM


All times are GMT -5. The time now is 12:36 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