LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-11-2014, 03:43 PM   #1
darkduck
Member
 
Registered: Jan 2011
Location: Cyprus
Distribution: Kubuntu, OpenSuSE
Posts: 502

Rep: Reputation: 26
Mounting 2 identical USB drives to different mount points


Hello,
I have 2 identical USB HDD drives connected to my Linux machine (Debian Wheezy).
They have absolutely identical UUID.
Code:
$sudo blkid
[sudo] password for darkduck: 
...
/dev/sdb1: LABEL="Elements" UUID="1ADC8962DC893951" TYPE="ntfs" 
/dev/sdc1: LABEL="Elements" UUID="1ADC8962DC893951" TYPE="ntfs"

/etc/fstab contains records for /dev/sdb1 -> /mount_point_A and /dev/sdc1 -> mount_point_B.
However, sometimes they got mounted other way round, /dev/sdb1 -> mount_point_B. I have to reboot the system (maybe even several times) to make things right.
Is there a way to ensure that mounting goes to right point every time? I read about using UUID for that, but, as I said, that is not an option with identical UUIDs.
 
Old 05-11-2014, 05:30 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
At the moment the first drive found will be assigned to /dev/sdb1. You will need to write udev rules based on any other unique identifier like serial number or manufacture. You can find their attributes via the udevadm utility
 
Old 05-11-2014, 09:00 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
You could give them separate labels and mount them by label.

http://www.cyberciti.biz/faq/rhel-ce...rtition-label/

Precisely what command to use to change the label depends on the file system on the partition on the drive.

https://help.ubuntu.com/community/RenameUSBDrive

It's quite easy to change the label from the command line. I've done it several times, mostly to make the label (e. g., MY PASSPORT, which becomes "MY\ PASSPORT" on the Linux command line) easier to work with (e.g., "passport")
 
1 members found this post helpful.
Old 05-12-2014, 01:04 AM   #4
darkduck
Member
 
Registered: Jan 2011
Location: Cyprus
Distribution: Kubuntu, OpenSuSE
Posts: 502

Original Poster
Rep: Reputation: 26
Thanks, Frankbell. Sounds like an easy solution.
The quick question, though.
Does re-labelling erase the disk content? I hope not.
 
Old 05-12-2014, 04:16 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
No. it will not erase any data.
 
Old 05-12-2014, 05:04 PM   #6
darkduck
Member
 
Registered: Jan 2011
Location: Cyprus
Distribution: Kubuntu, OpenSuSE
Posts: 502

Original Poster
Rep: Reputation: 26
It appeared easier to boot into Windows and change label for NTFS drives from there.
Thanks for the hint anyway.
I now changed fstab records to look like
Code:
LABEL=my_label	/mountpoint		ntfs-3g	0	0
All mounts right. However, command mount still refers to /dev/... path, not to the label.
Code:
/dev/sdb1 on /mountpoint type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
Is it all right?
 
Old 05-12-2014, 05:11 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Yes that is normal.
 
  


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
[SOLVED] Reliably mount different external drives to the same points? j_h Linux - General 10 08-16-2012 05:23 AM
mount points disappear and reappear under /media for USB drives alamode Linux - Server 2 06-11-2012 02:47 PM
[SOLVED] Mounting USB drives fail in GUI but mount through shell access. Ernst0 Linux - Newbie 2 03-07-2012 03:45 PM
Create mount points automatically for removable drives? Mig21 Slackware 2 01-10-2010 05:39 PM
don't want mount points for some drives! garyd9 Mandriva 1 03-25-2004 12:33 PM

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

All times are GMT -5. The time now is 07:19 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