.. -*- mode rst -*-
===============
howto lvm2 + luks
===============
:author: OSiRiS <osiux@osiux.com.ar>
fdisk
::
fdisk /dev/sdb
dd –
::
dd if=/dev/urandom of=/dev/sdb
install
::
apt-get install cryptsetup lvm2 dmsetup
pvcreate
::
pvcreate /dev/sdb
vgcreate
::
vgcreate vg_bacoop /dev/sdb
users
::
echo "hugo lukio pablo alecu jose osiris" >/root/bacoop.txt for i in $(cat /root/bacoop.txt);do mkdir /bacoop/$i;done
lvcreate
::
lvcreate -L250G -n lv1_osiris vg_bacoop lvcreate -L250G -n lv2_jose vg_bacoop lvcreate -L250G -n lv3_alecu vg_bacoop lvcreate -L250G -n lv4_pablo vg_bacoop lvcreate -L250G -n lv5_lukio vg_bacoop
lvresize
::
lvresize -L-18G /dev/mapper/vg_bacoop-lv1_osiris lvresize -L-18G /dev/mapper/vg_bacoop-lv2_jose lvresize -L-18G /dev/mapper/vg_bacoop-lv3_alecu lvresize -L-18G /dev/mapper/vg_bacoop-lv4_pablo lvresize -L-18G /dev/mapper/vg_bacoop-lv5_lukio lvcreate -L232G -n lv6_hugo vg_bacoop
pvscan
::
File descriptor 4 left open PV /dev/sdb VG vg_bacoop lvm2 [1,36 TB / 5,26 GB free] Total: 1 [1,36 TB] / in use: 1 [1,36 TB] / in no VG: 0 [0 ]
lvscan
::
File descriptor 4 left open ACTIVE '/dev/vg_bacoop/lv1_osiris' [232,00 GB] inherit ACTIVE '/dev/vg_bacoop/lv2_jose' [232,00 GB] inherit ACTIVE '/dev/vg_bacoop/lv3_alecu' [232,00 GB] inherit ACTIVE '/dev/vg_bacoop/lv4_pablo' [232,00 GB] inherit ACTIVE '/dev/vg_bacoop/lv5_lukio' [232,00 GB] inherit ACTIVE '/dev/vg_bacoop/lv6_hugo' [232,00 GB] inherit
cryptsetup
::
cryptsetup luksFormat /dev/vg_bacoop/lv1_osiris cryptsetup luksOpen /dev/vg_bacoop/lv1_osiris osiris
mkfs -—
::
mkfs.ext3 -L osiris /dev/mapper/osiris
mount
::
mount dev/mapper/osiris /bacoop/osiris
df –
::
S.ficheros TamaƱo Usado Disp Uso% Montado en /dev/mapper/osiris 229G 22G 196G 10% /bacoop/osiris
references
- http://es.wikipedia.org/wiki/Logical_Volume_Manager
- http://www.debian-administration.org/articles/410
- http://www.debuntu.org/how-to-encrypted-partitions-over-lvm-with-luks-page-3-install-and-config
- http://blog.pioto.org/2009/02/disk-encryption-w-dm-crypt-luks-and-lvm2-part-3.html
- http://www.radioprosciutto.com/node/7