LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-10-2006, 08:09 AM   #1
stevielawson
Member
 
Registered: Sep 2004
Location: Scotland
Posts: 41

Rep: Reputation: 15
mystified by usb mount problem


Hi,
I'm trying to follow the instructions at www.extremetech.com/article2/0,1697,1256766,00.asp for mounting a USB stick but am having problems.
Firstly, here's the output of lsmod, just so you can see if I've got every module I need:

Module Size Used by Tainted: P
usb-storage 62432 0 (unused)
nvidia 1964768 6 (autoclean)
snd-pcm-oss 36736 0 (unused)
snd-mixer-oss 12376 0 [snd-pcm-oss]
keybdev 1892 0 (unused)
mousedev 4020 1
hid 20868 0 (unused)
usbmouse 1880 0 (unused)
input 3200 0 [keybdev mousedev hid usbmouse]
uhci 24284 0 (unused)
ehci-hcd 17516 0 (unused)
usbcore 59148 1 [usb-storage hid usbmouse uhci ehci-hcd]
snd-via82xx 13376 1
gameport 1420 0 [snd-via82xx]
snd-ac97-codec 58556 0 [snd-via82xx]
snd-pcm 54344 0 [snd-pcm-oss snd-via82xx snd-ac97-codec]
snd-timer 13764 0 [snd-pcm]
snd-mpu401-uart 3136 0 [snd-via82xx]
snd-rawmidi 12480 0 [snd-mpu401-uart]
snd-seq-device 3812 0 [snd-rawmidi]
snd 32772 1 [snd-pcm-oss snd-mixer-oss snd-via82xx snd-ac97-codec snd-pcm snd-timer snd-mpu401-uart snd-rawmidi snd-seq-device]
snd-page-alloc 4712 0 [snd-mixer-oss snd-via82xx snd-pcm snd-timer snd-rawmidi snd-seq-device snd]
soundcore 3396 4 [snd]
pcmcia_core 39172 0
ide-scsi 9392 0
via-rhine 12336 1
mii 2272 0 [via-rhine]
crc32 2880 0 [via-rhine]
apm 9452 2

And here's my fstab, edited as per the instructions on the site mentioned above:

fstab:
/dev/hda2 swap swap defaults 0 0
/dev/hda1 / reiserfs defaults 1 1
/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
/dev/sda1 /mnt/usbstick vfat user,noauto,umask=0 0 0


I followed the guide's instructions up to the point where I enter:
tail -s 3 -f /var/log/messages

I get:
Jan 10 12:53:05 slackware -- MARK --
Jan 10 13:12:16 slackware kernel: hub.c: new USB device 00:10.3-6, assi gned address 3
Jan 10 13:17:12 slackware kernel: Linux agpgart interface v0.99 (c) Jef f Hartmann
Jan 10 13:17:12 slackware kernel: agpgart: Maximum main memory to use f or agp memory: 439M
Jan 10 13:17:12 slackware kernel: agpgart: Detected Via Apollo Pro KT40 0 chipset
Jan 10 13:17:24 slackware kernel: usb.c: USB disconnect on device 00:10 .3-6 address 3
Jan 10 13:22:06 slackware kernel: hub.c: new USB device 00:10.3-6, assi gned address 4
Jan 10 13:28:08 slackware kernel: usb.c: USB disconnect on device 00:10 .3-6 address 4
Jan 10 13:29:53 slackware kernel: hub.c: new USB device 00:10.3-6, assi gned address 5


ie: there is no 'sda1' label being assigned by my kernel, as per the following example on the site:

Aug 26 17:06:09 localhost kernel: hub.c: new USB device 00:1f.2-1, assigned address 4
Aug 26 17:06:13 localhost /etc/hotplug/usb.agent: Setup usb-storage for USB product d7d/100/100
Aug 26 17:06:13 localhost /etc/hotplug/usb.agent: Setup nomadjukebox for USB product d7d/100/100
Aug 26 17:06:13 localhost /etc/hotplug/usb.agent: Module setup nomadjukebox for USB product d7d/100/100
Aug 26 17:06:13 localhost kernel: SCSI device sda: 121856 512-byte hdwr sectors (62 MB) Aug 26 17:06:13 localhost kernel: sda: Write Protect is off
Aug 26 17:06:13 localhost kernel: sda: sda1 Aug 26 17:06:13 localhost devlabel: devlabel service started/restarted

and then when I try to 'mount usbstick' from '/mnt', I get the following error message:

mount: can't find usbstick in /etc/fstab or /etc/mtab

As you can see from my fstab - it does seem to be there. Can anyone suggest what I might be doing wrong/missing?
Thanks.

Last edited by stevielawson; 01-10-2006 at 08:41 AM.
 
Old 01-10-2006, 09:05 AM   #2
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
Tutorials are great, but, sometimes they miss out the "why" in moving from stage to stage. I'm feeling particularly altruistic this afternoon, so let's see if we can fill in some of that missing knowledge (corrections welcome!).

A few disclaimers:
* I am not omniscient, and I am most definitly fallible - so I welcome corrections and inquisitive minds!
* I am not responsible if you screw it up, my instructions are rarely a complete walkthrough

With that over with, let's cover some stuff.

Mounting from fstab is nothing more than a predefined shortcut. Once something is mounted successfully, /etc/mtab is editted (by the system, of course) and keeps a record of what is currently mounted.

As an aside, if you don't know what form the line in fstab should be, but you know how to mount the device manually (mount -t smbfs //192.168.0.69/Stuff /home/boxxen/stuff -o username=administrator) then check out /etc/mtab once it's mounted. If I recall correctly, running `mount` on it's own will read mtab to show you what is currently mounted and where.

