--------------- Statement: partitions are at risk and operations must be cautious ------------------------------------
Application Scenario: hyper-V or esxi. expansion is required if the original space is insufficient.
Step 1 (increase disk space) Add the total disk space on the esxi or hyper-V management interface.
Step 2 (increase partition space ):
My current partition is like this
650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/> 650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/4C/D5/wKiom1RGCxOzKtKcAACdqtGn6_s551.jpg "Title =" t1.png "alt =" wkiom1rgcxozktkcaacdqtgn6_s551.jpg "/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/4C/D6/wKioL1RGC86R3RqvAAB2QUsFigg303.jpg "Title =" t3.png "alt =" wkiol1rgc86r3rqvaab2qusfigg303.jpg "/>
We can see that there is no space for/dev/sda3, and we need to extend it.
The following steps are required for expansion:
Delete/dev/sda3 Partition
Create a new sd3 Partition
Online extended hard drive
[Email protected]: fdisk/dev/SDA // view the partition data of the current disk and record the start position of sda3.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/4C/D5/wKiom1RGC02B0JvKAACeCTDxQhY642.jpg "Title =" t2.png "alt =" wkiom1rgc02b0jvkaacectdxqhy642.jpg "/>
Command (M for help): p
650) This. width = 650; "src ="/e/u261/themes/default/images/spacer.gif "style =" Background: URL ("/e/u261/lang/ZH-CN/images/localimage.png") No-repeat center; Border: 1px solid # DDD; "alt =" spacer.gif "/>
Command (M for help): d
Partition Number (1-4): 3 // Delete sda3. After deletion, run the p command to check whether sda3 is deleted.
Command (M for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition Number (1-4, default 1): 3 // because I used primary before sd3, re-create the primary partition of sd3
First Sector (334-624287999, default 3334): // you can select the start position of sda3. by default, it should be the same as the 3334 recorded previously.
Using default value 3334
Last sector, + sectors or + size {K, M, g} (3334-624287999, default 524287) // The ending number is larger than before, because the system has automatically added our unlocation space.
Command (M for help): W // write to the partition table. If you find any problem with the previous configuration, do not save it (enter W ), otherwise, the previous operations will be written into the partition table.
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[Email protected]: reboot // restart the application's new Partition Table
After restart:
[Email protected]: resize2fs/dev/sda3 // extended partition
[Email protected]: DF-H // view the extension result
This article only extends sda3 and does not extend sda2. If sda2 is extended, it may overwrite sda3 data (speculation )... Therefore, I recommend that you choose LVM as your first partition.
-------------- References --------------------------
Http://codesilence.wordpress.com/2013/03/14/live-resizing-of-an-ext4-filesytem-on-linux/
Centos ext4 non-LVM extended partition