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 12-18-2005, 04:34 PM   #1
Flz
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 10.2
Posts: 38

Rep: Reputation: 15
USB mounting for clip drive and others


Just wanted to check, if I do what b0uncer has told vampirelord to do here will that make my usb ports active? For example if I was to plug in another USB device would it detect it like in windows?

Heres the post i'm talking about:

Quote:
Originally Posted by b0uncer
make sure you have /mnt/usb (in this example) or the directory created you try to mount the thing to...then try:



Code:
mount t vfat /dev/sda1 /mnt/usb(or use whatever you want instead of /mnt/usb)
If sda1 fails to work, then try /dev/sda instead of /dev/sda1 (and if it fails, sdb, sdb1, sda4...I've seen many names on my one usb-flash memory, no idea why they change all the time...but sda1 works most of the time, and most of the time it doesn't work, sda works..got it?)
If not, is there anything I can do to make this happen?
 
Old 12-18-2005, 04:54 PM   #2
heltreko
Member
 
Registered: Mar 2005
Location: Stockholm, Sweden
Distribution: Slackware, Zenwalk
Posts: 141

Rep: Reputation: 15
Your usb ports might already be working.

Plug in the usb key and see if something happens with dmesg. It'll tell if it found the usb device and if it's recognised and which devie it is (/dev/sda1 for example).

Then you can edit your fstab accordingly and mount it.

Remeber to umount it before pulling it out though.

Good Luck!
 
Old 12-19-2005, 10:29 AM   #3
Flz
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 10.2
Posts: 38

Original Poster
Rep: Reputation: 15
I typed dmesg, and a whole load of stuff came up, I tried to look through to find anything with relevance to the usb port but I couldn't find anything.

I'm new to linux by the way.
 
Old 12-19-2005, 11:38 AM   #4
heltreko
Member
 
Registered: Mar 2005
Location: Stockholm, Sweden
Distribution: Slackware, Zenwalk
Posts: 141

Rep: Reputation: 15
If you plug in the usb key and it's recognised and then do dmesg it'll be the wery last few lines that are interesting.

Also do lsmod and see if any usb modules are loaded and active.
 
Old 12-20-2005, 11:15 AM   #5
Flz
Member
 
Registered: Dec 2005
Location: UK
Distribution: Slackware 10.2
Posts: 38

Original Poster
Rep: Reputation: 15
And if there are? What then?
 
Old 12-20-2005, 12:39 PM   #6
jerryvb
Member
 
Registered: Nov 2003
Location: Jerryland
Distribution: Debian
Posts: 59

Rep: Reputation: 16
After your system is up and running, open a terminal and do (as root):

# tail -f /var/log/messages


Then plug in your usb drive and watch for new messages in the terminal, you should see the kernel recognize it and assign it a device name. It'll usually be something like sda, sdb, etc.

Then, here's what I do:

1. In my home dir I create another directory called mnt
$ mkdir ~/mnt

2. $ cd mnt

3. Under the mnt dir create a dir for the usb device:
$ mkdir ~/mnt/sda

4. In /etc/fstab add a line for the usb drive:
# vim /etc/fstab
Add: /dev/sda /home/<user>/mnt/sda vfat defaults 0 0

5. Then, anytime I plug in my usb stick, all I have to do is open a terminal, and do:
$ cd mnt
$ mount sda
$ cd sda

6. And then I can see all of the contents of my usb drive

Hope this helps
 
Old 12-24-2005, 01:12 AM   #7
d.j.peters
LQ Newbie
 
Registered: Jul 2004
Location: germany nrw essen
Distribution: Slackware 14.1 x86
Posts: 8

Rep: Reputation: 0
Nedd help Slackware mount usb stick trouble.

Sorry about my bad english i have read the Flashmemory and usb camera how to but i get not mount an memorystick. It seams to be all ok but mount failed,

Code:
>$ mount 
usbfs on /proc/bus/usb type usbfs (rw)
Code:
>$ cat /proc/scsi/usb-storage-0/1

   Host scsi1: usb-storage
       Vendor: USB     
      Product: Flash Disk      
Serial Number: 70756540B45523BB
     Protocol: Transparent SCSI
    Transport: Bulk
         GUID: 0ea0216870756540b45523bb
     Attached: Yes (or No if i remove the usb stick)
