How do I increase the size of the LVM logical partition?

Source: Internet
Author: User

Reference: (http://blog.csdn.net/t0nsha/article/details/7296851)

LVM (Logical volume management)

Execute DF command to view file system space consumption

The logical volume/dev/fedora/home of LVM has been found to occupy 96% of the space!!!

Then use the du command to view the file footprint

The analysis shows that the largest occupying file is the virtual machine image of gnome-boxes. Full 13g!

No large files can be deleted, only partition management.

I'm going to compress the/dev/fedora/swap partition and give/dev/fedora/home a bit of space

(TIP :Fedora's Installation manual recommends that the remaining space be fully divided into LVM after the boot and swap are separated.)

(I have a swap partition that has never been used, and the memory of the computer is 8G, and the swap partition is never used.)

LVM Management Commands:

Expansion:

First expansion of the LV re-expansion file system

Lvextend-l +100m/dev/vg1/lv1 Logical volume size increased by 100M

RESIZE2FS/DEV/VG1/LV1 file system to the size of the logical volume

Contraction:

First minus the file system again minus the LV (note order)

Umount/dev/vg1/lv1

E2fsck-f/DEV/VG1/LV1

RESIZE2FS/DEV/VG1/LV1 100M reduce file system to 100M

Lvreduce-l 100m/dev/vg1/lv1 reduce logical volume to 100M

Mount-a

Steps:

1. Compressing/dev/fedora/swap partitions

Umount/dev/fedora/swap

E2fsck-f/dev/fedora/swap

Resize2fs/dev/fedora/swap 1G

Lvreduce-l 1g/dev/fedora/swap

The swap partition was successfully converted to 1GiB.

Results:

Use the Pvscan command to view the remaining space

2. extending the/dev/fedora/home partition

Execute Lvextend-l +4.59g/dev/fedora/home

Resize2fs/dev/fedora/home

Results:

Use the DF command to view the space occupied by the file system

Logical Volume/dev/fedora/home has successfully changed from 16G to 21G!

How do I increase the size of the LVM logical partition?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.