зеркало из https://github.com/Azure/ARO-RP.git
Update CI VMSS CSE script to resize LVM partition
This commit is contained in:
Родитель
1b084e8b49
Коммит
708e67a372
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -316,6 +316,37 @@ for attempt in {1..5}; do
|
|||
if [[ ${attempt} -lt 5 ]]; then sleep 10; else exit 1; fi
|
||||
done
|
||||
|
||||
DEVICE_PARTITION=$(pvs | grep '/dev/' | awk '{print $1}' | grep -oP '[a-z]{3}[0-9]$')
|
||||
DEVICE=$(echo $DEVICE_PARTITION | grep -oP '^[a-z]{3}')
|
||||
PARTITION=$(echo $DEVICE_PARTITION | grep -oP '[0-9]$')
|
||||
|
||||
# Fix the "GPT PMBR size mismatch (134217727 != 268435455)"
|
||||
echo "w" | fdisk /dev/${DEVICE}
|
||||
|
||||
# Steps from https://access.redhat.com/solutions/5808001
|
||||
# 1. Delete the LVM partition "d\n2\n"
|
||||
# 2. Recreate the partition "n\n2\n"
|
||||
# 3. Accept the default start and end sectors (2 x \n)
|
||||
# 4. LVM2_member signature remains by default
|
||||
# 5. Change type to Linux LVM "t\n2\n31\n
|
||||
# 6. Write new table "w\n"
|
||||
|
||||
fdisk /dev/${DEVICE} <<EOF
|
||||
d
|
||||
${PARTITION}
|
||||
n
|
||||
${PARTITION}
|
||||
|
||||
|
||||
t
|
||||
${PARTITION}
|
||||
31
|
||||
w
|
||||
EOF
|
||||
|
||||
partx -u /dev/${DEVICE}
|
||||
pvresize /dev/${DEVICE_PARTITION}
|
||||
|
||||
lvextend -l +50%FREE /dev/rootvg/homelv
|
||||
xfs_growfs /home
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче