Remove Encrypted Swap Partition

Hello, I just did a new install of EndeavourOS with an encrypted root, home, and swap partition. I have to enter my encryption password twice (once for root, and once for swap), so I’m hoping to remove my swap partition and use a swapfile instead to circumvent that.

I have already created a swapfile and have tried to stop the loading of the swap partition, but on boot I am still prompted for the password. (I have not removed the partition fully yet)

Below is information of what I’ve tried to do. I have commented out the swap partition in fstab and crypttab, and have tried removing it from cmdline. I’m using systemd-boot.

$ swapon --show
NAME      TYPE SIZE USED PRIO
/swapfile file   4G   0B   -2

$ cat /etc/fstab
# <name>               <device>                         <password> <options>
luks-cdfbb45a-7b42-48d1-a6c8-fbc420df94d5 UUID=cdfbb45a-7b42-48d1-a6c8-fbc420df94d5     none luks
# luks-f34112a4-bbd5-4b5e-b0d4-20707ba6952b UUID=f34112a4-bbd5-4b5e-b0d4-20707ba6952b     none luks
luks-d64336f4-7004-462b-bac0-159ebac3ab2d UUID=d64336f4-7004-462b-bac0-159ebac3ab2d     none luks

$ sudo cat /etc/crypttab
# <name>               <device>                         <password> <options>
luks-cdfbb45a-7b42-48d1-a6c8-fbc420df94d5 UUID=cdfbb45a-7b42-48d1-a6c8-fbc420df94d5     none luks
# luks-f34112a4-bbd5-4b5e-b0d4-20707ba6952b UUID=f34112a4-bbd5-4b5e-b0d4-20707ba6952b     none luks
luks-d64336f4-7004-462b-bac0-159ebac3ab2d UUID=d64336f4-7004-462b-bac0-159ebac3ab2d     none luks

$ cat /etc/kernel/cmdline
nvme_load=YES nowatchdog rw rd.luks.uuid=cdfbb45a-7b42-48d1-a6c8-fbc420df94d5 root=/dev/mapper/luks-cdfbb45a-7b42-48d1-a6c8-fbc420df94d5 nvidia-drm.modeset=1

The cmdline used to be:

nvme_load=YES nowatchdog rw rd.luks.uuid=cdfbb45a-7b42-48d1-a6c8-fbc420df94d5 root=/dev/mapper/luks-cdfbb45a-7b42-48d1-a6c8-fbc420df94d5 rd.luks.uuid=f34112a4-bbd5-4b5e-b0d4-20707ba6952b resume=/dev/mapper/luks-f34112a4-bbd5-4b5e-b0d4-20707ba6952b nvidia-drm.modeset=1

Is there anything I’m missing to prevent the system from trying to load the partition?

Thanks!

After changing cryptab, fstab and /etc/kernel/cmdline, you need to run sudo reinstall-kernels

Ah, I feel dumb. Thanks! That did the trick.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.