LVM and encrypted lvm - vgchange -ay needed everytime
I wanted to setup an encrypted lvm to mount at boot.
I had some empty space to play with at the end of a disk so I created a partition and marked it as 83 linux native. Not LVM, 8e. I had originally planned just to use a standard partition.. I'm not sure if this is the problem?
I have /etc/cryptab working and I also think fstab because if I do a mount -a after I've run the pvchange -ay the lvm mounts but until I do that I only have the lvm setup when I did my basic install.
Why can I only get the LV to mount after I have manually activated it.. or maybe the question should be how can I mark it as permanently activated? ..so I dont have to do the pvchange -ay ?
Thanks
Below are the steps I did
cryptsetup luksFormat /dev/sda3
cryptsetup luksOpen /dev/sda3 secure_luks
pvcreate /dev/mapper/secure_luks
vgcreate testing_vg /dev/mapper/secure_luks
lvcreate -n secure -L +999G testing_vg
mkfs.ext4 /dev/mapper/testing_vg-secure
mount /dev/mapper/testing_vg-secure /mnt/secure/
[root@gx ~]# cat /etc/crypttab
secure_luks /dev/sda3 /home/someguy/20140419s135223658.jpg
snip from /etc/fstab
/dev/mapper/testing_vg-secure /mnt/secure ext4 defaults 0 0
[root@gx ~]# mount -a
mount: special device /dev/mapper/testing_vg-secure does not exist
[root@gx ~]# lvscan
inactive '/dev/testing_vg/secure' [999.00 GiB] inherit
ACTIVE '/dev/vg_gx/lv_root' [195.31 GiB] inherit
ACTIVE '/dev/vg_gx/lv_home' [285.15 GiB] inherit
ACTIVE '/dev/vg_gx/lv_swap' [7.81 GiB] inherit
[root@gx ~]# vgchange -ay
1 logical volume(s) in volume group "testing_vg" now active
3 logical volume(s) in volume group "vg_gx" now active
[root@gx ~]# mount -a
[root@gx ~]# ls /mnt/secure/
lost+found
|