From b6871cf68a0b32f191d864aac34e6622970a828a Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 2 May 2011 11:30:53 -0700 Subject: 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. --- scripts/install/install-get-partition | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'scripts/install') diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index debb2eaa..b15092a6 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -34,8 +34,8 @@ PARTITION='' # default file system type ROOT_FSTYPE='ext3' -# start of root partition (0% is magic to tell parted to align) -ROOT_OFFSET="0%" +# default start of root partition +ROOT_OFFSET="64S" warn_of_dire_consequences () { # Give the user a requisite warning that we are about to nuke their drive @@ -713,11 +713,18 @@ create_partitions() { fi } -# sets ROOT_FSTYPE based on disk size +# adjust root filesystem based on disk size set_root_fstype () { local drv=$1 - # always use ext3 for stability - ROOT_FSTYPE=ext3 + local sz=$(get_drive_size "$drv") + + # if disk is small, then don't waste space aligning + # otherwise align on 512K boundary for SSD etc + if (( $sz < 10000 )); then + ROOT_OFFSET="64S" + else + ROOT_OFFSET="1024S" + fi } # ask for user input on the parted and skip setup methods -- cgit v1.2.3