Non-Destructive Swap Configuration
The objective's key word is *non-destructively*: swap is added while the machine keeps running and its existing swap keeps working. Total swap grows from 3.9 GiB to 4.4 GiB here without a reboot, and the priority column shows which area the kernel will reach for first.
Local Storage Guide 36 of 67 Intermediate
- OSRHEL 10.0
- Kernel6.12.0-55.9.1.el10_0
- dnf4.20.0
- Flatpak1.16.0
- TimeAbout 14 min
Swap needs no mount point. Its /etc/fstab line uses none for field 2 and swap for field 3. swapon -a activates everything in fstab, which is exactly what boot does - so it is the way to test a swap entry without rebooting.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RHCSA-A01 | 192.168.0.31 | RHEL 10.0 | Practice node (graded) - spare /dev/sda | 2 Core | 4 GB | 50 GB + 15 GB |
This guide includes
Use this because the objective's key word is non-destructively. This matters because swap is added while the machine keeps running - nothing is unmounted, nothing reboots, and priority decides which swap gets used first.
- finding what swap already exists
- creating swap on a logical volume
- activating it with the machine still running
- making it survive a reboot
- setting priority, and putting swap on a partition instead
Before you start
- A volume group with free space, or a spare partition.
- Every destructive command on this page names a
/dev/sdadevice. On this machine the operating system is entirely on/dev/sdb. Check yours before running anything here - the first step shows how.
-
What swap exists now
-
Swap on a logical volume
-
Activating it with the machine running
-
Making it survive a reboot
-
Priority decides which is used first
-
Swap on a partition instead