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