Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Sorry if my terminolgy is not a 100% correct here.
I was fine with my RH9 system when I just had my USB camera to plug in. It dutifully and always was registered to /dev/sda1. My /etc/fstab file mounts it to /mnt/cam.
Then I get a Scandisk 512MB flash thumb drive for Christmas.
The problem is that the first device plugged in gets sda1, the second get sdb1.
Any way to get the system to detect the vendor/prod codes and register it to a fixed device file?
Anything is possible but how much work would it take to get what you want - that's the question. I just decided to use /mnt/usb1, /mnt/usb2, etc. so that I'm not mounting my mp3 player with the name camera or something. That was just my way of simplifying things.
I'll be checking here to see if there's a way though. That would be nice.
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288
Rep:
Haven't tried it yet but I beleive you can refer to a partition by a label instead of a /dev/<devicename> in fstab. sda1 and sda2 will still swap but the camera would always mount at /mnt/camera and pendrive at /mnt/pendrive for example. Just got a muvo nomad mp3player/pendrive combo myself and I've been meaning to look into that.
Your idea to use the label sounds great. I googled around looking for ways to discover the label on the pre-existing vfat filesystems on my camera card or pendrive to no avail. All I found was that you can set set the label when creating the filesystem using mkfs.vfat(8).
I am not sure I am ready to muck with my camera card and pendrive yet.
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288
Rep:
I'm going by memory, but I'm pretty sure you can label in msdos/windows nondestructively. I don't recall how, maybe ms fdisk, maybe something safer. Next time I boot into windows I'll have a look around. I _seem_ to recall a dos command label.
Well you were right. I used my XP box to look at LABEL and VOL dos commands. I tried labelling the flash drive as PENDRIVE and added the LABEL=PENDRIVE line into fstab and then tried a:
$ mount -L PENDRIVE
mount: no such partition found
Turns out the LABEL and UUID mount capability relies on partition labels and uuids registered in /proc/partitions. This kernel file seems to contain only ext2 and ext3 filesystems on my computer.
I guess vfat labels are not registered as partitions.
If you have a 2.6 kernel, then you can use udev to create permanent naming rules for the devices, to ensure that they will always have a unique name (or a symlink that will always point to wherever the device is connected.)
If you're using a 2.4 kernel, then I'm afraid can't help you on that one.
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288
Rep:
I think your right about vfat and msdos not being supported. man fstab states ext2/3 and xfs labels are. I suspect that reiserfs might work, as there is a kernel config option to desplay reiser stats in /proc. Also, floppies don't seem to work. Probably only ide and scsi drives. Oh well, it was a nice idea.
I do recall reading about cathetic's udev hint. But I dislike the whole udev/devfs thing myself.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.