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

Delete LVM and anything related to it

· 52CE 我爱测

I want to delete /dev/sdb disk from the server. Before doing that I guess I should remove lvm and anything related to it. I don't care about /dev/sdb1 data. I'm trying to follow this article https://www.golinuxhub.com/2014/03/how…

问题原文

原帖链接 · user630702 · CC BY-SA 4.0

I want to delete /dev/sdb disk from the server. Before doing that I guess I should remove lvm and anything related to it. I don't care about /dev/sdb1 data.

I'm trying to follow this article https://www.golinuxhub.com/2014/03/how-to-remove-logical-and-physical.html

lvremove /dev/mapper/VolGroup01-LogVol00

but during the second command I get the following error

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

Also tried vgchange -an VolGroup01 and then vgreduce VolGroup01 /dev/sdb1 but still same error.

已采纳解答

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

You are trying to "reduce" a volume group to nothing. Instead, to delete it, use vgremove.

vgremove VolGroup01

Now you can remove the LVM volume label from the physical volume with pvremove.

pvremove /dev/sdb1

And now you can remove or repurpose the disk.

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

资料来源与适用范围

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

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

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