CentOS lvm resizing

Source: Internet
Author: User

I. Introduction

LVM is short for Logical Volume Manager. It is a mechanism for managing disk partitions in Linux, LVM is a logical layer built on hard disks and partitions to improve the flexibility of disk partition management. LVM is a logical layer added between the disk partition and the file system to shield the file system from the underlying disk partition layout, provide an abstract disk volume, and create a file system on the disk volume. A physical volume (physical volume) refers to a hardware Partition or a device (such as RAID) with the same functions as a disk partition logically. It is the basic storage Logical Block of LVM, however, compared with basic physical storage media (such as partitions and disks), it contains management parameters related to LVM.

The most common hard-to-decide problem that Linux users encounter when installing the Linux operating system is how to correctly evaluate the size of each partition to allocate suitable hard disk space. When a partition space is exhausted, the solution is usually to use a symbolic link or a tool to adjust the partition size (such as PatitionMagic), but this is only a temporary solution, the problem is not fundamentally solved. With the appearance of the Logical Disk volume management function in Linux, these problems have been solved, and users can easily adjust the size of each partition without downtime.

Environment before the experiment:

There is a new GB hard disk to be mounted

Ultimate goal:

Expand the/home/capacity without affecting usage, that is, mount the GB hard disk to/home

Server version:


Procedure:

1. view the current space usage

2. view the current disk capacity

Run the fdisk-l command to check whether there is a new hard disk in the format of lvm. Note that only 8e partitions can be used to create lvm, change the file format to 8e when creating a partition.

3. view the original logical volume

4. Create a physical volume


5. view the current physical volume

The new physical volume is displayed.

6. Add a new physical volume to an existing logical volume

7. view the current logical volume

8. view the current partition status

9. Start to increase/home capacity

You can also use lvextend-l + 100% VG/dev/vg_lievedvd/lv_home

10. view the current partition status

You can see that the/home space has increased.

11. Be careful when formatting the new capacity.

12. Check the partition status. The lvm is successfully resized!


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.