LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can I change the (long, long) UUID of a USB flash drive to something short? (http://www.linuxquestions.org/questions/linux-newbie-8/can-i-change-the-long-long-uuid-of-a-usb-flash-drive-to-something-short-4175484032/)

Zwergele 11-09-2013 02:38 PM

Can I change the (long, long) UUID of a USB flash drive to something short?
 
I prefer to work in the CLI as much as practical, and a long name for a drive is cumbersome. Is there a way to replace the UUID of a USB thumb drive? Maybe something like an alias for a bash command?? Yes, I've tried things that seemed likely, but no joy. TIA!

dt64 11-09-2013 03:23 PM

is that because the USB key gets mounted everytime on /media/{very_long_UUID} directory?

In That case just set up the mountpoint you want in fstab.

Zwergele 11-09-2013 03:36 PM

Thanks; I had wondered about that approach, so I'll run some trials. There is some concern about what happens when I replace one USB drive with another; ideally, I'd like to be able to rename each drive so it identifies itself by that new name, no matter which computer it's plugged into. Failing that, an alias that works only on my box would be adequate.

Edit: No progress. I have three USB thumb drives, and all three are recognized by their factory-origin "names". Those names have nothing to do with the /etc/fstab (as far as I have been able to determine). When I put each one in and mount it, the mount command shows that /dev/sdb1 is /run/media/user/(name). To belabor the point: whichever flash drive is plugged in, as soon as it is mounted, it becomes /dev/sdb1, and is recognized and works perfectly as long as I use its name. Two of the three thumb drives have short names; the newest has a name that is 36 characters long. I typically copy files in the CLI, and I'd like to carry on with that procedure -- but the command is unwieldy with the new thumb drive, as it must include the drive name.

jpollard 11-09-2013 03:36 PM

Quote:

Originally Posted by Zwergele (Post 5061440)
I prefer to work in the CLI as much as practical, and a long name for a drive is cumbersome. Is there a way to replace the UUID of a USB thumb drive? Maybe something like an alias for a bash command?? Yes, I've tried things that seemed likely, but no joy. TIA!

You can always try giving the filesystem a label, then mount it via a mount label=... option.

DavidMcCann 11-09-2013 04:16 PM

My fstab has
/dev/sdb1 /media/usb ext2 noauto,user,noatime,nodiratime 0 0
You'd need "auto" instead of "ext2".

jpollard 11-09-2013 04:25 PM

Quote:

Originally Posted by DavidMcCann (Post 5061493)
My fstab has
/dev/sdb1 /media/usb ext2 noauto,user,noatime,nodiratime 0 0
You'd need "auto" instead of "ext2".

There would be a problem if some other name gets used for the device... as in having two plugged in at the same time...

273 11-10-2013 10:55 AM

On my system when drives are automounted within XFCE they are mounted in a directory of the same name as the label of their file system.


All times are GMT -5. The time now is 09:55 PM.