From 177fa685159523d2ef8bd9ad6447d28c3338e7e9 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 20 Jan 2012 15:36:25 -0800 Subject: Make disk label if necessary Bug 7732 Restore installation section that makes disk label. --- scripts/install-system | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'scripts/install-system') diff --git a/scripts/install-system b/scripts/install-system index 536233d7..fcd2dff0 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -840,6 +840,22 @@ create_partitions() { exit 1 fi + # Make sure you can print disk info using parted + parted --script /dev/$ldrive p >/dev/null 2>&1 + + # If unable to read disk, it's likely it needs a disklabel + if [ "$?" != "0" ]; then + lecho "Creating a new disklabel on $ldrive" + lecho "parted /dev/$ldrive mklabel msdos" + output=$(parted -s /dev/$ldrive mklabel msdos) + + parted --script /dev/$ldrive p >/dev/null 2>&1 + if [ "$?" != "0" ]; then + echo "Unable to read disk label. Exiting." + exit 1 + fi + fi + echo "Creating root partition on /dev/$ldrive" >> $INSTALL_LOG # make the root partition -- cgit v1.2.3