Code:
>$ cat /proc/bus/usb/devices
T:  Bus=05 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 3
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB OHCI Root Hub
S:  SerialNumber=d0e35000
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

T:  Bus=05 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0ea0 ProdID=2168 Rev= 2.00
S:  Manufacturer=USB     
S:  Product=Flash Disk   <<<<<<<<<<<<<<<< OK !!!!!   
S:  SerialNumber=70756540B45523BB
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=200mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   2 Ivl=1ms
Code:
>$ mount -t vfat /dev/sda1 /mnt/usbstick
mount: /dev/sda1 ist kein gültiges blockorientiertes Gerät
the system told me mount: /dev/sda1 is not a valid bloc device.

Any idea what goes wrong?

Thanks for help.

Joshy

Last edited by d.j.peters; 12-24-2005 at 01:18 AM.
 
Old 12-24-2005, 01:49 AM   #8
jerryvb
Member
 
Registered: Nov 2003
Location: Jerryland
Distribution: Debian
Posts: 59

Rep: Reputation: 16
Did you try the instructions in my post, the one right above yours?
 
Old 12-24-2005, 10:35 AM   #9
d.j.peters
LQ Newbie
 
Registered: Jul 2004
Location: germany nrw essen
Distribution: Slackware 14.1 x86
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by jerryvb
Did you try the instructions in my post, the one right above yours?
Hallo jerryvb,
you are right i forgot the line in the fstab and now it works.

Thank you.

Joshy
 
Old 12-24-2005, 01:41 PM   #10
jerryvb
Member
 
Registered: Nov 2003
Location: Jerryland
Distribution: Debian
Posts: 59

Rep: Reputation: 16
Glad to be of help. :-)
 
Old 12-25-2005, 04:02 PM   #11
muskrat
Member
 
Registered: Feb 2005
Location: Gulf-Coast TX-MX
Distribution: ArchLinux / Slackware 12.1
Posts: 39

Rep: Reputation: 15
I don't see my error in mounting Memstick.

My wife gave me a memstick for Navidad, So when I try to use it on my linux box this is what I get, I've read the above post and still don't see where I've gone wrong.


