Operating on the expansion disk vCenter

The following is a screenshot of the production machine, there is a disk, and the root partition is / dev / sda3, because of lack of disk data to be backed up at this time is much more than space; under normal circumstances, can add hard drives as backup

But as a virtual machine under the host, because some operations are not standardized, we directly online capacity expansion, resulting in additional disk space does not take effect

Once you've added, we look through fdisk -l, hard disk space does not change, then we reboot reboot to take effect

We can see that after the restart though, just the size of the hard disk into force, then we need to create partitions and mount in order to make space for the new 200G spun off!

Next is the format / dev / sda4 partition, then if we are formatted, if not able to find / dev / sda4 partition, we need to execute this command partprobe, re-read the partition table ( here only test format simulated operation, but there are data disk line data, do not format)

After formatting is complete partition mounted permanently written fatab profile!

Execute mount -a mount automatically take effect

Next, we create the / data directory data, we know that the / data directory is mounted at / dev / sda4 this partition, and only the size of 200G, we require online sudden expansion in this partition, expansion into 200G total sda4 size 400G

umount unloading / dev / sda4 partition

Direct online expansion, / dev / sda hard disk from the new 500G 200G (hard disk capacity already in force at this time, but the requirement is that the new capacity should be divided into 200G / dev / sda4 partition for / data directory to use, then the demand for this how does it work?)

Capacity is needed to delete partition (/ dev / sda4) to re-create (the purpose of reallocating the starting number of hard disk partitions)

The newly created / dev / sda4 partition record-keeping may be wrong, at this time, we reboot reboot the system (remember, do not format the partition, all partitions otherwise sda4 data loss)

重启完毕之后,我们挂载分区,执行xfs_growfs扩容/dev/sda4(此处,使用xfs_groufs没有指定任何参数以及数值,默认将剩余全部容量扩容给sda4中)

到此为止!我们的/dev/sda4的容量大小已从200G扩容到400G;实验结束!

Guess you like

Origin www.cnblogs.com/bixiaoyu/p/11353269.html