Linux root partition a single disk expansion (non-LVM)

Linux root partition a single disk expansion (non-LVM)

Hardware: DELL R720 

System: XEN

Virtual System: CentOS 6.5

Installation partition: a total of three / and / sawp and / boot

 

Foreword

This article is for single block of disk expansion, such as a physical 250G hard drive, beginning allocated only 100G, is not enough, the latter would like the remainder of the disk is used.

 

First, the operation, if you want to expansion of the root partition (system partition), the partition, like me, you must first enter rescue mode. If a non-system partition, such as / test, which does not need to enter rescue mode.

The easiest way to test methods, umoun (Uninstall disk) If the system is not successfully explain the impact, if unsuccessful in using the help system, you need to first boot the system with other devices, such as CD-ROM drive.

 

How to get into rescue mode, there are already tutorials, do not repeat it. Address: http://www.linuxidc.com/Linux/2015-03/114942.htm

If the operating system disk, then you would enter "single user mode" (singal user mode) 

Address: http://jingyan.baidu.com/article/d45ad148a61dbd69552b8018.html

 

Second, the beginning of the partition

1. Check the partition information, this expansion is to / dev / xvda3

wKiom1dFEvyzMBJHAABDbEgpKvY812.png

2. Modify Partition with fdisk, fdisk / dev / xvda details in the print disk input p.

NOTE: Novice sure not to ask why the expansion xvda3 enter xvda it? Because xvda is representative of the entire physical disk, and xvda3 behalf xvda in the first three partitions, if fdisk / dev / xvda3 then we can only third fast partitioning is only operating capacity of 99G.

wKiom1dFE3WSqFawAAA-RCJ2CIw376.png

3. After printing the information can be seen, the original xvda3 start cylinder is 52, the end of the cylinder is 13055 which is about 99G.

Followed by input d, n, p to create action starting cylinder system has been counted out, if you do not want to change can directly enter.

wKioL1dFGHzheI2SAAA6UHZ3HKo289.png

W 4. Enter the partition table and exit. If you find a mistake in front, enter q to quit does not exist, then start again.

wKioL1dFGVmB29GYAAAdOlbrqL0530.png

The back system command line input df -h, found xvda3 capacity has not changed, wait, what also adjust the partition table.

wKioL1dFGcrTR9ofAAAOimD1mQ4324.png

6. Adjust the partition table. Note To order umount disk in a single-user system if the partition table is adjusted, if other non-system partition is not.

umount /dev/sda3

e2fsck -f / dev / xvda3 # Check the partition information, this inspection must be done.

wKiom1hXl5Oj1C-oAAB8mwX4oWQ334.png

 

After the implementation of the above command, the reboot, after re-starting system with ISO guide rescue mode in performing the following resize2fs.

resize2fs / dev / xvda3 # resize partitions, this process takes time points according to the disk size will be.

df -h to see / dev / xvda3 original 99G 197G becomes a.

wKiom1dFIQHz6CVvAAAvOYn6g0Y140.png

Note: modify the partition table has been completed expansion, our purpose, and not to use mkfs to format, or your data will be lost, unless you want to format.

 

Note: Since the beginning of the operation when the user mode, then adjust the partition table to find unsuccessful, and went to rescue mode, so Ituri little different, we began to own rescue mode, operation commands are the same .

 

 

Reference article:

http://www.osyunwei.com/archives/9368.html

http://www.linuxidc.com/Linux/2015-03/114942.htm

 

This switched piazini 51CTO blog, the original link: http: //blog.51cto.com/wutou/1782931

 

 
Published 154 original articles · won praise 44 · Views 230,000 +

Guess you like

Origin www.cnblogs.com/wanglfhh/p/12634993.html