Difference between revisions of "Add a swap disk"
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
* Mount swap : sudo <code>[[mount -a]]</code> | * Mount swap : sudo <code>[[mount -a]]</code> | ||
* Enable swap: <code>[[swapon]] /dev/nvme5n1</code> | * Enable swap: <code>[[swapon]] /dev/nvme5n1</code> | ||
− | * Check swap <code>[[free -h]]</code> | + | * Check swap <code>[[free -h]]</code> or <code>[[swapon --show]]</code> |
Revision as of 10:49, 24 August 2023
- swapon --show
- Add a disk to the server
- Check the new volume with
lsblk
- Create swap: sudo
mkswap -f /dev/nvme5n1
- Add swap in
/etc/fstab
sudo vi /etc/fstab UID none swap defaults 0 0
- Mount swap : sudo
mount -a
- Enable swap:
swapon /dev/nvme5n1
- Check swap
free -h
orswapon --show
Related
See also
- Swap,
swapon
,swapoff
,mkswap
,swaplabel
,free
,sar -r
,sar -S
,sar -W
,vmstat
,vm.swappiness
,/proc/swaps
,/etc/fstab
, Add a swap disk,systemd.swap
- memory
Advertising: