Difference between revisions of "Add a swap disk"
Jump to navigation
Jump to search
(One intermediate revision by the same user not shown) | |||
Line 7: | Line 7: | ||
* [[Add a disk]] to the server | * [[Add a disk]] to the server | ||
* Check the new volume with <code>[[lsblk]]</code> | * Check the new volume with <code>[[lsblk]]</code> | ||
− | * Create swap: sudo <code>[[mkswap]] /dev/nvme####n1</code> | + | * Create swap: sudo <code>[[mkswap]] [[/dev/nvme]]####n1</code> |
* Add swap in <code>[[/etc/fstab]]</code> | * Add swap in <code>[[/etc/fstab]]</code> | ||
sudo vi [[/etc/fstab]] | sudo vi [[/etc/fstab]] | ||
− | + | UUID=XXXXXXX none swap [[defaults]] 0 0 | |
* Mount swap : sudo <code>[[mount -a]]</code> | * Mount swap : sudo <code>[[mount -a]]</code> | ||
* Enable swap: <code>[[swapon]] /dev/nvme####n1</code> | * Enable swap: <code>[[swapon]] /dev/nvme####n1</code> |
Latest revision as of 16:30, 24 August 2023
- Verify if swap available and number of disks:
swapon --show
lsblk | grep disk
ls -la /dev/nvme*
- Add a disk to the server
- Check the new volume with
lsblk
- Create swap: sudo
mkswap /dev/nvme####n1
- Add swap in
/etc/fstab
sudo vi /etc/fstab UUID=XXXXXXX none swap defaults 0 0
- Mount swap : sudo
mount -a
- Enable swap:
swapon /dev/nvme####n1
- Check swap
free -h
orswapon --show
UUID=4f724150-4b94-11e9-b2d3-5254001d0c45 none swap defaults 0 0
Related[edit]
swapoff -a
- Add a new disk
- lsblk | grep disk
See also[edit]
Advertising: