Replies: 1 comment
WARNING: only apply these steps to a new proxmox install. data will be overwritten.################################################ Ensure UEFI mode is enabledEnsure Secure Boot is enabledBoot into Proxmox ISO USB deviceInstall proxmox normally and reboot(OPTIONAL) edit the grub entry before installing and specify security-related kernel args (by pressing "e" key and moving cursor to end of "linux" line): "lockdown=integrity mitigations=auto random.trust_cpu=off random.trust_bootloader=off pti=on vsyscall=none page_poison=1 slub_debug=P audit=1 audit_backlog_limit=8192 init_on_free=1 crashkernel=no"for the hard disk advanced options, I used these sizes:total size: 20Gswap size: 1Gmaximum root volume size: 10Gmaximum data volume size: 1Gminimum free lvm space: 1GAfter reboot, unplug Proxmox ISO USB device################################################ login as root userCheck for internet accessping 9.9.9.9 If no internet set the network interfaces upip link Configure apt repositories to use no-subscription repositoriesvi /etc/apt/sources.list.d/* Update packagesapt update Install cryptsetup and cryptsetup-initramfs packagesapt install cryptsetup cryptsetup-initramfs -y reboot, but this time we will need to enter initramfs shellPrevent grub from automatically booting into normal install by holding down arrow key on keyboard################################################ Select the second option - "Advanced Options" on Grub screen with blue background, and press enterSelect the second option - "Recovery Mode" on Grub screen with black background, and press "e" to edit grub entrymove cursor to the end of the line that starts with "linux", and append these args: "rw break=premount"boot using your added args by pressing "CTRL+X"you will now be booted into "(initramfs)" shell################################################ Deactivate LVM logical volumesvgchange -an Find the LVM partition (in my case it was /dev/nvme0n1p3)blkid|grep -i lvm Encrypt the LVM partitioncryptsetup reencrypt --encrypt --reduce-device-size=32m --type=luks2 --pbkdf pbkdf2 --hash sha512 --iter-time 5000 /dev/nvme0n1p3 ################################################ Now the LVM partition has changed type to CRYPTO partitionblkid|grep -i crypto Save the UUID of the CRYPTO partition to a variableUUID="CHANGEME_TO_CRYPTO_PARTITION_UUID" Open the CRYPTO partition and map to /dev/mapper/luks-${UUID}cryptsetup open --type=luks2 /dev/nvme0n1p3 luks-${UUID} ################################################ Resize the LVM physical volume, because we had reduced the device size by 32m to fit the LUKS metadatalvm pvresize /dev/mapper/luks-${UUID} List the LVM physical volume, volume group, and logical volumeslvm pvs Activate the LVM logical volumesvgchange -ay ################################################ Create a temporary directory that we will use to chroot intomkdir /sysroot Mount the "root" logical volume to /sysrootmount /dev/mapper/pve-root /sysroot Find the efi partition (my case was /dev/nvme0n1p2), and mount it to /sysroot/boot/efiblkid|grep -i vfat Mount the virtual system resource directoriesmount -t sysfs /sys /sysroot/sys Change root into /sysrootchroot /sysroot ################################################ Edit the /etc/cryptttab file to make initramfs aware of our LUKS CRYPTO PARTITIONvi /etc/crypttab format of crypttab file is
luks-${UUID} UUID=${UUID} none luks Apply our /etc/crypttab changesupdate-initramfs -u -k all ################################################ Edit the default grub config so grub-mkconfig will generate the "grub.cfg" file with lines to load in the needed kernel modulesvi /etc/default/grub Add a new line under GRUB_CMDLINE_LINUX=""GRUB_ENABLE_CRYPTODISK=y Regenerate the Grub config filegrub-mkconfig -o /boot/efi/EFI/proxmox/grub.cfg ################################################ Now create the /dev/mapper/pve-data logical volumelvcreate -n data --size 6G pve ################################################ Exit out of chrootexit Exit out of initramfsexit reboot |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
https://youtu.be/pIjoSK1GmdY
All reactions