Commits

Thayne Harbaugh committed 07b70c3

Notify kernel of partition changes (using partprobe from parted project)

  • Participants
  • Parent commits e514db4

Comments (0)

Files changed (2)

 
     A ``sdparm`` package is available pre-package with most current Linux
     distributions.
+
+``parted``
+    GNU parted disk partition resizing program and support utilities.
+
+    home: http://www.gnu.org/software/parted/
+
+    A ``parted`` package is available pre-package with most current Linux
+    distributions.
     "mdadm"     : "Administer Linux MD (Software RAID) devices",
     "partimage" : "Efficiently backup/restore partitions",
     "sdparm"    : "Manage SCSI device parameters",
+    "partprobe" : "Notify kernel of partition changes on device (part of parted project)",
     }
 
 
 
 
     def stop(self):
+        if not self.udev:
+            return
+
         while True:
             try:
                 run_cmd(['mdadm', '--stop', self.udev.device_node])
     for part in range(1, int(udev['UDISKS_PARTITION_TABLE_COUNT']) + 1):
         img_file = os.sep.join([save_dir, 'part%d.img' % part])
         cmd_info = run_cmd(['partimage',
-                            '-g', '4',
+                            '-g', '4',   # debug level 4
                             '-o', '-f3', '-z0', '-d', '-B=unused',
                             'save', udev.device_node + str(part), img_file])
 
         if len(udevs) > 1:
             md.stop()
 
+    partprobe_cmdv = ['partprobe']
+    partprobe_cmdv.extend([ u.device_node for u in udevs ])
+    part_info = run_cmd(partprobe_cmdv)
+
     if options.verify:
         udevs = verify(udevs, options.clone)