diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-05-02 11:30:53 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-05-03 19:53:15 -0700 |
commit | b6871cf68a0b32f191d864aac34e6622970a828a (patch) | |
tree | b7d3514ff137f0a3d3609507310f347a79e66dce /scripts/install | |
parent | ae552cf567b52888f14fb2de551328c88bf9471f (diff) | |
download | vyatta-cfg-quagga-b6871cf68a0b32f191d864aac34e6622970a828a.tar.gz vyatta-cfg-quagga-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')
-rwxr-xr-x | scripts/install/install-get-partition | 17 |
1 files changed, 12 insertions, 5 deletions
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 |