1

So I tried to increase the swap LV from 8GB to 16GB, but Proxmox web panel doesn't seem to see the change. The LVM increased the space, but Proxmox haven't changed it's panel.

Originally lvdisplay gave this result:

--- Logical volume ---
  LV Path                /dev/pve/swap
  LV Name                swap
  VG Name                pve
  LV UUID                DdbXas-7RNA-Is5V-Ness-sLb3-0Rb7-oT7HUh
  LV Write Access        read/write
  LV Creation host, time proxmox, 2018-07-18 21:18:17 +0200
  LV Status              available
  # open                 2
  LV Size                8.00 GiB <-- Originally
  Current LE             2048
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

For extending the swap storage I did this:

root@basement:~# lvextend -L+8G pve/swap
(...)
Logical volume pve/swap successfully resized.

After increasing the space I got this:

root@basement:~# lvdisplay
  --- Logical volume ---
  LV Path                /dev/pve/swap
  LV Name                swap
  VG Name                pve
  LV UUID                DdbXas-7RNA-Is5V-Ness-sLb3-0Rb7-oT7HUh
  LV Write Access        read/write
  LV Creation host, time proxmox, 2018-07-18 21:18:17 +0200
  LV Status              available
  # open                 2
  LV Size                16.00 GiB <--- Size is increased, right?
  Current LE             4096
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

Proxmox shows only 8GB of SWAP space

I have rebooted, but it still shows 8GB in the Proxmox panel.

How can this be solved?

1 Answer 1

4

You have to modify the swap metadata to account for the increase in space, which is generally accomplished by re-creating the swap signature on a given block device after resize. This is a generic GNU/Linux thing, not just a Proxmox thing.

Shamelessly copied from the RedHat documentation:

7.2.1. Extending Swap on an LVM2 Logical Volume To extend an LVM2 swap logical volume (assuming /dev/VolGroup00/LogVol01 is the volume you want to extend):

Disable swapping for the associated logical volume:

swapoff -v /dev/VolGroup00/LogVol01

Resize the LVM2 logical volume by 256 MB:

lvm lvresize /dev/VolGroup00/LogVol01 -L +256M

Format the new swap space:

mkswap /dev/VolGroup00/LogVol01

Enable the extended logical volume:

swapon -va

Test that the logical volume has been extended properly:

cat /proc/swaps free

3
  • 1
    I see. Makes sense. How should i proceed to make this right when I've already resized? Should I do swapoff then mkswap and so on?
    – JoakimE
    Jul 20, 2018 at 15:30
  • That's exactly what you should do.
    – Spooler
    Jul 20, 2018 at 15:31
  • 1
    Yes, you must off then on again to resize a paging space. You can add new partitions (or files) as paging spaces online, but that's hardly necessary when you are barely using the smaller one at the moment. Jul 22, 2018 at 1:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .