(Dec 29) New version 0.9.8-18 has been released. More you can find here

How to increase swap partition

General questions about VestaCP
Forum rules
Before creating a new topic or reply on the forum you should fill out additional fields "Os" and "Web" in your profile section.
In case of violation, the topic can be closed or response from the support will not be received.
emammadov
Posts: 5
Joined: Mon Nov 06, 2017 11:13 am

How to increase swap partition

Postby emammadov » Fri Dec 15, 2017 7:45 pm

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

mehargags
Moderators
Posts: 900
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: How to increase swap partition

Postby mehargags » Sat Dec 16, 2017 8:00 am

do this as "root" :

Code: Select all

fallocate -l 8G /swapfile
ls -lh /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

Check if it is correctly done

Code: Select all

swapon -s

Edit your fstab to survive reboot

Code: Select all

nano /etc/fstab

Code: Select all

/swapfile   none    swap    sw    0   0


Code: Select all

reboot

and verify again with

Code: Select all

swapon -s

emammadov
Posts: 5
Joined: Mon Nov 06, 2017 11:13 am

Re: How to increase swap partition

Postby emammadov » Mon Dec 18, 2017 8:13 am

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?

mehargags
Moderators
Posts: 900
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: How to increase swap partition

Postby mehargags » Mon Dec 18, 2017 8:48 pm

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


Return to “General Discussion”



Who is online

Users browsing this forum: No registered users and 4 guests

cron