2

How to change UUID for NTFS partition?

1 Answers1

2

There is a way to modify the UUID of NTFS partition by modifying the superblock. 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.

Source

0x48 is 72 in decimal system.

To read UUID for sdaX:

sudo dd bs=1 skip=72 count=8 if=/dev/sda1 2>/dev/null \
| xxd -plain -u \
| sed -r 's/(..)(..)(..)(..)(..)(..)(..)(..)/\8\7\6\5\4\3\2\1/'

Example output result: 3AB79E6A2F294BBD

To set D08EFD308EFD1028 UUID for sdaX:

UUID="D08EFD308EFD1028"

printf "\x${UUID:14:2}\x${UUID:12:2}\x${UUID:10:2}\x${UUID:8:2}\x${UUID:6:2}\x${UUID:4:2}\x${UUID:2:2}\x${UUID:0:2}" \
| sudo dd bs=1 seek=72 count=8 conv=notrunc of=/dev/sdaX

Related link: How to change vfat partition UUID?