in Linux

partition encryption in LVM

Tested the partition encryption of LVM in RHEL6

1, vgs -report information about volume group

2, lvs-report the information about logical volumes

3, create the logic volume, size 100M

 lvcreate -n lv_lockbox -L 100M vgsrv

4, format the logic volume just created

mkfs.ext4 /dev/vgsrv/lv_lockbox

5, create the mount point

mkdir /mnt/lockbox

6, for security reasons, dump random data to the logic volume created

cat  /dev/urandom > /dev/vgsrv/lv_lockbox

7, create the encryption partition based on step 4, here needs to input the passphrase.

cryptsetup luksFormat /dev/vgsrv/lv_lockbox

8, luksOpen the logic volume to lockbox, here needs to input the passphrase setup earlier.

cryptsetup luksOpen /dev/vgsrv/lv_lockbox lockbox

9, create file system based on the luksOpen lockbox

mkfs.ext4 /dev/mapper/lockbox

10, mount the lockbox to /mnt/lockbox

mount /dev/mapper/lockbox /mnt/lockbox/

11, copy files to /mnt/lockbox for testing,

cp /etc/services /mnt/lockbox

12, grep http /mnt/lockbox/services

Write a Comment

Comment