Anyway, the important part is: when trying something new, there is no need to add it to fstab until you've got it working, and you can do that by hand from a commandline. I like to think of this as a sort of debugging procedure.

But we're getting ahead of ourselves. Before you can mount something new, you should check that it exists.

I'm lazy and tend to use dmesg to inspect what my system is doing, but, /var/log/messages will give you the same/similar result. Check here for some more info on what exactly dmesg is, and have an experiment on your own =D http://linuxgazette.net/issue59/nazario.html

So you whack your usb key in the port and watch your log messages roll by ... this is infact where things go wrong, because, as you succintly put it:

Quote:
there is no 'sda1' label being assigned by my kernel
The question is now a question of *why* this is so. I'm going to take a few stabs in the dark and see what happens.

I will assume you're using a custom compiled kernel (because I can assume such a thing with impunity) and you've forgotton to tick all the correct USB bits. Since I can't remember off the top of my head what *should* be in there, I've had a rummage around for you.

Stolen from this site: http://www.linux-sxs.org/upgrading/migration26.html

They say:
Quote:
Card readers are USB storage devices. In order to access them you have to enable the following stuff in your kernel configuration under the

Device drivers | USB support:

- Support for USB

- USB device file system

- USB mass storage support
So, my guess is, you've missed one somewhere.

Since you're using a custom kernel, the lsmod output isn't terribly useful because conceptually you could have compiled anything into the kernel and left anything out.

If you're using a stock kernel, then that is a whole different kettle of fish. Perhaps your usb stick is non-standard, or you need to modprobe some more modules manually... If you *are* using a stock kernel, then let us know so we can attempt a second diagnosis.

Finally you get an error message from mount that is unrelated to the usb device. Interesting. What this tells me is that you've forgotton to add the mount point itself.

A mount point is merely a directory that you can use to mount something in. Think of it as a hollow container waiting to be filled with stuff (until you get a better understanding, of course, then you can think of it as a mount point ).

So, `mkdir /mnt/usbstick` is in order for your fstab to work out what you are talking about. I'd be willing to bet your left leg that you'll get an entirely different error message if you just fix the mount point.

Of course, you can do it manually instead (the debug method, you see) like so:

Code:
~$ su
password:
~# mount -t vfat /dev/sda1 /mnt/usbstick
But this won't work unless the usb device is attached to device /dev/sda and has a partition (the '1' in /dev/sda1) to read. So step 1: get the usb device recognised!

I suggest searching the forums some more, too, this is a common issue.

Good luck!
- Piete.
 
Old 01-10-2006, 04:54 PM   #3
stevielawson
Member
 
Registered: Sep 2004
Location: Scotland
Posts: 41

Original Poster
Rep: Reputation: 15
Hey Piete,
Thanks for the info - I'm at work at the moment so I can't try out any of your suggestions but I will be doing over the next few days... just didn't want you to think I was ignoring the advice.
I'll let you know how I get on.
Cheers
Steve
PS: I'm using the 2.4.31 kernel that comes by default with a 10.2 install (I'm still new at this and haven't yet plucked up courage to compile 2.6 - but I will soon as I get some free time). You can see from my lsmod which USB bits I've got installed.
PPS I should also add that on my previous unsuccessful attempt, my USB stick was recognised in the Storage Media sidebar that shows up in Konqueror.

Last edited by stevielawson; 01-10-2006 at 04:56 PM.
 
Old 01-10-2006, 07:58 PM   #4
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Rep: Reputation: 34
Just a quick idea.... are you sure it's sda1?

Try plugging it in, and then type "cat /var/log/messages" and see what the system thinks it is. Maybe this is just an identification thing.
 
Old 01-10-2006, 07:59 PM   #5
Melkor
Member
 
Registered: Aug 2003
Location: MN
Distribution: Linux Mint
Posts: 179

Rep: Reputation: 34
Oh durrr.... sorry. I missed that part in your first post where you're tailing the messages file. Never mind.
 
Old 01-11-2006, 04:31 AM   #6
stevielawson
Member
 
Registered: Sep 2004
Location: Scotland
Posts: 41

Original Poster
Rep: Reputation: 15
Fixed it!
Thanks Piete... you were right:
Quote:
"Finally you get an error message from mount that is unrelated to the usb device. Interesting. What this tells me is that you've forgotton to add the mount point itself.
A mount point is merely a directory that you can use to mount something in. Think of it as a hollow container waiting to be filled with stuff (until you get a better understanding, of course, then you can think of it as a mount point ).
So, `mkdir /mnt/usbstick` is in order for your fstab to work out what you are talking about. I'd be willing to bet your left leg that you'll get an entirely different error message if you just fix the mount point.
Of course, you can do it manually instead (the debug method, you see) like so:
Code:
~$ su password: ~# mount -t vfat /dev/sda1 /mnt/usbstick"
Basically, I had put an entry in the fastab but, during my first run-through I must have done something wrong when I entered the 'mkdir /mnt/usbstick' command - there was nothing in /mnt!
Now there is and, after mounting the stick as per your suggestion (the debug method) it's mounted and I'm rooting around in it!
My next challenge is to have the stick auto-mounted.
Many thanks for your help.
Steve
 
  


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
USB flash drive mount problem servnov Linux - General 4 10-10-2005 08:08 PM
mount usb drive + debian problem alaios Linux - Hardware 3 06-13-2005 12:51 AM
usb mount problem venusian Linux - Hardware 3 04-07-2005 03:16 PM
Problem mount USB devices. jonostew Linux - Hardware 4 08-20-2004 12:39 PM
mount usb module then mount usb hard drive guanyu Linux - Hardware 1 10-08-2003 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration