给KVM下的qcow2虚拟硬盘扩容(针对CentOS)

2018-07-11 10:38:11

[开发运维 | Dev Ops] , ,

服务器上的空间其实还是比较吃紧的,VM自己设置的默认盘没有给多少空间,有时候不够用其实也是可以扩容的。记录一下主要的步骤,以免以后要查。。。。

 

 

先需要将VM关闭,然后扩容qcow2文件

qemu-img resize /var/lib/libvirt/images/kashima.qcow2 +8G

 

 

然后将硬盘分区的光驱mount到vm里面,硬盘分区可以使用gparted

wget https://downloads.sourceforge.net/gparted/gparted-live-0.31.0-1-amd64.iso

 

最后还需要进入VM,将硬盘扩容

lvextend -l +100%FREE /dev/cl/root
xfs_growfs  /dev/cl/root

 

 

 

 

 

最近弄的东西都很难写文章更新博客,感觉都荒废了这个博客了。。。。。

这篇博文发表在 开发运维 | Dev Ops 目录下,标签为 , ,
如需引用,请使用链接:https://note.mc256.dev/?p=1939

This article published in 开发运维 | Dev Ops with tags , , .
Cite this page using this link:https://note.mc256.dev/?p=1939

您的邮箱地址不会被公开,评论使用Gravatar头像。
Your email address will not be published. This blog is using Gravatar.

正在提交评论... Submitting ...
正在为您准备评论控件 Loading Comment Plugin
Copyright © 2013-2023 mc256. All Rights Reserved.
Powered by WordPress on top of a dual-stack k3s Cluster using JuiceFS.
Wordpress Theme Designed By mc256.
Encrypted By Let's Encrypt.  Hosted On Linode + OVH + AWS.
DNS Provided By Hostker.
Status Page by CloudFlare Worker.