diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index ba54a07e..b814c446 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -63,6 +63,38 @@ fi # Restart mode: (l)ist only, (i)nteractive or (a)utomatically. sed -i "s|#\$nrconf{restart} = .*|\$nrconf{restart} = 'a';|g" /etc/needrestart/needrestart.conf +# Fix LVM on BASE image +if grep -q "LVM" /etc/fstab +then + if [ -n "$PROVISIONING" ] || yesno_box_yes "Do you want to make all free space available to your root partition?" + then + # Resize LVM (live installer is &%¤%/! + # VM + print_text_in_color "$ICyan" "Extending LVM, this may take a long time..." + lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv + + # Run it again manually just to be sure it's done + while : + do + lvdisplay | grep "Size" | awk '{print $3}' + if ! lvextend -L +10G /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + then + if ! lvextend -L +1G /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + then + if ! lvextend -L +100M /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + then + if ! lvextend -L +1M /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + then + resize2fs /dev/ubuntu-vg/ubuntu-lv + break + fi + fi + fi + fi + done + fi +fi + # Install needed dependencies install_if_not lshw install_if_not net-tools @@ -156,38 +188,6 @@ else sleep 3 fi -# Fix LVM on BASE image -if grep -q "LVM" /etc/fstab -then - if [ -n "$PROVISIONING" ] || yesno_box_yes "Do you want to make all free space available to your root partition?" - then - # Resize LVM (live installer is &%¤%/! - # VM - print_text_in_color "$ICyan" "Extending LVM, this may take a long time..." - lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv - - # Run it again manually just to be sure it's done - while : - do - lvdisplay | grep "Size" | awk '{print $3}' - if ! lvextend -L +10G /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 - then - if ! lvextend -L +1G /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 - then - if ! lvextend -L +100M /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 - then - if ! lvextend -L +1M /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 - then - resize2fs /dev/ubuntu-vg/ubuntu-lv - break - fi - fi - fi - fi - done - fi -fi - # Check if it's a clean server stop_if_installed postgresql stop_if_installed apache2