I would like to add a few gigabytes to my swap partition. Is it feasible because of the encryption?
Have tested with gparted from a USB stick, and everything is greyed out: I can't resize the partition, even when the LUKS-password is entered.
I guess there are several options:
1. Find a solution to resize the partition and expand the swap partition. (Would be optimal)
2. Make a swap file and disable the swap partition. (Wasted space if I can't expand the LUKS-partition.)
3. Back up my data and reinstall. (PITA.)
Am I missing something here? Any advice?
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
LUKS encryption - increase swap size
- Hallvor
- Global Moderator
- Posts: 2042
- Joined: 2009-04-16 18:35
- Location: Kristiansand, Norway
- Has thanked: 149 times
- Been thanked: 212 times
LUKS encryption - increase swap size
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: LUKS encryption - increase swap size
3) You can use any other program (parted, fdisk, sfdisk...) to extend a partition, provided that you move only its end and there is available disk space on this side.
The encrypted volume will automatically extend to the new size the next time it is opened, or you can extend it while opened with "cryptsetup resize <name>". Then you will have to recreate the swap area with mkswap to extend it to the new size.
Alternatively, you can create a new encrypted swap area anywhere in the free disk space and add it to /etc/crypttab and /etc/fstab.
2) Swap files suck.
The encrypted volume will automatically extend to the new size the next time it is opened, or you can extend it while opened with "cryptsetup resize <name>". Then you will have to recreate the swap area with mkswap to extend it to the new size.
Alternatively, you can create a new encrypted swap area anywhere in the free disk space and add it to /etc/crypttab and /etc/fstab.
2) Swap files suck.
- Hallvor
- Global Moderator
- Posts: 2042
- Joined: 2009-04-16 18:35
- Location: Kristiansand, Norway
- Has thanked: 149 times
- Been thanked: 212 times
Re: LUKS encryption - increase swap size
Having thought this through, I won't risk hosing this install. I'll just stop hibernating the computer for now, and everything should work fine until I decide to reinstall some time in the future.
Thanks for your time and advice. Much obliged.
Thanks for your time and advice. Much obliged.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: LUKS encryption - increase swap size
Oh, you wanted to increase the swap size for hibernation. The hibernation image is written to a single swap area (the first one listed in /proc/swaps IME) which must be big enough regardless of the number and total size of active swap areas. So adding another swap area instead of extending the existing one is not the best solution. However it can still be useful if the smaller swap area is used primarily for normal swap utility (with higher priority) and the bigger is used to write the hibernation image.