]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk-prepare: poke kernel into refreshing partition tables
authorSage Weil <sage@inktank.com>
Fri, 26 Oct 2012 04:21:18 +0000 (21:21 -0700)
committerSage Weil <sage@inktank.com>
Tue, 30 Oct 2012 17:40:58 +0000 (10:40 -0700)
Prod the kernel to refresh the partition table after we create one.  The
partprobe program is packaged with parted, which we already use, so this
introduces no new dependency.

Signed-off-by: Sage Weil <sage@inktank.com>
src/ceph-disk-prepare

index d8e59eac4ccd98d98a353287ffc9cb022a0fdfcd..e5c4bdb9050b35ffbe13c1ed87ddaee32c8e6f6b 100755 (executable)
@@ -337,6 +337,13 @@ def prepare(
                     journal,
                     ],
                 )
+            subprocess.check_call(
+                args=[
+                    # also make sure the kernel refreshes the new table
+                    'partprobe',
+                    journal,
+                    ],
+                )
         except subprocess.CalledProcessError as e:
             raise PrepareError(e)
 
@@ -354,6 +361,13 @@ def prepare(
                 disk,
                 ],
             )
+        subprocess.check_call(
+            args=[
+                # also make sure the kernel refreshes the new table
+                'partprobe',
+                disk,
+                ],
+            )
     except subprocess.CalledProcessError as e:
         raise PrepareError(e)