3

I just upgraded my Mac to Mac OS X El Capitan and I wanted to update my Windows 7 to Windows 10. But, before that, I need to make a backup of my Windows partition.

As I've done it before, I have a Windows (NTFS) partition on a backup HDD.

The thing is, I want to make a new backup with Carbon Copy Cloner, but it tell's me it can't be done because there are two volumes with same UUID.

OK, then, I fight with my Windows backup partition to have it a different UUID from the one I got for my "local" Windows partition... and I'm loosing the fight !

I have this when using diskutil info /dev/disk0s2 :

   Device Identifier:        disk0s2
   Device Node:              /dev/disk0s2
   Whole:                    No
   Part of Whole:            disk0
   Device / Media Name:      Windows_NTFS_Untitled_3

   Volume Name:              Win

   Mounted:                  Yes
   Mount Point:              /Volumes/Win

   File System Personality:  NTFS
   Type (Bundle):            ntfs
   Name (User Visible):      Windows NT File System (NTFS)

   Partition Type:           Microsoft Basic Data
   OS Can Be Installed:      No
   Media Type:               Generic
   Protocol:                 SATA
   SMART Status:             Verified
   Volume UUID:              24D65D1E-43E8-4FF0-BBBF-A82CC6B45D20
   Disk / Partition UUID:    D5C23E74-E658-45E1-B9B3-44681D0D02C2

   Total Size:               85.0 GB (84999667712 Bytes) (exactly 166014976 512-Byte-Units)
   Volume Free Space:        34.1 GB (34093342720 Bytes) (exactly 66588560 512-Byte-Units)
   Device Block Size:        512 Bytes
   Allocation Block Size:    4096 Bytes

   Read-Only Media:          No
   Read-Only Volume:         No

   Device Location:          Internal
   Removable Media:          No

   Solid State:              No

... and I have this using diskutil info /dev/disk1s4 :

   Device Identifier:        disk1s4
   Device Node:              /dev/disk1s4
   Whole:                    No
   Part of Whole:            disk1
   Device / Media Name:      WindowsB

   Volume Name:              Windows

   Mounted:                  Yes
   Mount Point:              /Volumes/Windows

   File System Personality:  NTFS
   Type (Bundle):            ntfs
   Name (User Visible):      Windows NT File System (NTFS)

   Partition Type:           Microsoft Basic Data
   OS Can Be Installed:      No
   Media Type:               Generic
   Protocol:                 USB
   SMART Status:             Not Supported
   Volume UUID:              24D65D1E-43E8-4FF0-BBBF-A82CC6B45D20
   Disk / Partition UUID:    C8E2A2D5-6065-4903-8BB6-AC02698323A6

   Total Size:               84.7 GB (84655734784 Bytes) (exactly 165343232 512-Byte-Units)
   Volume Free Space:        44.0 GB (44012474368 Bytes) (exactly 85961864 512-Byte-Units)
   Device Block Size:        512 Bytes
   Allocation Block Size:    4096 Bytes

   Read-Only Media:          No
   Read-Only Volume:         No

   Device Location:          External
   Removable Media:          No

As you can see, the "Disk / Partition UUID" is different, but not the "Volume UUID".

Does anybody have a solution to change the "Volume UUID"?

  • 1
    This appears to be a duplicate of this post: superuser.com/questions/344706/… – Allan Mar 1 '16 at 22:44
  • @Allan This is no duplicate! The linked question/answers only apply to hfs/hfs+ volumes. In the question here the volume has a ntfs file system. – klanomath Mar 2 '16 at 3:05
  • I'm using NTFS-3G to have RW access on my NTFS partitions. – pierreonthenet Mar 3 '16 at 20:24
2

Usually NTFS volumes don't contain UUIDs. The visible UUID in diskutil is derived from the NTFS Volume Serial Number.

Get the disk identifier of your backup disk and the volume:

diskutil list

Unmount the external disk:

diskutil umountDisk /dev/disk1

Copy the NTFS superblock:

sudo dd if=/dev/disk1s4 of=~/Desktop/superblock bs=512 count=1

Change the mod bits:

sudo chmod 777 ~/Desktop/superblock 

Create a backup of the superblock (just in case!):

cp ~/Desktop/superblock ~/Desktop/superblock.backup

Modify the file superblock with HexFiend:

Hexfiend superblock

The NTFS volume serial number is highlighted in violet (eight bytes beginning at offset 72 or 0x48). Modify at least one byte. After saving the file check the size which should still be 512 Bytes.

Write back the superblock:

sudo dd if=~/Desktop/superblock of=/dev/disk1s4 bs=512 count=1

