diff --git a/debian/chroot.install b/debian/chroot.install index b00e4d8..a936bcf 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -17,6 +17,8 @@ vgname="ovhsys" manage_part=0 ## If the script should use BTRFS manage_btrfs=1 +## If the script should create extra volume (eg. backup, virt, Proxmox,…) +manage_extra_lv=0 ## Colors definition {{{ BLACK='\033[49;30m' BLACKB='\033[49;90m' @@ -79,8 +81,10 @@ else [ ! -b /dev/mapper/"${vgname}"-var ] && lvcreate -n var -L 10g "${vgname}" fi ### Create extra LVs -[ ! -b /dev/mapper/"${vgname}"-vz ] && lvcreate -n vz -L 150g "${vgname}" -[ ! -b /dev/mapper/"${vgname}"-bkp ] && lvcreate -n bkp -L 150g "${vgname}" +if [ "${manage_extra_lv}" -eq 0 ]; then + [ ! -b /dev/mapper/"${vgname}"-vz ] && lvcreate -n vz -L 150g "${vgname}" + [ ! -b /dev/mapper/"${vgname}"-bkp ] && lvcreate -n bkp -L 150g "${vgname}" +fi [ ! -b /dev/mapper/"${vgname}"-swap ] && lvcreate -n swap -L 2g "${vgname}" ### Format LVs in ext4 @@ -147,14 +151,16 @@ else ### Or for ext4, create mountpoint and mount LV printf '%b\n' "/dev/mapper/${vgname}-var /var ext4 defaults 0 0" >> /tmp/target.fstab fi -### Extra bkp LV -mkdir -p -- /target/srv/backup -mountpoint -q /target/srv/backup || mount -- /dev/mapper/"${vgname}"-bkp /target/srv/backup -printf '%b\n' "/dev/mapper/${vgname}-bkp /srv/backup ext4 defaults 0 0" >> /tmp/target.fstab -### Extra vz LV -mkdir -p -- /target/var/lib/vz -mountpoint -q /target/var/lib/vz || mount -- /dev/mapper/"${vgname}"-vz /target/var/lib/vz -printf '%b\n' "/dev/mapper/${vgname}-vz /var/lib/vz ext4 defaults 0 0" >> /tmp/target.fstab +if [ "${manage_extra_lv}" -eq 0 ]; then + ### Extra bkp LV + mkdir -p -- /target/srv/backup + mountpoint -q /target/srv/backup || mount -- /dev/mapper/"${vgname}"-bkp /target/srv/backup + printf '%b\n' "/dev/mapper/${vgname}-bkp /srv/backup ext4 defaults 0 0" >> /tmp/target.fstab + ### Extra vz LV + mkdir -p -- /target/var/lib/vz + mountpoint -q /target/var/lib/vz || mount -- /dev/mapper/"${vgname}"-vz /target/var/lib/vz + printf '%b\n' "/dev/mapper/${vgname}-vz /var/lib/vz ext4 defaults 0 0" >> /tmp/target.fstab +fi ### Swap swapon -- /dev/mapper/"${vgname}"-swap