From 459c9fb8aa8d4cc0e65b2e2af3c13d628940772f Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 21 Oct 2020 14:17:58 +0200 Subject: [PATCH] Ensure to enable all LVM devices --- debian/chroot.mount | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/chroot.mount b/debian/chroot.mount index 90c7db2..014a7a0 100755 --- a/debian/chroot.mount +++ b/debian/chroot.mount @@ -22,7 +22,7 @@ fi ## Dependencies {{{ apt update -apt install aptitude btrfs-progs bzip2 cryptsetup debconf-i18n dialog dmsetup htop ipcalc isc-dhcp-client isc-dhcp-common locales lvm2 openssh-server pciutils tmux vim-nox wget zsh +apt install -y aptitude btrfs-progs bzip2 cryptsetup debconf-i18n dialog dmsetup htop ipcalc isc-dhcp-client isc-dhcp-common locales lvm2 openssh-server pciutils tmux vim-nox wget zsh ## }}} debug_message() { # {{{ @@ -36,8 +36,6 @@ debug_message() { # {{{ } # }}} -## Try to guess the VG name by using the last VG detected -vgname=$(vgdisplay --short | tail -n 1 | sed 's/.*"\(.*\)" .*/\1/') ## If the script should create extra volume (eg. backup, virt, Proxmox,…) manage_extra_lv=0 ## Is LUKS {{{ @@ -69,6 +67,15 @@ Try to open Luks on ${luks_pv_name} − ${hdd}2" fi fi ## }}} +## Enable LVM {{{ +### Ensure to enable LVM devices +pvscan --quiet > /dev/null +vgscan --quiet > /dev/null +vgchange --activate y --quiet > /dev/null + +## Try to guess the VG name by using the last VG detected +vgname=$(vgdisplay --short | tail -n 1 | sed 's/.*"\(.*\)" .*/\1/') +## }}} ## Is BTRFS {{{ root_fs_type=$(lsblk -f /dev/mapper/"${vgname}"-root | awk '/root/ { print $2 }') if [ "${root_fs_type}" = "btrfs" ]; then