阿里云ecs 硬盘在线扩容详细教程

softyun3年前云服务器41

一、首先在阿里云后台通过在线扩容扩容硬盘

二、登录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=================================================================================================================== PackageArchVersionRepository Size===================================================================================================================Installing: gdiskx86_640.8.10-3.el7 base190 kTransaction Summary===================================================================================================================Install1 PackageTotal download size: 190 kInstalled size: 660 kDownloading packages:gdisk-0.8.10-3.el7.x86_64.rpm | 190 kB00: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.el7Complete!

三、下载阿里云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=================================================================================================================== PackageArch VersionRepositorySize===================================================================================================================Installing: cloud-utils-growpart noarch 0.29-5.el7 base27 kTransaction Summary===================================================================================================================Install1 PackageTotal download size: 27 kInstalled size: 61 kDownloading packages:cloud-utils-growpart-0.29-5.el7.noarch.rpm|27 kB00:00:00 Running transaction checkRunning transaction testTransaction test succeededRunning transactionInstalling : cloud-utils-growpart-0.29-5.el7.noarch1/1 Verifying: cloud-utils-growpart-0.29-5.el7.noarch1/1 Installed:cloud-utils-growpart.noarch 0:0.29-5.el7 Complete!

四、运行growpart进行扩容分区

首先通过df -h查看当前硬盘挂载信息

[root@iZ2ze4hqhlabzt7nqcxfxzZ home]# df -hFilesystemSizeUsed Avail Use% Mounted on/dev/vda1 197G4.9G182G 3% /devtmpfs7.8G 07.8G 0% /devtmpfs 7.8G 07.8G 0% /dev/shmtmpfs 7.8G504K7.8G 1% /runtmpfs 7.8G 07.8G 0% /sys/fs/cgroup/dev/vdb1 985G846G 89G91% /hometmpfs 1.6G 01.6G 0% /run/user/0

发现/dev/vdb1对应的挂载点/home,空间使用91%,需要对/dev/vdb1 的分区进行扩容

[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命令扩容目标分区文件系统

首先查看文件系统类型

[root@iZ2ze4hqhlabzt7nqcxfxzZ home]# cat /etc/fstab ## /etc/fstab# Created by anaconda on Thu Nov 29 03:34:10 2019## 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 / ext4defaults1 1/dev/vdb1 /home ext4defaults0 0[root@iZ2ze4hqhlabzt7nqcxfxzZ home]#

/dev/vdb1文件系统类型为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 -hFilesystemSizeUsed Avail Use% Mounted on/dev/vda1 197G4.9G182G 3% /devtmpfs7.8G 07.8G 0% /devtmpfs 7.8G 07.8G 0% /dev/shmtmpfs 7.8G504K7.8G 1% /runtmpfs 7.8G 07.8G 0% /sys/fs/cgroup/dev/vdb1 2.0T846G1.1T46% /hometmpfs 1.6G 01.6G 0% /run/user/0[root@iZ2ze4hqhlabzt7nqcxfxzZ home]#

/dev/vdb1的容量已经扩围2.0T,至此在线扩容成功。

以上则是阿里云ecs 硬盘在线扩容详细教程的全部内容,希望对您所帮助,更多云服务器知识请访问服务器之家!







原文地址:cnblogs/sky-cheng/p/14626373.html


免责声明:本文内容来自用户上传并发布,站点仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。请核实广告和内容真实性,谨慎使用。

相关文章

选择vps服务器独立ip有哪些优势

使用vps服务器独立IP具有以下几点优势:1、安全性独立IP可以更好的隔离攻击者和网站,降低攻击危险。2、流量监控可以通过独立IP进行流量监控,系统更容易管理。3、搜索引擎优化可以增强网站在搜索引擎中...

SSL证书申请DNS验证失败怎么解决

SSL证书申请DNS验证失败解决的方法:1、如果是fileauth.htm内容配置错误,看站点是否已启用https访问方式,CA指定的URL是否能直接访问到正确的验证文件内容,CDN服务节点是否完成海...

在自己服务器上部署ChatGPT的教程

有网友发私信问我司技术如何在服务器上部署ChatGPT。这里就给搭建分享一个比较简单的部署方法,下面是ChatGPT服务器搭建详细教程准备工作在部署前,需要做好以下两个准备工作:有一个可正常登录的 C...

租用广州高防服务器的注意事项有哪些

租用广州高防服务器的注意事项:1. 租用广州高防服务器注意价格的定位,勿要贪图便宜,对价格预算要有一个正确的把握。2. 租用广州高防服务器不要过度配置带宽,过度的带宽只能解决网络级别的攻击,无法应对应...

怎么挑选美国服务器租用商

挑选美国服务器租用商的方法有:1、看美国服务器租用商是否提供测试机器,以保障服务器正常运行;2、看美国服务器租用商提供的服务器配置是否满足自身的需求,以免影响后期的发展;3、看美国服务器租用商是否拥有...

linux服务器系统有哪些版本

linux服务器系统主要有以下几种版本:1、UbuntuUbuntu是一款极其受欢迎的linux服务器操作系统,它具有软件丰富、易用性强、性能优越等特点,可以用于各种服务器端开发。2、DebianDe...