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 I forgot to tell the kernel version, it's 2.6.13.4, sorry. (/edit) |
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. |
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 |
Re: USB storage devices difficult to mount and use
Quote:
Code:
/etc/filesystems Code:
ext3 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 |
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). |
All times are GMT -5. The time now is 12:29 AM. |