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?