lvm物理卷如何重新分区(pvresize命令 – 调整LVM中物理卷的容量大小)
导读:pvresize命令来自英文词组“Physical Volume resize”的缩写,其功能是用于调整LVM中物理卷的容量大小。pvresize命令可以调整已在卷组中的物理卷容量大小,一般要在物理卷设备扩容或缩小容量前进行此操作,提前告知操作系统和LVM逻辑卷管理器新的物理卷大小,若要缩小物理卷容量,不得低于已使用的容量。...
pvresize命令来自英文词组“Physical Volume resize ”的缩写 ,其功能是用于调整LVM中物理卷的容量大小 。pvresize命令可以调整已在卷组中的物理卷容量大小 ,一般要在物理卷设备扩容或缩小容量前进行此操作 ,提前告知操作系统和LVM逻辑卷管理器新的物理卷大小 ,若要缩小物理卷容量 ,不得低于已使用的容量 。
语法格式:pvresize [参数] 物理卷名
常用参数:
-d 使用调试模式 -h 显示帮助信息 -t 使用测试模式 -v 显示执行过程详细信息 -y 强制执行而不询问 --reportformat 设置当前报告的输出格式 --setphysicalvolumesize 覆盖物理卷自动检测到的尺寸参考实例
同步物理卷的容量为最新大小:
[root@linuxcool ~]# pvresize /dev/sda2 Physical volume "/dev/sda2" changed 1 physical volume(s) resized or updated / 0 physical volume(s) not resized调整物理卷的容量大小为20GB(需二次确认):
[root@linuxcool ~]# pvresize --setphysicalvolumesize 20G /dev/sda2 WARNING: /dev/sda2: Overriding real size <19.00 GiB. You could lose data. /dev/sda2: Requested size 20.00 GiB exceeds real size <19.00 GiB. Proceed? [y/n]: y WARNING: /dev/sda2: Pretending size is 41943040 not 39843840 sectors. Physical volume "/dev/sda2" changed 1 physical volume(s) resized or updated / 0 physical volume(s) not resized以测试模式运行 ,同步物理卷容量为最新大小:
[root@linuxcool ~]# pvresize -t /dev/sda2 TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated. WARNING: Device /dev/sda2 has size of 39843840 sectors which is smaller than corresponding PV size of 41940992 sectors. Was device resized? One or more devices used as PVs in VG rhel_linuxprobe have changed sizes. Physical volume "/dev/sda2" changed 1 physical volume(s) resized or updated / 0 physical volume(s) not resized
声明:本站所有文章 ,如无特殊说明或标注 ,均为本站原创发布 。任何个人或组织 ,在未征得本站同意时 ,禁止复制 、盗用 、采集 、发布本站内容到任何网站 、书籍等各类媒体平台 。如若本站内容侵犯了原著者的合法权益 ,可联系我们进行处理 。
创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!