Linux: Resizing Swap Online

Hi all!
Quick one to resize swap online:

[root@server-db ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/rootvg-lvswap              partition       5242872 373624  -1
[root@server-db ~]# vgs
VG                #PV #LV #SN Attr   VSize   VFree
[...]
rootvg              1   6   0 wz--n- 135.69G 5.69G
[...]
[root@server-db ~]# lvextend -L +2048M /dev/mapper/rootvg-lvswap
Extending logical volume lvswap to 7.00 GB
Logical volume lvswap successfully resized
[root@server-db ~]# vgs
VG                #PV #LV #SN Attr   VSize   VFree
[...]
rootvg              1   6   0 wz--n- 135.69G 3.69G
[...]
[root@server-db ~]# mkswap /dev/mapper/rootvg-lvswap
Setting up swapspace version 1, size = 7516188 kB
[root@server-db ~]# swapoff /dev/mapper/rootvg-lvswap
[root@server-db ~]# swapon /dev/mapper/rootvg-lvswap
[root@server-db ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/rootvg-lvswap              partition       7516188 373624  -1

See ya!
Matheus.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s