From 25e328c37a0d58389b7c67bf50fb66157ae80717 Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Thu, 28 Jun 2012 04:25:43 -0400 Subject: [PATCH] sfdisk does not support gpt partition tables --- source/steps/CheckForNewDisks.py | 2 +- source/systeminfo.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/steps/CheckForNewDisks.py b/source/steps/CheckForNewDisks.py index e5af3f1..14523d8 100644 --- a/source/steps/CheckForNewDisks.py +++ b/source/steps/CheckForNewDisks.py @@ -91,7 +91,7 @@ def Run( vars, log ): # just to be extra paranoid, ignore the device if it already has # an lvm partition on it (new disks won't have this, and that is # what this code is for, so it should be ok). - cmd = "sfdisk -l %s | grep -q 'Linux LVM'" % device + cmd = "parted -l %s | grep -q lvm$" % device has_lvm= utils.sysexec_noerr(cmd, log) if has_lvm: log.write( "It appears %s has lvm already setup on it.\n" % device) diff --git a/source/systeminfo.py b/source/systeminfo.py index bc605de..9754f5c 100755 --- a/source/systeminfo.py +++ b/source/systeminfo.py @@ -150,10 +150,14 @@ def get_block_device_list(vars = {}, log = sys.stderr): # so, lets run sfdisk -l (list partitions) against # most possible block devices, that way they show # up when it comes time to do the install. + + # 27.6.2012 - Using parted instead of sfdisk, assuming + # that doing so respects the behavior mentioned above. + devicenames = valid_blk_names.keys() devicenames.sort() for devicename in devicenames: - os.system( "sfdisk -l /dev/%s > /dev/null 2>&1" % devicename ) + os.system( "parted -l /dev/%s > /dev/null 2>&1" % devicename ) # touch file fb = open(DEVICES_SCANNED_FLAG,"w") -- 2.43.0