LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 11-16-2005, 12:41 PM   #1
jaakkop
Member
 
Registered: Aug 2004
Posts: 433

Rep: Reputation: 30
USB storage devices difficult to mount and use


Hi,

I would like to know if I could mount USB storage devices more easily. I don't need it to be all fancy one-click-to-a-image-to-mount, I just want to get it mounted easily without root and so that it recognizes the fs properly.

Here is my problem:
When I plug a USB device, it appears as /dev/sda1. If I umount it, plug it off and then plug the same or different usb device, it appears as /mnt/sdb1. Again if I do the same the next one appears as /dev/sdc1. This becomes difficult when I have to use multiple devices.

Another problem is that I got different kind of partitions in my USB devices so if I put auto to automagically recognize the fs type in fstab, it just uses usbfs. So if I want to use the device with vfat, I would have to replace the auto with vfat but can cause problems cos all my devices aren't vfat. I could also mount it by hand but it requires the usage of root and I can't write with my normal user.

This has haunted me for a long time so now I want to fix it. I would really appreciate if you would help me with this problem.

Here is my fstab:
Code:
/dev/hda10     swap             swap         defaults                           0   0
/dev/hda9      /                     reiserfs     defaults                           1   1
/dev/hda8      /boot              ext3          defaults                           1   2
/dev/hda1      /mnt/win-c       vfat           umask=0000                   1   0
/dev/hda5      /mnt/win-d       ntfs           umask=0222                   1   0
/dev/hda6      /mnt/win-e       vfat           umask=0000                   1   0
/dev/hda7      /mnt/win-f        ntfs            umask=0222                  1   0
/dev/cdrom    /mnt/cdrom     iso9660     noauto,user,ro                 0   0
/dev/dvd1      /mnt/dvdrw     iso9660     noauto,user,ro                  0   0
/dev/fd0         /mnt/floppy    auto          noauto,user                        0   0
devpts           /dev/pts         devpts      gid=5,mode=620               0   0
proc              /proc              proc          defaults                              0   0
/dev/sda1      /mnt/sda1       auto          noauto,user,umask=0000   0   0
/dev/sdb1      /mnt/sdb1       auto         noauto,user,umask=0000   0   0
/dev/sdc1      /mnt/sdc1       auto         noauto,user,umask=0000   0   0
/dev/sdd1      /mnt/sdd1       auto        noauto,user,umask=0000   0   0
(edit)
I forgot to tell the kernel version, it's 2.6.13.4, sorry.
(/edit)

Last edited by jaakkop; 11-17-2005 at 11:05 AM.
 
Old 11-16-2005, 12:56 PM   #2
yuchai
Member
 
Registered: Jan 2005
Location: New York, NY
Distribution: Slackware 13.0
Posts: 56

Rep: Reputation: 15
On your first problem:

Do you use a 2.6 kernel? If you do you can use udev to handle creating symlinks correctly to your usb devices.

Here's a how-to on how to do that:

http://www.reactivated.net/writing_udev_rules.html

I do not know how to do something similar on the 2.4 kernel since I don't think it supports udev.

No insights on your second problem. All my usb storage devices use the vfat filesystem (to maintain compatibility with windows, etc) so it wasn't a problem for me.
 
Old 11-16-2005, 01:06 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,965
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
I'm using usbmgr for these tasks ... you can script it quite well, what
I do is to associate each devices USB identifier with a mount-script
that parses the output of dmesg (dmesg | grep /dev/sd|tail -n 1) and
modify fstab from there, and then mount to the appropriate partition
to the correct mountpoint.


Cheers,
Tink
 
Old 11-16-2005, 02:00 PM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,191

Rep: Reputation: Disabled
Re: USB storage devices difficult to mount and use

Quote:
Originally posted by jaakkop
Hi,

Another problem is that I got different kind of partitions in my USB devices so if I put auto to automagically recognize the fs type in fstab, it just uses usbfs. So if I want to use the device with vfat, I would have to replace the auto with vfat but can cause problems cos all my devices aren't vfat. I could also mount it by hand but it requires the usage of root and I can't write with my normal user.

This has haunted me for a long time so now I want to fix it. I would really appreciate if you would help me with this problem.

Create a file
Code:
/etc/filesystems
and put something like this in it:
Code:
ext3
ext2
vfat
umsdos
msdos
usbfs
xfs
iso9660
reiserfs
minix
ntfs
It is the order in which the mounter looks for filesystems on the partition. If you omit a filesystem here, it will not be used in determining what "auto" translates to.
For a list of filesystems your kernel supports (as well as the order in which the mounter will use them for probing) run
Code:
cat /proc/filesystems
Cheers, Eric
 
Old 11-16-2005, 04:03 PM   #5
alienDog
Member
 
Registered: Apr 2004
Location: Europe
Distribution: Debian, Slackware
Posts: 505

Rep: Reputation: 46
I think it could also be possible to solve the problem using hotplug. It executes scripts in /etc/hotplug/usb on usb events. What it could do is create (and update if needed) symlinks under /dev/. So for example if you would connect a device called "exthd", it would create a symlink /dev/exthd pointing to whatever it currently is (sda, sdb, sdc and so on). You could then use the symlinks in fstab instead of sd?? device nodes.

I have the same problem and am using 2.4 series kernel, so this is the solution I will be using as soon as I have time and energy to look into it properly. If anyone has done something similar or knows where to get more information about it, I'd be happy to hear about it.

--edit--

Getting there... I have a working script that will do this, I'll brush it up some and post a link to it shortly along with information on how it works and how to use it. Currently it gets confused if you connect two identical devices. In that case you'll only see the one connected later. I'll have to figure out a way to deal with it (well... actually I don't own two identical usb devices, but I _might_... anyway it should work).

Last edited by alienDog; 11-17-2005 at 08:23 AM.
 
  


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 USB storage devices COKE CAN Debian 18 08-02-2005 02:14 AM
Finding USB Storage Devices Under /dev mchase582 Debian 3 01-29-2005 05:29 PM
USB storage devices? Valael Fedora 1 08-17-2004 04:24 PM
Automatically Mounting USB Storage Devices??? nalmo Linux - General 6 08-13-2004 03:15 PM
usb mass storage devices rukinhas Mandriva 1 11-18-2003 07:23 PM


All times are GMT -5. The time now is 06:31 AM.

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