Skip to content

Instantly share code, notes, and snippets.

@marvin-marvin
Last active March 20, 2024 15:35
Show Gist options
  • Save marvin-marvin/a02f9eb1e33ac5b8f2f4987fec626a3b to your computer and use it in GitHub Desktop.
Save marvin-marvin/a02f9eb1e33ac5b8f2f4987fec626a3b to your computer and use it in GitHub Desktop.
extend swapfile proxmox
# Change Swapfile:
swapoff -v /dev/pve/swap
lvm lvresize /dev/pve/swap -L +48G
mkswap /dev/pve/swap
swapon -va
dd if=/dev/zero of=/dev2/swap bs=1M count=49152
mkswap /dev2/swap
swapon -v /dev2/swap
# 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
dd if=/dev/zero of=//dev/swap2 bs=1M count=8192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment