diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2012-01-20 15:36:25 -0800 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2012-01-20 15:36:25 -0800 |
commit | 177fa685159523d2ef8bd9ad6447d28c3338e7e9 (patch) | |
tree | 96e1cdd855106f485418d4a40a6441227472cb13 /scripts/install | |
parent | 6b6213dc2cc6bfaa57d9e8c097897862e76dc416 (diff) | |
download | vyatta-cfg-system-177fa685159523d2ef8bd9ad6447d28c3338e7e9.tar.gz vyatta-cfg-system-177fa685159523d2ef8bd9ad6447d28c3338e7e9.zip |
Make disk label if necessary
Bug 7732
Restore installation section that makes disk label.
Diffstat (limited to 'scripts/install')
-rwxr-xr-x | scripts/install/install-get-partition | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index 86197708..594fa929 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -682,6 +682,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 + lecho "Creating root partition on /dev/$ldrive" # make the root partition |