Ensure to enable all LVM devices

This commit is contained in:
gardouille 2020-10-21 14:17:58 +02:00
parent c9473c6cdf
commit 459c9fb8aa
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 10 additions and 3 deletions

13
debian/chroot.mount vendored
View File

@ -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