lvm resize, extend reduce example

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00 7935392 6773500 752292 91% /
/dev/sda5 497829 20904 451223 5% /boot
tmpfs 1037084 0 1037084 0% /dev/shm
/dev/mapper/VolGroup00-LogVol01 70877776 14988144 51045372 23% /home
My / partition is about 8 Gb and my /home partition is about 71 Gb.

For /home, I did:

umount /home
e2fsck -f /dev/VolGroup00/LogVol01
resize2fs /dev/VolGroup00/LogVol01 69G
lvreduce -L-2G /dev/VolGroup00/LogVol01
mount /home

For / partition, I did:

lvextend -L+2G /dev/VolGroup00/LogVol00
resize2fs /dev/VolGroup00/LogVol00

Another example:

df-h

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_server1-lv_root
9.7G 600M 8.6G 7% /

lvextend -L+8G /dev/vg_server1/lv_root
resize2fs /dev/vg_server1/lv_root

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