Skip to content

Commit 32f7492

Browse files
authored
Create boot partition on install
Mixed mbr and gpt logical volumes combined with root eventually growing to >2.19TB requires we split off a boot partition. Turnkey installer does not by default, so modify /dev/vda in situ during install
1 parent 8ed3003 commit 32f7492

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

build_install/payload/installer

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,50 @@ userconfig(){
6868
fi
6969
}
7070

71+
reclaimboot(){
72+
vdaoffset=`echo $(($(fdisk -l /dev/vda | grep Disk | awk '{print $7}')-1999872))`
73+
vdafix=`echo $(( ${vdaoffset} * 512 ))`
74+
vda1end=`echo $(( ${vdaoffset} + 8 ))`
75+
pvresize --setphysicalvolumesize ${vdafix}b /dev/vda1 <<EOF
76+
y
77+
EOF
78+
fdisk /dev/vda <<EOF
79+
d
80+
n
81+
p
82+
1
83+
2048
84+
+${vda1end}
85+
N
86+
n
87+
p
88+
2
89+
90+
91+
a
92+
2
93+
t
94+
1
95+
8e
96+
w
97+
EOF
98+
mkfs.ext2 /dev/vda2 &>/dev/null
99+
bootuuid=$(blkid | grep vda2 | awk '{print $2}' | tr -d '"')
100+
echo "${bootuuid} /boot ext2 errors=remount-ro 0 1" >> /etc/fstab
101+
mount /dev/vda2 /mnt
102+
cp -a /boot/* /mnt/
103+
sync; umount /mnt
104+
rm -rf /boot/*
105+
mount /dev/vda2 /boot
106+
grub-mkconfig -o /boot/grub/grub.cfg &>/dev/null
107+
grub-install --root-directory=/ --boot-directory=/boot /dev/vda &>/dev/null
108+
update-initramfs -u &>/dev/null
109+
}
110+
111+
if [ `mount | grep /boot | wc -l` -lt 1 ]; then
112+
echo "[ Setting up boot volume ]"; reclaimboot
113+
fi
114+
71115
vgroups=(`vgs | awk '{print $1}'`); vgroups=("${vgroups[@]:1}")
72116
lvols=(`lvs | awk '{print $1}'`); lvols=("${lvols[@]:1}")
73117
lvtarget=""

0 commit comments

Comments
 (0)