Quantcast
Channel: Active questions tagged 22.04 - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4421

Installing Ubuntu 22.04 with full disk encryption (LUKS) and swap partitions

$
0
0

I`m just trying to install Ubuntu 22.04 in my notebook, but I need to have full disk encryption enabled and I would like to define the size of my swap partition.

When searching for answers I saw multiple mentions that Ubuntu 22 doesn`t need a swap partition, because it would use swapfile. However If I proceed with the default installation (plus enabling FDE) I get a swap partition anyway:

nvme0n1               259:0    0 238.5G  0 disk  ├─nvme0n1p1           259:1    0   512M  0 part  ├─nvme0n1p2           259:2    0   1.7G  0 part  └─nvme0n1p3           259:3    0 236.3G  0 part  └─crypt             253:0    0 236.3G  0 crypt ├─vgubuntu-root   253:1    0 234.4G  0 lvm   └─vgubuntu-swap_1 253:2    0   1.9G  0 lvm   

So I went for a new install following these tutorials: (They are mostly the same)

  1. https://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019
  2. https://www.tecmint.com/encrypt-disk-installing-ubuntu/

Note: Its a nvme notebook

Following the tutorial,I ran command for command with no error, but got a warning when partitioning:

Warning: The kernel is still using the old partition table.The new table will be used at the next reboot or after yourun partprobe(8) or kpartx(8)

The sgdisk --print $DEV returns as expected:

Number  Start (sector)    End (sector)  Size       Code  Name   1            2048         1574911   768.0 MiB   8301  /boot   2         1574912         1579007   2.0 MiB     EF02  GRUB   3         1579008         1841151   128.0 MiB   EF00  EFI-SP   5         1841152       500118158   237.6 GiB   8301  rootfs

However when I get to the point of using LUKS, the first time it works as expected, but the second command fails:This command works:

cryptsetup luksFormat --type=luks1 ${DEVP}1 

And then this command fails:

# cryptsetup luksFormat --type=luks1 ${DEVP}5Device /dev/nvme0n1p5 does not exist or access denied.

I`ve also tried like this:

# cryptsetup luksFormat ${DEVP}5Device /dev/nvme0n1p5 does not exist or access denied.

Because that is a difference between both tutorials so far...I`m on a live boot from USB.

How can I encrypt the last partition so I can continue on?

OR how can I achieve the Ubuntu 22 install + LUKS FDE + Custom SWAP?


Viewing all articles
Browse latest Browse all 4421

Trending Articles