2020-06-24 08:37:26 +02:00
|
|
|
# disable encrypt swap partition
|
|
|
|
|
|
|
|
## prerequisite
|
|
|
|
|
|
|
|
* This setup is based on [encrypt swap partition](./encrypt-swap-Ubuntu-20.04)
|
|
|
|
* all command bellow are run has root
|
|
|
|
|
|
|
|
## disable encrypt swap partition
|
|
|
|
|
|
|
|
* Turn off swap
|
|
|
|
|
|
|
|
~~~
|
2020-06-24 09:41:53 +02:00
|
|
|
root@laptop:/root# swapoff /dev/mapper/cryptswap
|
2020-06-24 08:37:26 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
* Undo the existing mapping.
|
|
|
|
|
|
|
|
~~~
|
2020-06-24 09:41:53 +02:00
|
|
|
root@laptop:/root# cryptsetup luksClose /dev/mapper/cryptswap
|
2020-06-24 08:37:26 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
* remove your encrypt swap device define in your **/etc/crypttab**
|
|
|
|
|
|
|
|
* ajust **/etc/fstab** to use your real swap partition
|
|
|
|
|
|
|
|
~~~
|
|
|
|
/dev/nvme0n1p2 none swap discard 0 0
|
|
|
|
~~~
|
|
|
|
|
|
|
|
* make your partition a swap
|
|
|
|
|
|
|
|
~~~
|
2020-06-24 09:41:53 +02:00
|
|
|
root@laptop:/root# mkswap /dev/nvme0n1p2
|
2020-06-24 08:37:26 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
* activate swap
|
|
|
|
|
|
|
|
~~~
|
2020-06-24 09:41:53 +02:00
|
|
|
root@laptop:/root# swapon -a
|
2020-06-24 08:37:26 +02:00
|
|
|
~~~
|
|
|
|
|
2020-06-24 09:37:05 +02:00
|
|
|
* remove file */etc/initramfs-tools/conf.d/resume*
|
2020-06-24 08:37:26 +02:00
|
|
|
|
|
|
|
~~~
|
2020-06-24 09:41:53 +02:00
|
|
|
root@laptop:/root# rm /etc/initramfs-tools/conf.d/resume
|
2020-06-24 08:37:26 +02:00
|
|
|
~~~
|
|
|
|
|
2020-06-24 09:37:05 +02:00
|
|
|
Register these changes.
|
|
|
|
|
2020-06-24 09:37:38 +02:00
|
|
|
~~~{bash}
|
2020-06-24 09:37:05 +02:00
|
|
|
root@laptop:/root# update-initramfs -u -k all
|
|
|
|
update-initramfs: Generating /boot/initrd.img-5.4.0-37-generic
|
|
|
|
cryptsetup: ERROR: Couldn't resolve device rpool/ROOT/ubuntu_0ctpm6
|
|
|
|
cryptsetup: WARNING: Couldn't determine root device
|
|
|
|
I: The initramfs will attempt to resume from /dev/nvme0n1p2
|
|
|
|
I: (UUID=09c1daa8-a572-41b9-8655-c38ea7778723)
|
|
|
|
I: Set the RESUME variable to override this.
|
|
|
|
root@laptop:/root#
|
2020-06-24 08:37:26 +02:00
|
|
|
~~~
|
|
|
|
|
2020-06-24 09:37:05 +02:00
|
|
|
* Change your /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT to point to your real partition
|
2020-06-24 08:37:26 +02:00
|
|
|
|
|
|
|
~~~
|
2020-06-24 09:41:00 +02:00
|
|
|
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=09c1daa8-a572-41b9-8655-c38ea7778723"
|
2020-06-24 08:37:26 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
~~~
|
2020-06-24 09:41:53 +02:00
|
|
|
root@laptop:/root# update-grub
|
2020-06-24 08:37:26 +02:00
|
|
|
~~~
|
|
|
|
|
|
|
|
Next you need to reboot to enable everything and test it.
|