This is similar to the question asked here:

How does one change the UUID of a Volume on Mac OS X 10.6?

Only difference is I want to change it to a specific value, not a random one. The hfs.util only seems to do random.

I considered modifying the hfs.util source to allow me to specify values. As I was poking around the code looking for where to begin making changes I remembered why C is not my favorite language. Several compile errors and segfaults later, I lost enthusiasm for trying to modify this tool. I'm willing to have a go at it again after I get some rest, but I figure there has got to be an easier way to change a volume's UUID that I just don't know of.

So before I waste anymore time, does anyone know of an easy way to do this? Or would any C experts like to join my endeavor in making hfs.util change the UUID to a specified value?

Here are the changes I made to be able to compile the tool from source OS X 10.6.8:

hfsutil_jnl.c:

47: #include <hfs_fsctl.h>

hfsutil_main.c:

80: #include <uuid/uuid.h>
81: /* REMOVED */

And, as hinted in this article, added the following from line 166 in fs.c to hfsutil_main.c (since namespace.h isn't anywhere on the system):

static unsigned char kFSUUIDNamespaceSHA1[] = {0xB3,0xE2,0x0F,0x39,0xF2,0x92,0x11,0xD6,0x97,0xA4,0x00,0x30,0x65,0x43,0xEC,0xAC};

Lastly, I grabbed this file and added it to the working dir http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/bsd/hfs/hfs_fsctl.h

link|improve this question
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.