Manage LVM creation and format
This commit is contained in:
parent
d04ed9310b
commit
1f28586bbd
|
@ -33,5 +33,25 @@ if [ "${manage_part}" -eq 0 ]; then
|
||||||
sudo vgcreate "${vgname}" ${hdd}2
|
sudo vgcreate "${vgname}" ${hdd}2
|
||||||
fi
|
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
|
||||||
## }}}
|
## }}}
|
||||||
# }}}
|
# }}}
|
||||||
|
|
Loading…
Reference in New Issue