My swap partition is only 2GB (I didn’t check to expand during install), and I want to expand it. I have 16GB of RAM.
Edited to add: I have full disk encryption with LUKS
I’ve had some system slowdown with kswapd0 using a lot of CPU when swap is full. Maybe it was because almost all the free RAM was cached. I don’t know much about this.
output of fdisk -l at bottom.
I have some questions about what is smart to do:
- Use yast partitioner? If yes, would I first have to shrink root, then expand swap? Can I do this on the fly? Can I rollback with snapper if something fails at reboot?
- Use gparted or some other tool?
- Use a swapfile and add it do fstab? If yes, could I then delete the swap partition? Is there any specific place swapfiles should be placed?
- Should I change system swappiness?
- Should swap size match RAM size?
Thanks for any help.
fdisk -l
**Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors**
Disk model: PC SN730 NVMe WDC 512GB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
**Device**** Start**** End**** Sectors**** Size****Type**
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 1000215182 999164559 476.4G Linux LVM
**Disk /dev/mapper/cr_nvme-PC_SN730_NVMe_WDC_512GB_210524802564-part2: 476.44 GiB, 511570157056 bytes, 999160463 sectors**
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
**Disk /dev/mapper/system-root: 474.43 GiB, 509419192320 bytes, 994959360 sectors**
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
**Disk /dev/mapper/system-swap: 2 GiB, 2147483648 bytes, 4194304 sectors**
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes