summaryrefslogtreecommitdiff
path: root/scripts/install-system
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2011-05-02 11:30:53 -0700
committerStephen Hemminger <shemminger@vyatta.com>2011-05-03 19:53:15 -0700
commitb6871cf68a0b32f191d864aac34e6622970a828a (patch)
treeb7d3514ff137f0a3d3609507310f347a79e66dce /scripts/install-system
parentae552cf567b52888f14fb2de551328c88bf9471f (diff)
downloadvyatta-cfg-system-b6871cf68a0b32f191d864aac34e6622970a828a.tar.gz
vyatta-cfg-system-b6871cf68a0b32f191d864aac34e6622970a828a.zip
Adjust root partition offset based on disk size
On tiny disks, then it doesn't make sense to waste space by offsetting root partition. On big disks, it doesn't hurt and it allows for running on SSD.
Diffstat (limited to 'scripts/install-system')
-rwxr-xr-xscripts/install-system11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/install-system b/scripts/install-system
index 4d712ee7..278e77dc 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -77,8 +77,8 @@ PARTITION=''
# default file system type
ROOT_FSTYPE="ext3"
-# start of root partition (0% is magic to tell parted to align)
-ROOT_OFFSET="0%"
+# start of root partition (64 sectors == 32K bytes)
+ROOT_OFFSET="64S"
# Process ID of this script for the lame marketing spinner
SPID=$$
@@ -1267,6 +1267,13 @@ setup_method_auto() {
while [ $ROOT_MIN -gt $ROOT_PARTITION_SIZE ]; do
# Get the size of the drive
size=$(get_drive_size $INSTALL_DRIVE)
+
+ # If drive is big, leave more space 512K bytes (1024 sectors)
+ # this is better for SSD
+ if (( $size > 10000 )); then
+ ROOT_OFFSET="1024S"
+ fi
+
echo -n "How big of a root partition should I create? ($ROOT_MIN"MB" - $size"MB") [$size]MB: "
response=$(get_response "$size")
# TODO: need to have better error checking on this value