summaryrefslogtreecommitdiff
path: root/scripts/install/install-get-partition
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2012-01-30 22:43:48 +0000
committerJohn Southworth <john.southworth@vyatta.com>2012-01-30 22:43:48 +0000
commit6fbc5093b3834ea8b969865ab6c9a171c1d4b35c (patch)
tree8188597c9ab95d438e81fedec76de3ef639c3571 /scripts/install/install-get-partition
parent0aa1232f0b81216a11b7757fca98363c05971cca (diff)
parent227a93ede7e7058da48cde6604bbadb9aa0d2c8e (diff)
downloadvyatta-cfg-system-6fbc5093b3834ea8b969865ab6c9a171c1d4b35c.tar.gz
vyatta-cfg-system-6fbc5093b3834ea8b969865ab6c9a171c1d4b35c.zip
Merge branch 'oxnard' of git.vyatta.com:/git/vyatta-cfg-system into oxnard
Diffstat (limited to 'scripts/install/install-get-partition')
-rwxr-xr-xscripts/install/install-get-partition16
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