- Install Ubuntu 13.10 on top of encrypted lvm by Janne Haapsaari
- HOWTO: install and reinstall on an encrypted LUKS/LVM system on UbuntuForums
Last active
May 31, 2018 09:27
-
-
Save edouard-lopez/00aa05913dbb473cb64b to your computer and use it in GitHub Desktop.
reinstalling LVM+LUKS on Ubuntu 14.10 -> http://joh.fi/ubuntu/encryption/lvm/cryptsetup/2014/03/18/ubuntu-13.10-encrypted-lvm-installation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo cryptsetup luksOpen /dev/sda5 luks_container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo lvdisplay | |
--- Logical volume --- | |
LV Path /dev/mint-vg/root | |
LV Name root | |
VG Name mint-vg | |
LV UUID ZXld2t-7wOU-Vw5p-4h4Q-w8is-yhCf-z7hLX2 | |
LV Write Access read/write | |
LV Creation host, time mint, 2014-05-22 00:01:06 +0000 | |
LV Status available | |
# open 0 | |
LV Size 8.55 GiB | |
Current LE 2188 | |
Segments 3 | |
Allocation inherit | |
Read ahead sectors auto | |
- currently set to 256 | |
Block device 252:1 | |
--- Logical volume --- | |
LV Path /dev/mint-vg/home | |
LV Name home | |
VG Name mint-vg | |
LV UUID 89jWuf-uKik-4JDF-BJUp-GbyM-UPje-WyotAG | |
LV Write Access read/write | |
LV Creation host, time mint, 2014-05-22 00:53:52 +0000 | |
LV Status available | |
# open 0 | |
LV Size 2.00 GiB | |
Current LE 512 | |
Segments 1 | |
Allocation inherit | |
Read ahead sectors auto | |
- currently set to 256 | |
Block device 252:2 | |
--- Logical volume --- | |
LV Path /dev/mint-vg/data | |
LV Name data | |
VG Name mint-vg | |
LV UUID 1P2oWP-WEmN-2tKD-wkfh-GAlC-iCWv-XPTL3b | |
LV Write Access read/write | |
LV Creation host, time mint, 2014-05-22 00:55:13 +0000 | |
LV Status available | |
# open 0 | |
LV Size 100.00 GiB | |
Current LE 25600 | |
Segments 1 | |
Allocation inherit | |
Read ahead sectors auto | |
- currently set to 256 | |
Block device 252:3 | |
--- Logical volume --- | |
LV Path /dev/mint-vg/swap | |
LV Name swap | |
VG Name mint-vg | |
LV UUID HfQVJv-giT3-81W1-JJdY-kM4l-19uI-DVAlIX | |
LV Write Access read/write | |
LV Creation host, time mint, 2014-05-31 19:47:33 +0000 | |
LV Status available | |
# open 0 | |
LV Size 1.00 GiB | |
Current LE 256 | |
Segments 1 | |
Allocation inherit | |
Read ahead sectors auto | |
- currently set to 256 | |
Block device 252:4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo blkid /dev/sda5 | |
# /dev/sda5: UUID="db83deac-8302-47f0-804b-fb2b95f2b8fc" TYPE="crypto_LUKS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.webupd8.org/2014/01/how-to-fix-non-bootable-ubuntu-system.html | |
sudo mkdir /mnt/ | |
sudo mount /dev/mint-vg/root /mnt | |
# # # following command is CRITICAL! Otherwise you won't edit the correct config file | |
sudo mount /dev/sda1 /mnt/boot | |
# ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ | |
sudo mount /dev/mint-vg/home /mnt/home | |
for p in /sys /proc /run /dev /dev/pts; do sudo mount --bind "$p" "/mnt$p"; done | |
sudo cp /etc/resolv.conf /mnt/etc/ | |
sudo chroot /mnt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create: nano /etc/crypttab | |
# <target name> <source device> <key file> <options> | |
luks_container UUID=db83deac-8302-47f0-804b-fb2b95f2b8fc none luks,retry=1,lvm=mint-vg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create: nano /etc/initramfs-tools/conf.d/cryptroot | |
#CRYPTROOT=target=luks_container,source=/dev/disk/by-uuid/db83deac-8302-47f0-804b-fb2b95f2b8fc | |
CRYPTROOT=target=luks_container,source=/dev/disk/by-uuid/db83deac-8302-47f0-804b-fb2b95f2b8fc,lvm=mint-vg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see http://ubuntuforums.org/showthread.php?t=2222993 | |
# in /etc/initramfs-tools/modules add f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update-initramfs -k all -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set GRUB_CMDLINE_LINUX in : nano /etc/default/grub | |
GRUB_CMDLINE_LINUX="cryptopts=target=luks_container,source=/dev/disk/by-uuid/db83deac-8302-47f0-804b-fb2b95f2b8fc,lvm=mint-vg" | |
# or try (working on Linux Mint 17.2) | |
GRUB_CMDLINE_LINUX="cryptopts=target=luks_system,source=/dev/disk/by-uuid/db83deac-8302-47f0-804b-fb2b95f2b8fc,lvm=mint-vg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update-grub | |
# if you got the following error, try: | |
# /usr/sbin/grub-mkconfig: 250: /usr/sbin/grub-mkconfig: cannot create /boot/grub/grub.cfg.new: Directory nonexistent | |
grub-install /dev/sda; update-grub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you got trouble with grub try re-creating the grub.cfg file, | |
# see http://edoceo.com/notabene/grub-probe-error-cannot-find-device-for-root | |
sh -x /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want mark ubuntu 15.10 doesn't support partitioned lvm with swap, because graphic installator crash. I recommend use ubuntu 14.04.3 ( http://releases.ubuntu.com/14.04.3/ ) and upgrade.