Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
I'm currently in the process of deploying FOG storage nodes to 23 satellite locations of our company, some of which are a five hour drive away. Currently, I'm shipping the computers with images pre-loaded, but I would like the ability to add images later without having to send them across the VPN.
I've come up with the idea of using tiny USB flash drives, the kind similar to the nano receivers on wireless mice, to send the images when an update needs to be done.
However, each device will have a unique UUID (I presume, anyway), making it difficult to specify the mount for the device in /etc/fstab.
What I would like to do:
On the back of the computers were are using for the storage nodes, the usb ports are numbered. I would like to configure the system to always mount any storage device plugged into port 0 on /images/port0. Likewise, any device plugged into port 1 on /images/port1.
Is there any way to do this? Typically, I perma-mount usb devices via UUID, but since each of this flash drives is going to be unique, and setting each UUID by hand each time an image is upgraded will be obnoxious and time-consuming, that's not an option. Setting a LABEL on each drive will likewise be obnoxious and time-consuming unless there's some way to set the LABEL without having to mkfs the drive. Also, as the drives will likely have the FAT filesystem, I'm not even sure if LABEL= will even work for them.
I want this to be as simple for the remote user as possible. I don't want them to have to do anything but "Remove the plug in port0 and replace it with the enclosed plug, then ship back the one you've removed."
I'm open to any way I can accomplish this, and if I have to fall back on using LABEL= to mount them, then that's what I'll do. It would be much better, however, to be able to have to system automatically pick the correct mount point according to where the drive is physically plugged in.
Apologies if this isn't the right section of the board to post in. Hardware seemed the best option.
e2label can set a label without the need to format the drive.
Or you could use uuidgen to generate the uuid automaticly.
These tools should be all part of the e2fsprogs.
e2label can set a label without the need to format the drive.
Or you could use uuidgen to generate the uuid automaticly.
These tools should be all part of the e2fsprogs.
Cheers
Does mounting by label work for FAT devices, or is that only a feature of ext* filesystems?
I came across uuidgen in my research, but manually setting the UUID on every update we make to the images would be incredibly time consuming, as every update requires 23 flash drives (One for each satellite office). If we update 2 images at once, then we have 46 flash drives to set the uuid on.
You can see how this would get very obnoxious very quickly.
Does mounting by label work for FAT devices, or is that only a feature of ext* filesystems?
Yes, and you can change it via mlabel which is part of the mtools package.
Without knowing your process it is difficult to know how obnoxious this can get but I would think it would be relatively easy to create a script to update images and change labels and / or UUIDs automatically.
Yes, and you can change it via mlabel which is part of the mtools package.
Without knowing your process it is difficult to know how obnoxious this can get but I would think it would be relatively easy to create a script to update images and change labels and / or UUIDs automatically.
Ok. I'll do it that way.
Next question: Is there any way to have it automatically remount the drive in the same place once it's been removed? The user's not going to be umounting it before they remove the old drive, so can I automate umount + remount when they insert the new drive (which has the same UUID or LABEL)?
In the case of auto mounting (I can not say for all distributions / versions) even with the same label the drives will not mount to the same mount point. You still should be able to automate mount and remount...
Ok. You've given me something to think about. Fortunately, I have some time before we start updating images, so I can experiment and tweak until I've got a solution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.