Reboot your Mac and verify the new UUID of disk1s4.

  • Thank you for your response ! I already done all of that, except the reboot : is it important to reboot te computer, as I disconnected/connected the external HDD after changing the NTFS serial ID ? – pierreonthenet Mar 3 '16 at 14:41
  • @pierreonthenet Did it work for you? – klanomath Mar 3 '16 at 14:42
  • Sorry, I wanted to add a new line and the comment was send before I finished it... So, no, it doesn't worked for now. I will try after a reboot of my mac when I will get back home. – pierreonthenet Mar 3 '16 at 14:45
  • OK, that's strange ! I just made it as you told here (and this is what I made before), but the "Disk / Partition UUID" isn't changing ! I can tell that it's changed, as a "sudo dd if=/dev/disk1s4 of=~/Desktop/superblock2 bs=512 count=1" give me what I have in the modified "superblock". I though that, because the Partition UUID is not the same on my disk0s2 and disk1s4, the change was made, but it seems not. Are you absolutely sure that what you give here is working for you ? – pierreonthenet Mar 3 '16 at 20:21
2

You can simply change UUID by partition format/erase.

1) Format disk to Mac OS Extended using built-in Disk Utility

2) If you need windows partition, format disk to exFAT after you have done first step (for some reason you need two steps for windows partition)

You can check if UUID changed by listing all UUID numbers:

find /Volumes -maxdepth 1 -mindepth 1 -exec diskutil info {} \;
2

On an NTFS partition the UUID is approximately 3352 bytes[1] from the beginning of the MFT, to find the offset of the MFT it is necessary to read the 8 bytes which start from the 48 byte of the beginning of the partition, These 8 bytes once converted will give the offset of the sector where the MFT begins. To get the offset of the MFT the 8 bytes converted must be multiplied by the number of bytes per sector (512) and the number of sectors per clusters (8) (8 and 512 are the default values ​​for an NTFS partition).

For example, the 8 bytes starting at the 48th (in reading it is two characters per one byte) may be 0x698c670000000000 which will have to be inverted 0x0000000000678c69 and converted to decimal 6786153. Then apply the formula (6786153 * 8 * 512) or (6786153 * 4096 ) = 27796082688 (offset of the MFT) + 3352 (UUID offset) = 27796086040. so in the partition if we move to byte 27796086040 we will find the UUID of the partition on 16 bytes which will have to be converted into Hexadecimal and inverted for the first 8.

There is not much interest in modifying the UUID of an NTFS partition, Microsoft apparently does not use it, Mac OS X displays the UUIDs of the partitions. There is not much comment on the UUID of NTFS partitions. I've created an AppleScript[2] to read the NTFS or HFS UUIDs. The only UUIDs that I modify are those of the HFS, to start with the choice of the UUID.

[1]: +3352 this is for a physical NTFS partition, for a partition of a VHD it's +3320)

[2]: AppleScript to read UUID from an NTFS partition. All sudo commands are to be completed for your name and password, otherwise try removing the sudo. I do not advise you to modify the UUID, there is no information on their use. I left the inversion of the bytes in a very rudimentary way.**

set hdd to {}
set dmg to do shell script "sudo ls /dev/disk**s** " & " | sed -e 's#[[:space:]]*$##;s#\\/dev\\/##;/^$/d'" user name "Your_Name" password "Your_Password" with administrator privileges
set doun to ""
set dor to ""
set uuidd to ""
set uuidd to {}

set hfsountfs to ""
set theVol1 to ""
set theVol to ""
set vhd to ""
set leplus to 0
set levhd to ""
set hd to {}
set _Result to the paragraphs of dmg
set n to 0
set n to count _Result
set j to 1
do shell script "echo " & n

repeat with i from 1 to n
    set end of hdd to item i of _Result

end repeat

