最近一台服务器的硬盘空间不够了,要进行扩容,由于是centos6.8的,且内核版本小于3.6,但是centos6的生命周期已经结束了,所以在安装软件时,还是折腾了一番,在此记录下。

  1. 备份原有yum源

  2. 下载阿里yum源,下载后要进行一些修改,不然还是使用不了。

sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo

sed -i  's/http/https/g' /etc/yum.repos.d/CentOS-Base.repo

sed -i  's/$releasever/6.8/g' /etc/yum.repos.d/CentOS-Base.repo

sed -i  's/centos/centos-vault/g' /etc/yum.repos.d/CentOS-Base.repo

3.yum clean all && yum makecache

4.安装epel源

yum install -y http://archives.fedoraproject.org/pub/archive/epel/6/x86_64/epel-release-6-8.noarch.rpm

yum install cloud-utils-growpart

另外也可使用阿里的源。https://help.aliyun.com/document_detail/193569.html?spm=5176.11065259.1996646101.searchclickresult.24c8609b6AXOEd