9

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?

Maythux
  • 87,123
Phani K
  • 475
  • 1
  • 6
  • 12

3 Answers3

14

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

Takkat
  • 144,580
3

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!

Ron
  • 20,938
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?

Maythux
  • 87,123