set theVolumeTemp to (choose from list hdd with prompt "Choisissez le Volume (partition) NTFS :" with empty selection allowed)
if theVolumeTemp is not false then

    set theVolumeTemp to do shell script "echo " & theVolumeTemp
    set theVol to "/dev/" & theVolumeTemp
    set theVol1 to theVol
    set theVol to do shell script "echo " & theVol & " | xxd -p | sed 's#0a##' | xxd -r -p "
    try
        set vhd to do shell script "diskutil info " & theVol & " | grep 'Disk Image' "
    end try
    try

        set uuidd to do shell script "diskutil unmount " & theVol
    end try
    set uuidd to do shell script "sudo dd if=" & theVol & " iseek=48 bs=1 count=8  | xxd -p " user name "Your_Name" password "Your_Password" with administrator privileges

    set theVol to do shell script "echo " & uuidd
    set n to 0
    set n to count uuidd
    do shell script "echo " & n

    repeat with i from 1 to 8
        set les2 to (item (n - 1) of uuidd & item n of uuidd)
        set end of hd to les2
        set n to n - 2
    end repeat
    set hd to do shell script "echo " & hd

    set nDec to (do shell script "perl -e 'printf(hex(\"" & hd & "\"))'") as integer
    if vhd is not "" then
        set leplus to 3320
        set levhd to "c'est un Vhd ntfs"
    else
        set leplus to 3352
    end if

    set nDec to do shell script " echo $((" & nDec & " * 4096 + " & leplus & "))" as string
    set uuidd to do shell script "sudo dd if=" & theVol1 & " iseek=" & nDec & " bs=1 count=16 | xxd -p " user name "Your_Name" password "Your_Password" with administrator privileges

    set hd to {}
    set n to 8
    repeat with i from 1 to 4
        set les2 to (item (n - 1) of uuidd & item n of uuidd)
        set end of hd to les2
        set n to n - 2
    end repeat

    set end of hd to "-"

    set n to 12
    repeat with i from 1 to 2
        set les2 to (item (n - 1) of uuidd & item n of uuidd)
        set end of hd to les2
        set n to n - 2
    end repeat

    set end of hd to "-"

    set n to 16
    repeat with i from 1 to 2
        set les2 to (item (n - 1) of uuidd & item n of uuidd)
        set end of hd to les2
        set n to n - 2
    end repeat
    set end of hd to "-"

    repeat with i from 17 to 20
        set end of hd to item (i) of uuidd
    end repeat
    set end of hd to "-"
    repeat with i from 21 to 32
        set end of hd to item (i) of uuidd
    end repeat
    set hd to do shell script "echo " & hd


    set lamft to do shell script " echo $((" & nDec & " - " & leplus & "))" as string



    set doun to " Identifiant Universel Unique ou UUID du " & theVolumeTemp & " est : 
" & hd

    set doun to doun & "
 La MFT du " & theVolumeTemp & " est à  :  " & lamft & " Octets du départ de la partition " & "
 l'UUID se trouve  plus loin de " & leplus & " Octets " & "
" & levhd
    set uuiddd to do shell script "sudo dd if=" & theVol1 & " iseek=72 bs=1 count=8  | xxd -p " user name "Your_Name" password "Your_Password" with administrator privileges
    set n to 0
    set n to count uuiddd
    do shell script "echo " & n
    set uuiddd to do shell script "echo " & uuiddd & "  | tr [:lower:] [:upper:] "
    set hdd to {}
    set les2 to (item 15 of uuiddd & item 16 of uuiddd & item 13 of uuiddd & item 14 of uuiddd)
    set end of hdd to les2
    set end of hdd to "-"
    set les2 to (item 11 of uuiddd & item 12 of uuiddd & item 9 of uuiddd & item 10 of uuiddd)
    set end of hdd to les2
    set end of hdd to "-"
    set les2 to (item 7 of uuiddd & item 8 of uuiddd & item 5 of uuiddd & item 6 of uuiddd)
    set end of hdd to les2
    set end of hdd to "-"
    set les2 to (item 3 of uuiddd & item 4 of uuiddd & item 1 of uuiddd & item 2 of uuiddd)
    set end of hdd to les2

    set doun to doun & " Le numero de série des 8 Octets de l'offset 72 partition NTFS du " & theVolumeTemp & " est : 
" & uuiddd & "
 Toujours présenté sous cette forme : " & hdd
    display alert (doun as string)

    try
        do shell script "diskutil mount " & theVol1

    end try

end if
0

An accuracy on the UUID offset in the MFT of an NTFS volume, 3320 or 3352. The difference comes from the origin of the formatting. If you format a hdd or vhd from Microsoft Windows, the offset for the UUID in the MFT will be 3352 bytes from the beginning of the MFT. If you format a volume or vhd from Mac OS X, with Diskutil the offset of the UUID will be 3320 bytes from the beginning of the MFT. All this for a volume (or vhd) NTFS of course. I do not thank Glorfindel who has only delete in the text "Hello," which allows him to this "faignasse" to appear in the comment.

0

I had the same problem. Here is what I had to do after making a byte-by-byte copy from one drive to the other in Terminal. That left me with a UUID conflict like the one you originally had.

I booted to one of the Windows drives. Windows was unable to mount both drives, due to the conflict, but using the windows cmd prompt elevated to Administrator privileges, I was able to view and change the UUID of the unmounted drive to make it different from the original as described here: http://support.altaro.com/customer/portal/articles/1115503-how-can-i-change-the-disk-id-of-a-drive-

CarbonCopyCloner may then work for you. If not, you can boot to OS X, and use Disk Utility to do it. Select the backup drive and choose the Restore command. It will let you select your source volume and copy it to the clone volume.

If that doesn't work because it's an NTFS volume, you need Paragon's NTFS for Mac app, which I purchased. It allows for both reads and writes of NTFS from within OS X, and I find it indispensable. However, it comes with a 7-day free trial, and the trial version should work for you. Install it, and then Disk Utility will be able to perform the operation.

Another thing I've found handy with the Paragon NTFS for Mac utility is that it will allow you to add your cloned drive to the Preferences Startup Disk menu, not to mention also adding a Windows Repair disk to the Startup Preferences if you have one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .