Linux VG LV PV

Source: Internet
Author: User

=

PV composed of physical volumes or partitions PV can be composed of one or more VG VG can be divided into several LV convenient expansion

PVs VGs LVs can view the currently existing PV VG LV

My CentOS hard drive 20g was used for a while and 100g at this time we can use extensions to extend our partition size

See how many hard drives you have

ls/dev/sd* | Grep-v ' [0-9] '

See how many partitions you have

ls/dev/sd*

To create a new partition or resize a hard disk using the FDISK command

Fdisk/dev/sda

Enter M to get help

P Print the partitions that appear

Enter n New partition

P establishing the base partition

e Creating an extended partition

Enter the partition number

Enter Start sector

Input size +20g is 20G +100m is 100M format: + number {K,m,g}

Enter d to delete the partition

Input W Save partition Table

The system does not immediately read the partition table after the modification. This time we can reboot or enter Partprobe to let the system reread the partition.

[Email protected] ~]# Partprobe
Warning: Cannot open/dev/sr0 (read-only file system) in read-write mode. /dev/sr0 has been opened as read-only.
[Email protected] ~]# ls/dev/sd*
/dev/sda/dev/sda1/dev/sda2/dev/sda3/dev/sda4/dev/sda5

Partition has 3 to mount the other two partition extensions/directories

Format for Partition 3

Mkfs.xfs/dev/sd3

Mount SD3 to/below 123

Mount-t xfs/dev/sd3/123

DF-HT View

[Email protected] 123]# DF-HT

Mount OK

Expand Our/Catalogue

View PVs First

Add our 4 partitions and 5 partitions into PV

Pvcreate/dev/sd4

Pvcreate/dev/sd5

Add two PV to a VG

Vgextend CL/DEV/SDA4

Vgextend Cl/dev/sda5

View VG There's more free now.

VGS View

Next step to expand our/directory

Lvextend-l +40g/dev/mapper/cl-root-l Specify size +40g extended 40G target is/dev/mapper/cl-root

Show success but view your hard drive information and find no update

Or you need to refresh the reboot or use the xfs_growfs/dev/mapper/cl-root extension to complete

Linux VG LV PV

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.