Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Does anyone know how to change the UUID of a Volume? The background for this question is that I have a duplicate UUID issue:

I have /Volumes/OldMacHD with a UUID of XYZ. I have /Volumes/Mirror1 with a UUID of XYZ (same UUID! I bet that's because OldMacHD USED to be part of this mirror). I got these UUIDs via 'diskutil info /dev/thatdisknumber | grep UUID'.

I'd like to change the UUID of 'Mirror1'.

I discovered by chance the 'hfs.util' utility, since these are HFS volumes after all. The man page for hfs.util says that if you issue the -s flag, this changes the UUID. However, if you type hfs.util all by itself, it doesn't show you the -s option at all, just every option besides that! Grr. I tried it anyway:

sudo /System/Library/Filesystems/hfs.fs/hfs.util -s /dev/disk4 (the raid volume).  

Nothing happens. No error message, no success message. UUID exactly the same. I tried it while the volume was unmounted.

Any ideas?

share|improve this question
add comment

3 Answers

the syntax for hfs.util appears to just be the devicename, not the path including /dev/

i.e.

Server:~ admin$ mount
(...)
/dev/disk1s2 on /Volumes/Backup (hfs, local, journaled)
(...)
Server:~ admin$ sudo /System/Library/Filesystems/hfs.fs/hfs.util -s rdisk1s2

make sure to unmount the drive before the hfs.util -s and mount afterwards.

use the "raw" device i.e. rdisk1s2 instead of disk1s2

diskutil info will not show the new uuid until you remount.

share|improve this answer
add comment

All the examples I can find just take the device BSD name, not the full path to a device file. Have you tried that?

share|improve this answer
    
Yup, tried them both. I ended up non-destructively killing and rebuilding the raid mirror in order to change the UUID, because nothing else worked. Would be interesting to know how to do this for the future. –  Emmel Apr 4 '10 at 16:21
    
Odds are good it's never been tested on a RAID setup. Try it on a single device, and if it still doesn't do anything, file a bug report. –  Hasaan Chop Apr 4 '10 at 17:42
add comment

/dev/disk4 isn't an HFS volume, it's an entire drive, including the partition table and any number of separate volumes (partitions) on the drive. /dev/disk4s0 would be an example of a volume. Find the correct identifier for the actual HFS volume you care about, and try doing hfs.util -s on that.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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