From 0bfec30ce601d0d31ff6f13ed2902e6656412eb2 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Fri, 24 Apr 2020 04:57:41 +0200 Subject: [PATCH] add better comand for expanding LVM (#1190) --- nextcloud_install_production.sh | 7 +++++++ static/temporary-fix.sh | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index a3b37ecf..40f5d6da 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -95,6 +95,13 @@ msg_box "Nextcloud repo is not available, exiting..." exit 1 fi +# Fix LVM on BASE image +if grep -q "LVM" /etc/fstab +then + # Resize LVM (live installer is &%¤%/! + lvextend -l 100%FREE --resizefs /dev/ubuntu-vg/ubuntu-lv +fi + # Check if it's a clean server stop_if_installed postgresql stop_if_installed apache2 diff --git a/static/temporary-fix.sh b/static/temporary-fix.sh index dba4baf5..e57937bf 100644 --- a/static/temporary-fix.sh +++ b/static/temporary-fix.sh @@ -16,8 +16,11 @@ debug_mode # Must be root root_check -# Resize LVM (somthing happened during installation) -lvresize /dev/ubuntu-vg/ubuntu-lv /dev/sda3 -resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv +# Fix LVM on BASE image +if grep -q "LVM" /etc/fstab +then + # Resize LVM (live installer is &%¤%/! + lvextend -l 100%FREE --resizefs /dev/ubuntu-vg/ubuntu-lv +fi exit