Linux Root partition expansion and Expansion

Source: Internet
Author: User
Tags hex code

Prerequisites:
Linux Root partition resizing requires the use of LVM for existing root partitions. If you select the default option when selecting partition settings during Linux installation, LVM is used for management. The command used to view the current root partition management mode is:
Fdisk-l
The system column of the corresponding hard disk is Linux LVM, that is, it is LVM management and can be resized.

 

Expansion steps:
1. First, add a new disk, start the system, and enter the system. Use root to log on, run fdisk, and partition the Newly Added Disk. We assume that all the disk capacity is divided into one partition and the partition is/dev/sdb1. Change the partition format to LVM format.

TIPS:
. After we make adjustments to the partition, We will prompt that the partition table will change after the system is restarted. In fact, we can use the partprobe command.

. Method for modifying the partition format: fdisk/dev/sdb1

Command (M for help): t change the partition type Partition Number (1-4): 3 select the second hex code (type L to list codes ): the 8e disk format is changed to Linux LVM and can be viewed using L.

2. view the physical volume (PV) in the system and run the pvdisplay command;
3. Create a new physical volume (PV): pvcreate/dev/sdb1;
4: Add a new physical volume to the volume group by using the virtual volume group (VG): vgextend volgroup00/dev/sdb1. The volume group name comes from step 2;
5: Run vgdisplay to view the expanded virtual volume group (VG). If the displayed capacity increases, the virtual volume group (VG) is successfully expanded;
6: add the new space to the logical volume: lvextend-L + n (m, or G)/dev/volgroup00/logvol00;
7: When DF-H is used, no new space is available. You need to activate the new space resize2fs-P/dev/volgroup00/logvol00;
8. Now we can see the expanded space. DF-LH.

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.