5

I'm trying to setup /etc/fstab to automatically mount two external NTFS hard drives on boot, and decided to use the UUIDs as reference instead of the device names.

Strangely, blkid reports that both hard disks have the exact same UUID, so I am unable to add both entries into the file. Here's what it shows for the two disks:

/dev/sdc1: LABEL="Hank's Legacy" UUID="D8249BB8249B97D8" TYPE="ntfs" PARTUUID="61bf885b-01"

/dev/sdb1: LABEL="Hank's Mainframe" UUID="D8249BB8249B97D8" TYPE="ntfs" PARTUUID="f865b797-01"

I read that tune2fs cannot be used to modify the UUID for NTFS partitions, because this is technically not a UUID, but a serial number. Any suggestions on how I can mount the two disks without causing conflicts?

  • Nothing to add to the various responses you already got below. However the fact that two drives should end up with the same UUID is improbable that it strikes me as practically impossible. So 1 question: have you at one point or another performed a bit to bit copy of one drive to the other (using dd for instance) ? – Cbhihe Jun 30 '15 at 11:03
  • @Cbhihe, see my answer. It is possible (though extremely rare) if drives are factory-formatted... – Fabby Jun 30 '15 at 11:19
  • 1
    @Fabby: I had seen your answer. I stand by my comment especially because we don't now whether Phanindra_K bought identical drives, at the same time, with almost identical S/N, etc... etc... The probability for that happening is infitesimal. I am just curious to see whether there is another explanation. Usually the error or the glitch occurs between chair and keyboard. – Cbhihe Jun 30 '15 at 11:24
  • @Cbhihe: Yes, these were two identical hard drives purchased in the same order. I've never done a disk-to-disk copy on them. – Phanindra K Jul 7 '15 at 14:59
  • 1
    In that case, as improbable as that may be, you may have exactly what @Fabby suggested. Hope you are now passed the problem. It may look a bit scary because you may think that your entire drive is in danger, but in fact, I definitely would use the solution you chose. Change the UUID of one drive. The label change is just icing on the cake. When push comes to shove, what is important in terms of physical volume management is the UUID, especially if you manage a large number of UUIDs. -ced. – Cbhihe Jul 7 '15 at 18:30
9

To mount an NTFS drive we can also use a disk label only. We can safely change the label from Windows or by using ntfslabel Install ntfslabel. See

Needless to say that by using ntfslabel we can also change a partition's UUID (aka serial number). To avoid negative effects on the UUID dependent Windows file allocation we should only change the upper part of the UUID (which is not used by Windows):

sudo ntfslabel --new-half-serial[=ssssssss] /dev/sdXN

Example:

enter image description here

  • Good one if the user is an advanced user! Otherwise "copy all data to one drive, reformat the other" is easier for a beginning user! ;-) (Upvoted!) – Fabby Jun 30 '15 at 11:28
  • Actually the OP apparently already has a label for their drives. So it's just an edit of the fstab - udisks mount to /media should already use the label. – Takkat Jun 30 '15 at 11:31
  • 1
    Thank you for this answer! @Fabby: I knew this was an option, but there's simply too much data in those drives to do multiple copy-overs. :) – Phanindra K Jul 2 '15 at 16:17
  • 1
    @PhanindraK: As you've never accepted any answer on this site before: If this answer helped you, don't forget to click the grey at the left of this text, which means Yes, this answer is valid! ;-) – Fabby Jul 2 '15 at 16:51
  • Takkat: I have strong doubts that what you propose is really about changing the UUID of any partition. This looks, smells and sounds like changing some serial number pertaining to a drive sdX , not the UUID of a partition on any drive. Phanindra_K's question is about UUID changing, which is what @Ron addresses more correctly imho. – Cbhihe Jul 7 '15 at 19:33
1

Interesting! There is a way to modify the UUID of ntfs partition by modifying the superblock as documented here. It says that volume serial number is the eight bytes beginning at offset 0x48 in an ntfs formatted drive/partition so, altering it will change the serial number/UUID. To reproduce it:

dd if=/dev/sda# of=my_block bs=512 count=1

ghexedite2 my_block (or what ever hex editor you like. Alter a byte or two between 0x48 and 0x4f, inclusive)

dd if=my_block of=/dev/sda# bs=512 count=1

I have not tried this myself, but looks interesting.

Note: dd is Disk Destroy :) so use with caution!

  • I am veeery wary when I use dd to directly access disks.. so I wouldn't use your solution unless I know EXACTLY what I'm modifying. You're right about Disk Destroy and I can't afford to do that with these disks! – Phanindra K Jul 2 '15 at 16:47
  • However, reading this was very educational.. so thank you for the information! – Phanindra K Jul 2 '15 at 16:48
  • 1
    @Phanindra_K: Understandably you are cautious, but to take the feeling of danger away from all this just see this at linux.com/community/blogs/133-general-linux/289198. It is hard to do better at explaining what Ron suggested, which btw IS the right solution to your problem. – Cbhihe Jul 7 '15 at 19:42
0

This is somehow strange, anyway inorder to use your hdds you can use the /dev/sdX instead of UUID, so you can add then both HDD.

/dev/sdb1 /mount-point ntfs defaults,uid=USER_ID,rw  0  0

It's advised to read this: How do I correctly mount a NTFS partition in /etc/fstab?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.