We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
How to increase swap partition
How to increase swap partition
Hello,
I have installed VestaCP from scratch. I want to increase swap partition to 8GB, but don't know how to do it. Thank you in advance.
Here is the result of lsblk command:
[root@cpanel /]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 220G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 219.5G 0 part
├─vg_cpanel-lv_root (dm-0) 253:0 0 50G 0 lvm /
├─vg_cpanel-lv_swap (dm-1) 253:1 0 3.9G 0 lvm [SWAP]
└─vg_cpanel-lv_home (dm-2) 253:2 0 165.6G 0 lvm /home
sr0 11:0 1 1024M 0 rom
I have installed VestaCP from scratch. I want to increase swap partition to 8GB, but don't know how to do it. Thank you in advance.
Here is the result of lsblk command:
[root@cpanel /]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 220G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 219.5G 0 part
├─vg_cpanel-lv_root (dm-0) 253:0 0 50G 0 lvm /
├─vg_cpanel-lv_swap (dm-1) 253:1 0 3.9G 0 lvm [SWAP]
└─vg_cpanel-lv_home (dm-2) 253:2 0 165.6G 0 lvm /home
sr0 11:0 1 1024M 0 rom
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: How to increase swap partition
do this as "root" :
Check if it is correctly done
Edit your fstab to survive reboot
and verify again with
Code: Select all
fallocate -l 8G /swapfile
ls -lh /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
Code: Select all
swapon -s
Code: Select all
nano /etc/fstab
Code: Select all
/swapfile none swap sw 0 0
Code: Select all
reboot
Code: Select all
swapon -s
Re: How to increase swap partition
Thanks. I have some questions:
1. When I want to add swap it says: fallocate: /swapfile: fallocate failed: Text file busy.
2. Here swap is partition or file?
3. Which method do you recommend about partitioning? I can do custom partition or let VestaCP do its partitioning? If I do custom partitioning it will be so:
HDD 220GB
sda 1 - / - 50GB
sda2 - /home - 162GB
sda3 - /swap partition - 8GB
Is it correct or do I have to add something here? Vestacp added /boot - 500mb. Is it necessary?
1. When I want to add swap it says: fallocate: /swapfile: fallocate failed: Text file busy.
2. Here swap is partition or file?
3. Which method do you recommend about partitioning? I can do custom partition or let VestaCP do its partitioning? If I do custom partitioning it will be so:
HDD 220GB
sda 1 - / - 50GB
sda2 - /home - 162GB
sda3 - /swap partition - 8GB
Is it correct or do I have to add something here? Vestacp added /boot - 500mb. Is it necessary?
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: How to increase swap partition
You need to switch OFF Swap first in order to release OS control over it.
No one is going to spoon feed each and every problem you face so you will learn more If you could care to search a bit https://www.google.com/search?q=falloca ... +file+busy
No one is going to spoon feed each and every problem you face so you will learn more If you could care to search a bit https://www.google.com/search?q=falloca ... +file+busy