LinuxQuestions.org
Visit Jeremy's Blog.
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, 04:43 PM   #1
darkduck
Member
 
Registered: Jan 2011
Location: London
Distribution: Ubuntu, Debian
Posts: 493

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, 06:30 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,961

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
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, 10:00 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,358
Blog Entries: 12

Rep: Reputation: 2740Reputation: 2740Reputation: 2740Reputation: 2740Reputation: 2740Reputation: 2740Reputation: 2740Reputation: 2740Reputation: 2740Reputation: 2740Reputation: 2740
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, 02:04 AM   #4
darkduck
Member
 
Registered: Jan 2011
Location: London
Distribution: Ubuntu, Debian
Posts: 493

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, 05:16 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,961

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
No. it will not erase any data.
 
Old 05-12-2014, 06:04 PM   #6
darkduck
Member
 
Registered: Jan 2011
Location: London
Distribution: Ubuntu, Debian
Posts: 493

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, 06:11 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,961

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 05:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration