Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

Extend SWAP with LVM

Leer en espanol
Extend SWAP with LVM

Table of contents

textlvdisplay /dev/vg_system/lv_swap — Logical volume — LV Name                 /dev/vg_system/lv_swap VG Name                 vg_system LV Write Access        read/write LVStat ===

We look at space

text
lvdisplay /dev/vg_system/lv_swap

— Logical volume —

LV Name                /dev/vg_system/lv_swap

VG Name                vg_system

LV Write Access        read/write

LV Status              available

# open                 1

LV Size                1.00 GB

we disable the swap

text
swapoff -v /dev/vg_system/lv_swap

swapoff on /dev/vg_system/lv_swap
text
Ampliamos el tamaño el cual necesitamos, en mi caso 1GB
lvresize /dev/vg_system/lv_swap -L +1G

Extending logical volume swap_lv to 2.00 GB

Logical volume swap_lv successfully resized

We give the volume swap format

text
mkswap /dev/vg_system/lv_swap

Setting up swapspace version 1, size = 2097152 kB

We activate the swap

text
swapon -va

swapon on /dev/vg_system/lv_swap

To verify that the increase has been satisfactory, we perform a cat to the /proc/swaps file

Bash
cat /proc/swaps

Filename                         Type       Size    Used    Priority

/dev/vg_system/lv_swap           partition  2097152 0       -2

All the best.

Comments