]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix journal partition creation
authorAlexandre Marangone <alexandre.marangone@inktank.com>
Fri, 19 Apr 2013 22:09:28 +0000 (15:09 -0700)
committerSage Weil <sage@inktank.com>
Mon, 29 Apr 2013 20:53:26 +0000 (13:53 -0700)
With OSD sharing data and journal, the previous code created the
journal partiton from the end of the device. A uint32_t is
used in sgdisk to get the last sector, with large HD, uint32_t
is too small.
The journal partition will be created backwards from the
a sector in the midlle of the disk leaving space before
and after it. The data partition will use whichever of
these spaces is greater. The remaining will not be used.

This patch creates the journal partition from the start as a workaround.

Signed-off-by: Alexandre Marangone <alexandre.marangone@inktank.com>
(cherry picked from commit 56619ab91732bd2eacbef388311954f4e0230a30)

src/ceph-disk

index af50c77339b1b6b423b26b7a9db3bff944938564..de76f3c8c52d54c1091de18ec75a56be67b060c7 100755 (executable)
@@ -704,11 +704,9 @@ def prepare_journal_dev(
     num = None
     if journal == data:
         # we're sharing the disk between osd data and journal;
-        # make journal be partition number 2, so it's pretty; put
-        # journal at end of free space so partitioning tools don't
-        # reorder them suddenly
+        # make journal be partition number 2, so it's pretty
         num = 2
-        journal_part = '{num}:-{size}M:0'.format(
+        journal_part = '{num}:0:{size}M'.format(
             num=num,
             size=journal_size,
             )