Saturday, December 11, 2021

Increase ubuntu swap

 root@obs-server:/home/obs# swapoff /swap.img

root@obs-server:/home/obs# rm /swap.img

root@obs-server:/home/obs# sudo dd if=/dev/zero of=/swap.img bs=1M count=16384

16384+0 records in

16384+0 records out

17179869184 bytes (17 GB, 16 GiB) copied, 106.527 s, 161 MB/s

root@obs-server:/home/obs# mkswap /swap.img

mkswap: /swap.img: insecure permissions 0644, 0600 suggested.

Setting up swapspace version 1, size = 16 GiB (17179865088 bytes)

no label, UUID=0ebd4780-f6ff-4f33-89f6-5defa0c59484

root@obs-server:/home/obs# swapon  /swap.img

swapon: /swap.img: insecure permissions 0644, 0600 suggested.

root@obs-server:/home/obs# chmod 600 /swapfile

chmod: cannot access '/swapfile': No such file or directory

root@obs-server:/home/obs# ^C

root@obs-server:/home/obs# chmod 600 /swap.img

root@obs-server:/home/obs# swapon  /swap.img

swapon: /swap.img: swapon failed: Device or resource busy

root@obs-server:/home/obs# swapoff  /swap.img

root@obs-server:/home/obs# swapon  /swap.img


No comments:

Post a Comment