Mount extended hard disk partitions using LVM in CentOS VPS

Source: Internet
Author: User
Tags centos vps vps hex code
Linux partitions are LVM, and there are three phases to expand the hard disk: New Partition & mdash; new PV & mdash; expanded VG & mdash; expand a single LV hard disk. to divide it into multiple logical partitions, create a new partition. skip this step if you use the entire hard disk: 12345678910111213141

Linux partitions are LVM, and there are three phases to expand the hard disk: new partition -- new PV -- expand VG -- expand LV
To divide a single hard disk into multiple logical partitions, create a new partition. skip this step if you use the entire hard disk:

1234567891011121314151617
# Http://www.haiyun.mefdisk-l # view the partition to be mounted, usually/dev/xvdbfdisk/dev/xvdb Command (m for help ): n # New partition Command action e extended # extended Partition p primary partition (1-4) # primary Partition p # input p select new primary partition Partition number (1-4 ): 1 # primary partition number First cylinder (1-3263, default 1): # start position of the partition. the default value is Last cylinder (1-3263, default 3263): # end position, by default, Command (m for help): t # specify the partition format Hex code (type L to list codes): 8e # set it to LVMChanged system type of pa Rtition 1 to 8e (Linux LVM) Command (m for help): w # save # The partition table has been altered! Quit # exit

Create a PV and expand it to VolGroup00
123456
Partprobe # Re-read the partition table pvcreate/dev/xvdb1 # Create a new PVvgscan # display the current VG # Reading all physical volumes. this may take a while... # Found volume group "VolGroup00" using metadata type lvm2 # VG name: VolGroup00vgextend VolGroup00/dev/xvdb1 # extend PV to PG

Check the remaining number of PES in VolGroup00 to prepare the extended LV
1234
Vgdisplay # --- Volume group --- # VG Name VolGroup00 # VG Name # Free PE/Size 2553/79 .78 GB #2553 indicates the number of remaining PES

View the LV to be extended
123
Lvscan # List LV, when the capacity is large, the LV # ACTIVE '/dev/VolGroup00/logvol00' [10.53 GB] inherit # LV # ACTIVE'/dev/VolGroup00/LogVol01 '[ 256.00 MB] inherit

Expand LV
12
Lvresize-l + 2553/dev/VolGroup00/LogVol00 #2553 is the number of PES remaining in the VG resize2fs/dev/VolGroup00/LogVol00

Related Article

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.