LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-09-2013, 01:38 PM   #1
Zwergele
Member
 
Registered: Dec 2012
Location: Southern California
Distribution: Slackware
Posts: 86

Rep: Reputation: Disabled
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!
 
Old 11-09-2013, 02:23 PM   #2
dt64
Member
 
Registered: Sep 2012
Distribution: RHEL5/6, CentOS5/6
Posts: 218

Rep: Reputation: 38
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.
 
Old 11-09-2013, 02:36 PM   #3
Zwergele
Member
 
Registered: Dec 2012
Location: Southern California
Distribution: Slackware
Posts: 86

Original Poster
Rep: Reputation: Disabled
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.

Last edited by Zwergele; 11-09-2013 at 04:47 PM. Reason: More information: /etc/fstab appears to be irrelevant
 
Old 11-09-2013, 02:36 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by Zwergele View Post
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.
 
Old 11-09-2013, 03:16 PM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,143

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
My fstab has
/dev/sdb1 /media/usb ext2 noauto,user,noatime,nodiratime 0 0
You'd need "auto" instead of "ext2".
 
Old 11-09-2013, 03:25 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by DavidMcCann View Post
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...
 
Old 11-10-2013, 09:55 AM   #7
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
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.
 
  


Reply



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
Duplicate VG name VolGroup00: Existing [long UUID] (created here) takes precedence Crowdness Linux - Hardware 1 07-03-2012 02:47 PM
Long standing USB problem with XP & Linux...long cbjhawks Linux - Hardware 4 02-23-2009 08:32 AM
finite lifespan for flash drive, how long? lugoteehalt Linux - Hardware 7 06-28-2007 12:32 PM
MDK 10.0 takes too long to recognize USB flash drive rifffrafff Mandriva 2 09-27-2004 08:23 PM
USB flash drive not ready for a LONG time m_yates Debian 0 09-13-2004 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:52 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration