From: Ian Kelling Date: Sun, 14 Feb 2016 05:39:02 +0000 (-0800) Subject: parted doesn't document default alignment so set it X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=e8f685f09f4190d1afabf25d6d7ac2f7e5dec841;p=automated-distro-installer parted doesn't document default alignment so set it --- diff --git a/fai-revm b/fai-revm index d9bacf4..5ac7fce 100755 --- a/fai-revm +++ b/fai-revm @@ -9,7 +9,7 @@ set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR -disk_count=4 +disk_count=1 script_dir=$(dirname $(readlink -f "$BASH_SOURCE")) diff --git a/fai/config/class/50-host-classes b/fai/config/class/50-host-classes index 27c1e1b..413ac01 100755 --- a/fai/config/class/50-host-classes +++ b/fai/config/class/50-host-classes @@ -8,7 +8,7 @@ # use a list of classes for our demo machine case $HOSTNAME in demohost) - echo "FAIBASE DEBIAN DESKTOP MANY_DISK STABLE" ;; + echo "FAIBASE DEBIAN DESKTOP ONE_DISK STABLE" ;; x2) echo "FAIBASE DEBIAN DESKTOP ONE_DISK" ;; tp) diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index c4514c5..5d4684c 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -48,7 +48,7 @@ devs=(${letters[@]/#//dev/${d}}) crypt_devs=(${letters[@]/#//dev/mapper/crypt_dev_${d}}) first_boot_dev=${devs[0]}$bootn -partition=false +partition=true # somewhat crude detection of whether to partition for dev in ${devs[@]}; do @@ -99,12 +99,13 @@ if $partition; then parted -s $dev mklabel gpt # gpt ubuntu cloud image uses ~4. fai uses 1 MiB. ehh, i'll do 4. # also, using MB instead of MiB causes complains about alignment. - parted -s $dev mkpart primary "ext3" 4MB ${boot_end}MiB - parted -s $dev mkpart primary "linux-swap" ${boot_end}MiB ${swap_end}MiB - parted -s -- $dev mkpart primary "" ${swap_end}MiB -0 - parted -s $dev mkpart primary "" 1MiB 4MiB - parted -s $dev set $bios_grubn bios_grub on - parted -s $dev set $bootn boot on # generally not needed on modern systems + pcmd="parted -a optimal -s -- $dev" + $pcmd mkpart primary "ext3" 4MB ${boot_end}MiB + $pcmd mkpart primary "linux-swap" ${boot_end}MiB ${swap_end}MiB + $pcmd mkpart primary "" ${swap_end}MiB -0 + $pcmd mkpart primary "" 1MiB 4MiB + $pcmd set $bios_grubn bios_grub on + $pcmd set $bootn boot on # generally not needed on modern systems # the mkfs failed randomly on a vm, so I threw a sleep in here. sleep .1