You are not logged in.
I have read the article in the wiki and also this guide since my drives are encrypted. I have already set up arch on one drive with LVM on top of an encrypted volume (following the linked guide strictly with exceptions on the cipher and the partitioning). So far everything works very well but I'm only halfway where I want to end up. Additional to the one HDD I want to use two more, all of them encrypted (no problem here) and one logical volume spread across all three drives (problem be here).
So, to clarify, on /dev/sda I have two partitions, /boot (unencrypted, 130 MB) and /dev/sda2 (encrypted, ~2TB) on which the LVM volumes are.
/dev/sda2 is added to vgroup and has several logical volumes of which /home is the largest.
On the other hand I have /dev/sdb and /dev/sdc. Both should only contain one encrypted partition and extend /home. That is why I chose LVM in the first place.
I started with /dev/sdc since all the data on it has been backed up already. The entire drive is now one big encrypted partition called /dev/sdc1. I mounted it with sudo cryptsetup luksOpen /dev/sdc1 lvm. And here I am stuck.
1) First of all I'm not entirely clear on the last part "lvm" of that command, I initially thought it would be the name this partition would be mounted under but in the guide I took this from it is not explained and I want to be extra careful here because I have a lot of data on /dev/sda2 that is not backed up and I don't want to accidentally erase the logical volumes I already have.
2) I guess the next part would be creating a physical volume on the mounted partition via lvm pvcreate /dev/mapper/lvm but again I want to be extra clear on this, I really do not want to temper with the volumes I already have unless I know exactly what effects it will have. If I would mount the encrypted partition with sudo cryptsetup luksOpen /dev/sdc1 aaa would I then have to create the physical volume with lvm pvcreate /dev/mapper/aaa? Because I already used lvm when I created all the volumes on the first drive (sda) and I don't know if they are still mounted under the same name (after many reboots and setting up the arch which I am currently using) in which case I might be in danger of overwriting something?
3) From what I have read so far I could extend /home now with lvextend -l +100%FREE vgroup/home, is that correct? After that I would only have to extend the file system (ext4) on /home and it would be done?
I hope it is clear what I am trying to do, if not please do ask. Thanks in advance for reading all of this.
Offline
1) The name you choose there is just an identifier for device-mapper. So before that command you just had /dev/sdc1 which only gets recognized as crypted partition (see 'blkid' or 'lsblk'). After the cryptsetup you get /dev/mapper/lvm and on that you could deploy filesystems or an LVM PV. After 'cryptsetup luksClose lvm' the path vanishes and only the crypted LUKS partition remains.
2) Correct, you create PVs on the luksOpen'ed mappings. Then you add them to your existing VG. And after that you can simply extend the LV for you /home.
To sum it up, you got it all right. ;-)
Some useful commands for dealing with LVM/partitions/block devices: blkid, lsblk, findmnt, dmsetup, lvs/vgs/pvs
1000
Offline
Wonderful, it worked perfectly.
For those who have the same question and find this thread I should add that there is one step missing between 2) and 3): You have to add the logical volume to the volume group. In the case of the above example: sudo vgextend vgroup /dev/mapper/aaa.
Offline
Turns out this is not quite over yet. After successfully dealing with LVM I was about to reboot when something occurred to me: The second HDD (sdc1) will not be decrypted at boot and I have no idea what would happen if LVM tries to mount a volume that is spread across two disks of which one is not available.
So I searched for some time and everything I could find was this thread. Well, he is talking about altering the encrypt hook and generate a new initramfs to be able to enter more than one cryptdevice in grub. I have never dealt with hooks before and never got my hands on bash script like this. Now my options are pretty weak: I could do what he describes although I have no idea how it works or I could revert all the changes to LVM. Naturally I chose option number one, parsed the hook, edited the menu.lst, rebooted and "Waiting 10 seconds for device /dev/sda2".
So yeah it's my fault for trying something I have no clue about.
I tried to access the volumes from the live cd, but even though I decrypted the drives and loaded up lvm with vgchange -a -y I can not access the logical volumes. I naively tried to access the files such as menu.lst but I can't get there. Probably because I just lack the knowledge how to do that. But even if I would be able to access the files, could I build the hooks of my system from within the live cd?
Last edited by venehan_snakes (2011-10-18 16:49:48)
Offline
I'm sorry to bump this but it is kind of important to me as I currently can't even access the files that were on the sda.
Is a broken encrypt hook fixable with a live cd?
Offline