More SWAP to LUKS?

lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 4K 1 loop /snap/bare/5
loop1 7:1 0 373.8M 1 loop /snap/anbox/186
loop2 7:2 0 105.4M 1 loop /snap/core/16574
loop3 7:3 0 104M 1 loop /snap/core/16928
loop4 7:4 0 63.9M 1 loop /snap/core20/2182
loop5 7:5 0 63.9M 1 loop /snap/core20/2264
loop6 7:6 0 74.1M 1 loop /snap/core22/1033
loop7 7:7 0 74.2M 1 loop /snap/core22/1122
loop8 7:8 0 267.5M 1 loop /snap/firefox/3941
loop9 7:9 0 268.3M 1 loop /snap/firefox/4090
loop10 7:10 0 349.7M 1 loop /snap/gnome-3-38-2004/140
loop11 7:11 0 349.7M 1 loop /snap/gnome-3-38-2004/143
loop12 7:12 0 497M 1 loop /snap/gnome-42-2204/141
loop13 7:13 0 504.2M 1 loop /snap/gnome-42-2204/172
loop14 7:14 0 91.7M 1 loop /snap/gtk-common-themes/1535
loop15 7:15 0 103.2M 1 loop /snap/pac-vs/1
loop16 7:16 0 147M 1 loop /snap/shotcut/1389
loop17 7:17 0 40.4M 1 loop /snap/snapd/20671
loop18 7:18 0 39.1M 1 loop /snap/snapd/21184
loop19 7:19 0 417.9M 1 loop /snap/telegram-desktop/5783
loop20 7:20 0 417.9M 1 loop /snap/telegram-desktop/5791
loop21 7:21 0 310.8M 1 loop
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 1.7G 0 part /boot
└─nvme0n1p3 259:3 0 951.7G 0 part
└─nvme0n1p3_crypt 252:0 0 951.7G 0 crypt
├─vgkubuntu-root 252:1 0 929.4G 0 lvm /var/snap/firefox/common/host-hunspell
│ /
└─vgkubuntu-swap_1 252:2 0 1.9G 0 lvm [SWAP]

Filesystem Size Used Avail Use% Mounted on
tmpfs 1.6G 2.6M 1.6G 1% /run
/dev/mapper/vgkubuntu-root 914G 325G 543G 38% /
tmpfs 7.7G 298M 7.4G 4% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
efivarfs 246K 108K 134K 45% /sys/firmware/efi/efivars
/dev/nvme0n1p2 1.7G 301M 1.3G 20% /boot
/dev/nvme0n1p1 511M 6.1M 505M 2% /boot/efi
tmpfs 1.6G 108K 1.6G 1% /run/user/1000

how to make a swap bigger on luks?
by default it is only 2 GB

Based on the data you have provided you should have still some space available approx 20GB to expand you swap partition.

Before you begin, even though this is a quite routine operation I would suggest to backup important data in case anything goes wrong.

Next, run the command:

$ sudo vgs

Here is output of vgs command with 0 free available:

  VG    #PV #LV #SN Attr   VSize VFree
  xr-vg   1   2   0 wz--n- 1.72t    0

Check yours VFree value. It should not have be 0 :slight_smile:

Check the value of the VFree to confirm that you have enough space to expand. If you have enough space to expand here is the procedure how to expand you swap partition to 8GB

Disable your current swap:
$ sudo swapoff /dev/mapper/vgkubuntu-swap_1

Expand to 8GB:

$ sudo lvresize -L 8G /dev/vgkubuntu/vgkubuntu-swap_1

Reformat the new swap space:

$ sudo mkswap /dev/mapper/vgkubuntu-swap_1

Enable the new swap:

$ sudo swapon /dev/mapper/vgkubuntu-swap_1

Check the new swapt size:

$ sudo swapon --show

Hope this helps…

Lubos