Manage LVM creation and format

This commit is contained in:
Jeremy Gardais 2019-04-02 18:37:01 +02:00
parent d04ed9310b
commit 1f28586bbd
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 20 additions and 0 deletions

20
debian/chroot.install vendored
View File

@ -33,5 +33,25 @@ if [ "${manage_part}" -eq 0 ]; then
sudo vgcreate "${vgname}" ${hdd}2
fi
## }}}
## Create Logical Volumes {{{
[ ! -b /dev/mapper/"${vgname}"-home ] && lvcreate -n home -L 20g "${vgname}"
[ ! -b /dev/mapper/"${vgname}"-opt ] && lvcreate -n opt -L 2g "${vgname}"
[ ! -b /dev/mapper/"${vgname}"-root ] && lvcreate -n root -L 5g "${vgname}"
[ ! -b /dev/mapper/"${vgname}"-srv ] && lvcreate -n srv -L 2g "${vgname}"
[ ! -b /dev/mapper/"${vgname}"-tmp ] && lvcreate -n tmp -L 10g "${vgname}"
[ ! -b /dev/mapper/"${vgname}"-usr ] && lvcreate -n usr -L 15g "${vgname}"
[ ! -b /dev/mapper/"${vgname}"-var ] && lvcreate -n var -L 10g "${vgname}"
[ ! -b /dev/mapper/"${vgname}"-vz ] && lvcreate -n vz -L 150g "${vgname}"
[ ! -b /dev/mapper/"${vgname}"-bkp ] && lvcreate -n bkp -L 150g "${vgname}"
[ ! -b /dev/mapper/"${vgname}"-swap ] && lvcreate -n swap -L 2g "${vgname}"
### Format the LV in ext4
for lvname in /dev/mapper/"${vgname}"-*; do
mkfs.ext4 "${lvname}"
done
### And format the swap
mkswap /dev/mapper/"${vgname}"-swap
## }}}
# }}}