大网数据广告活动
服务器运维问答

Remove Physical Volume from Volume Group

· 52CE 我爱测

How do you remove a PV from a VG? Here's what I've tried: # vgreduce vg_iscsi /dev/sdb1 Physical volume "/dev/sdb1" still in use # lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert root centos -wi-ao---- 6.67…

问题原文

原帖链接 · Snowcrash · CC BY-SA 3.0

How do you remove a PV from a VG?

Here's what I've tried:

# vgreduce vg_iscsi /dev/sdb1
Physical volume "/dev/sdb1" still in use

# lvs
LV         VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root       centos   -wi-ao----   6.67g                                                    
  swap       centos   -wi-ao---- 820.00m                                                    
  lvm02      vg2      -wi-a----- 800.00m                                                    
  lv_iscsi_1 vg_iscsi -wi-ao----  52.00m  

Then

# lvremove -f vg_iscsi/lv_iscsi_1
Logical volume vg_iscsi/lv_iscsi_1 in use.

Using fuser

# fuser -kuc /dev/vg_iscsi/lv_iscsi_1
/dev/dm-3:            1558(root)

I tried to kill -9 this but the process seemed to have disappeared by the time I issued the kill signal.

However, now I get this:

# vgreduce vg_iscsi /dev/sdb1
Can't remove final physical volume "/dev/sdb1" from volume group "vg_iscsi"

Any ideas?

社区高分解答

原帖链接 · Michael Hampton · CC BY-SA 3.0

The vgreduce command is correct, but you can't remove a physical volume from the volume group until it's empty. That is what the error message that you received means.

As the man page states:

       To move all Physical Extents that are used by simple Logical Volumes on
       /dev/sdb1 to free Physical Extents elsewhere in the Volume Group use:

       pvmove /dev/sdb1

Once the PV is empty, you can then repeat the vgreduce command to remove it.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-13)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。