一、首先在阿里云后臺通過在線擴容擴容硬盤
專注于為中小企業(yè)提供成都網(wǎng)站設(shè)計、成都做網(wǎng)站服務(wù),電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業(yè)大寧免費做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了1000多家企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設(shè)實現(xiàn)規(guī)模擴充和轉(zhuǎn)變。二、登錄ecs下載阿里云gdisk工具
[root@iZ2ze4hqhlabzt7nqcxfxzZ home]# yum install gdisk -yLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfileResolving Dependencies--> Running transaction check---> Package gdisk.x86_64 0:0.8.10-3.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved=================================================================================================================== Package Arch Version Repository Size===================================================================================================================Installing: gdisk x86_64 0.8.10-3.el7 base 190 kTransaction Summary===================================================================================================================Install 1 PackageTotal download size: 190 kInstalled size: 660 kDownloading packages:gdisk-0.8.10-3.el7.x86_64.rpm | 190 kB 00:00:00 Running transaction checkRunning transaction testTransaction test succeededRunning transactionWarning: RPMDB altered outside of yum. Installing : gdisk-0.8.10-3.el7.x86_64 1/1 Verifying : gdisk-0.8.10-3.el7.x86_64 1/1 Installed: gdisk.x86_64 0:0.8.10-3.el7 Complete!
三、下載阿里云growpart工具
[root@iZ2ze4hqhlabzt7nqcxfxzZ home]# yum install cloud-utils-growpart -yLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfileResolving Dependencies--> Running transaction check---> Package cloud-utils-growpart.noarch 0:0.29-5.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved=================================================================================================================== Package Arch Version Repository Size===================================================================================================================Installing: cloud-utils-growpart noarch 0.29-5.el7 base 27 kTransaction Summary===================================================================================================================Install 1 PackageTotal download size: 27 kInstalled size: 61 kDownloading packages:cloud-utils-growpart-0.29-5.el7.noarch.rpm | 27 kB 00:00:00 Running transaction checkRunning transaction testTransaction test succeededRunning transaction Installing : cloud-utils-growpart-0.29-5.el7.noarch 1/1 Verifying : cloud-utils-growpart-0.29-5.el7.noarch 1/1 Installed: cloud-utils-growpart.noarch 0:0.29-5.el7 Complete!
四、運行g(shù)rowpart進行擴容分區(qū)
首先通過df -h查看當(dāng)前硬盤掛載信息
[root@iZ2ze4hqhlabzt7nqcxfxzZ home]# df -hFilesystem Size Used Avail Use% Mounted on/dev/vda1 197G 4.9G 182G 3% /devtmpfs 7.8G 0 7.8G 0% /devtmpfs 7.8G 0 7.8G 0% /dev/shmtmpfs 7.8G 504K 7.8G 1% /runtmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup/dev/vdb1 985G 846G 89G 91% /hometmpfs 1.6G 0 1.6G 0% /run/user/0
發(fā)現(xiàn)/dev/vdb1對應(yīng)的掛載點/home,空間使用91%,需要對/dev/vdb1 的分區(qū)進行擴容
[root@iZ2ze4hqhlabzt7nqcxfxzZ home]# growpart /dev/vdb 1CHANGED: partition=1 start=2048 old: size=2097149952 end=2097152000 new: size=4194301919 end=4194303967[root@iZ2ze4hqhlabzt7nqcxfxzZ home]#
五、運行resize2fs命令擴容目標分區(qū)文件系統(tǒng)
首先查看文件系統(tǒng)類型
[root@iZ2ze4hqhlabzt7nqcxfxzZ home]# cat /etc/fstab ## /etc/fstab# Created by anaconda on Thu Nov 29 03:34:10 2018## Accessible filesystems, by reference, are maintained under '/dev/disk'# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info#UUID=b98386f1-e6a8-44e3-9ce1-a50e59d9a170 / ext4 defaults 1 1/dev/vdb1 /home ext4 defaults 0 0[root@iZ2ze4hqhlabzt7nqcxfxzZ home]#
/dev/vdb1文件系統(tǒng)類型為ext4,運行如下命令
[root@iZ2ze4hqhlabzt7nqcxfxzZ home]# resize2fs /dev/vdb1resize2fs 1.42.9 (28-Dec-2013)Filesystem at /dev/vdb1 is mounted on /home; on-line resizing requiredold_desc_blocks = 125, new_desc_blocks = 250The filesystem on /dev/vdb1 is now 524287739 blocks long.[root@iZ2ze4hqhlabzt7nqcxfxzZ home]#
再次查看硬盤
[root@iZ2ze4hqhlabzt7nqcxfxzZ home]# df -hFilesystem Size Used Avail Use% Mounted on/dev/vda1 197G 4.9G 182G 3% /devtmpfs 7.8G 0 7.8G 0% /devtmpfs 7.8G 0 7.8G 0% /dev/shmtmpfs 7.8G 504K 7.8G 1% /runtmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup/dev/vdb1 2.0T 846G 1.1T 46% /hometmpfs 1.6G 0 1.6G 0% /run/user/0[root@iZ2ze4hqhlabzt7nqcxfxzZ home]#
/dev/vdb1的容量已經(jīng)擴圍2.0T,至此在線擴容成功。
以上則是阿里云ecs 硬盤在線擴容詳細教程的全部內(nèi)容,希望對您所幫助,更多云服務(wù)器知識請訪問服務(wù)器之家!成都小程序開發(fā)公司
原文地址:https://www.cnblogs.com/sky-cheng/p/14626373.html