Frist I checked to see if my usb was runing correctly, it seems to be
working right here's the results from dmesg.
Quote:
steve@debbox:~$ dmesg | grep -i usb
usbcore: registered new driver usbfs
usbcore: registered new driver hub
USB Universal Host Controller Interface driver v2.2
uhci_hcd 0000:00:07.2: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller
uhci_hcd 0000:00:07.2: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
ohci_hcd: 2004 Feb 02 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci_hcd 0000:00:0a.0: NEC Corporation USB
ohci_hcd 0000:00:0a.0: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
ohci_hcd 0000:00:0a.1: NEC Corporation USB (#2)
ohci_hcd 0000:00:0a.1: new USB bus registered, assigned bus number 3
hub 3-0:1.0: USB hub found
ehci_hcd 0000:00:0a.2: NEC Corporation USB 2.0
ehci_hcd 0000:00:0a.2: new USB bus registered, assigned bus number 4
ehci_hcd 0000:00:0a.2: USB 2.0 enabled, EHCI 1.00, driver 2004-May-10
hub 4-0:1.0: USB hub found
usb 4-2: new high speed USB device using address 2
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
USB Mass Storage device found at 2
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
But it didn't show the device so I ran it again with scsi instead of usb
and got these results.
Quote:
steve@debbox:~$ dmesg | grep -i scsi
SCSI subsystem initialized
scsi0 : SCSI emulation for USB Mass Storage devices
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 499712 512-byte hdwr sectors (256 MB)
/dev/scsi/host0/bus0/target0/lun0: [CUMANA/ADFS]
p1<5>Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
So I set up the fstab as follows using every device that would function
sda,sda1 seem to be the only ones that function all others say invalid
block device.
Quote:
/dev/sda1 /mnt/usb vfat rw,user,noauto 0 0
Here are the different results I get.

with file system iso9660 in fstab
Quote:
steve@debbox:~$ mount /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
with file system auto in fstab
Quote:
steve@debbox:~$ mount /mnt/usb
mount: I could not determine the filesystem type, and none was specified
with file system vfat in fstab
Quote:
steve@debbox:~$ mount /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
So since it keep saying try dmesg |tail I tried it but still don't understand what my error is. It's probibly something so simple I feel like a fool when someone else points it out.
Quote:
steve@debbox:~$ dmesg | tail
Buffer I/O error on device sda1, logical block 508378395
Buffer I/O error on device sda1, logical block 508378396
Buffer I/O error on device sda1, logical block 508378397
Buffer I/O error on device sda1, logical block 508378398
Buffer I/O error on device sda1, logical block 508378399
Buffer I/O error on device sda1, logical block 508378384
FAT: invalid media value (0xb9)
VFS: Can't find a valid FAT filesystem on dev sda.
FAT: invalid media value (0xb9)
VFS: Can't find a valid FAT filesystem on dev sda1.
I sure would like some help here. Thanks a bunch.
 
Old 12-26-2005, 10:42 PM   #12
jerryvb
Member
 
Registered: Nov 2003
Location: Jerryland
Distribution: Debian
Posts: 59

Rep: Reputation: 16
Quote:
Originally Posted by muskrat
My wife gave me a memstick for Navidad, So when I try to use it on my linux box this is what I get, I've read the above post and still don't see where I've gone wrong.

I sure would like some help here. Thanks a bunch.

I recommend seting up usb stick devices in your own home directory, it sure is a lot easier.

1. log in to your system as your normal user
2. open a terminal, i.e. xterm
3. You should see a $ sign prompt
4. type: "mkdir mnt" <Enter> without the quotes; this creates a directory called "mnt"
5. type: cd mnt <Enter>
6. open a second terminal
7. in the second terminal log in as root
type: su -
enter root's password
type: tail -f -n20 /var/log/messages (or whereever your system logs messages)

8. Now, plug in your usb stick

9. Watch the messages in the second terminal, you should see something like this:

Dec 26 19:01:44 lightstar kernel: hub.c: new USB device 00:02.2-5, assigned address 2
Dec 26 19:01:44 lightstar kernel: scsi3 : SCSI emulation for USB Mass Storage devices
Dec 26 19:01:44 lightstar kernel: sdf: Unit Not Ready, sense:
Dec 26 19:01:44 lightstar kernel: sdf: sdf1

10. The important line is the last one, you see that the kernel assigned my device the device number sdf1

11. Now, in the FIRST terminal, create a directory under mnt for the usb stick:
type: "mkdir sdf1" (Replace sdf1 with whatever your device number is.)

11. Now, in the second terminal press Ctl-C, this will close the tail process and leave you at a root prompt.

12. Now, open whatever editor you feel comfortable with as root and edit the file /etc/fstab

13. As an example, for my sdf1 device I added the following line to fstab:
/dev/sdf1 /home/jerry/mnt/sdf1 auto noauto,users 0 0
Now, save the file.

14. That's it! Now, when I plug in my usb device, all I have to do is open a terminal and type:
$ cd mnt
$ mount sdf1
$ cd sdf1
$ ls
And there is all the contents of my usb stick right before my eyes!

Please note, I use Slackware, all of this works on my system. Depending on your distribution, a few things might be a little different.

Disclaimer: I take no responsibility whatsoever for the use of these instructions. Who knows, your machine just might morph into a ball of cotton candy for using these instructions. Happy New Year! :-)

HTH
jerry
 
Old 01-03-2006, 12:51 AM   #13
muskrat
Member
 
Registered: Feb 2005
Location: Gulf-Coast TX-MX
Distribution: ArchLinux / Slackware 12.1
Posts: 39

Rep: Reputation: 15
Thanks Jerry; I'll give a try. I know all the USB devices work because since I posted I swapped out the drives and did another instalation with the drives hooked up and the distro picked them up automaticly. So with your info I should be able to get them to working on my older install, Thanks.
 
  


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
trouble mounting USB drive edobrzel Linux - Hardware 7 06-03-2008 02:40 PM
mounting a usb drive tvn Debian 3 12-25-2005 04:31 PM
USB drive mounting RohanShrivastav Suse/Novell 10 06-08-2005 03:57 AM
Need help mounting USB drive mngmd Linux - Hardware 4 05-29-2005 10:06 PM
Mounting my USB external drive, USB 1.1 Devillion Linux - Hardware 4 01-04-2004 10:11 AM


All times are GMT -5. The time now is 04:45 AM.

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