From: Tommi Virtanen Date: Thu, 4 Oct 2012 23:03:40 +0000 (-0700) Subject: ceph-disk-prepare: Use the OSD uuid as the partition GUID. X-Git-Tag: v0.54~91 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88fc8b7885d675423a893e565c4ce390ee6219f8;p=ceph.git ceph-disk-prepare: Use the OSD uuid as the partition GUID. This will make locating the right data partition for a given journal partition a lot easier. Signed-off-by: Tommi Virtanen --- diff --git a/src/ceph-disk-prepare b/src/ceph-disk-prepare index 03c1527bd936..b69f21e4bf3e 100755 --- a/src/ceph-disk-prepare +++ b/src/ceph-disk-prepare @@ -184,6 +184,8 @@ def prepare( WARNING: This will unconditionally overwrite anything given to it. """ + osd_uuid = str(uuid.uuid4()) + try: subprocess.check_call( args=[ @@ -193,6 +195,9 @@ def prepare( '--mbrtogpt', '--largest-new=1', '--change-name=1:ceph data', + '--partition-guid=1:{osd_uuid}'.format( + osd_uuid=osd_uuid, + ), '--typecode=1:89c57f98-2fe5-4dc0-89c1-f3ad0ceff2be', '--', disk, @@ -222,7 +227,6 @@ def prepare( path = mount(dev=dev, fstype=fstype, options=mount_options) try: write_one_line(path, 'ceph_fsid', cluster_uuid) - osd_uuid = str(uuid.uuid4()) write_one_line(path, 'fsid', osd_uuid) write_one_line(path, 'magic', CEPH_OSD_ONDISK_MAGIC) finally: