gpt4 book ai didi

Centos 磁盘 LVM 扩展

转载 作者:太空宇宙 更新时间:2023-11-03 17:20:47 28 4
gpt4 key购买 nike

我在使用安装了 Centos7 的 VMWare VM 时遇到问题。

lsblk 命令给出如下内容

enter image description here

df -h 给出这个

enter image description here

我正在尝试将 root lvm 扩展到分区,但无论我如何尝试都无法做到这一点。

我尝试使用 fdisk/dev/sda 创建一个新分区并将 lvm 扩展到这个分区,但是 fdisk 在分区号之后卡住了。

enter image description here

一些其他有用的命令会提供这些结果,以防它们有帮助。

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

如有任何帮助,我们将不胜感激。提前致谢。

最佳答案

从你的截图来看,你的sda2分区是199G,sda1占用1G,你的sda总大小是200G,你不能从sda新建分区,所以一直卡在那里;为了解决您的问题,我提供了两个选项供您引用,但在操作之前请确保备份所有重要数据或虚拟机文件。

选项1:这只是我的想法,未经证实:从你的 vgs 和 pvs,你可以看到你的 sda2 只为整个 VG(centos) 贡献 <29G,所以扩展/root 的非常简单的方法是:

1) pvresize /dev/sda2

,after execute, pls run pvs to check whether the pv size increased, if not, stop here

2) vgextend centos/dev/sda2

,after execute,pls check your vgs, see whether the size increased, if so go on to the next

3) lvextend -l 100%FREE/dev/mapper/centos-root

,after this, check lvs, if the root size not increased, go on

4)尝试:

xfs_growfs /dev/mapper/centos-root or resize2fs /dev/mapper/centos-root

方案二:最佳实践是使用pvmove,产品环境强烈推荐,可以借鉴 https://askubuntu.com/questions/161279/how-do-i-move-my-lvm-250-gb-root-partition-to-a-new-120gb-hard-disk

关于Centos 磁盘 LVM 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51663585/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com