Skip to contentSkip to conversation

how to remove PV from a VG?

linux-lvm Adrien Farkas 3 participants 4 messages Oct 19, 1999 – Oct 20, 1999

lore
Share & tools
lore
#0 lore raw

Hey folks,

the subject says it (almost) all, I need to remove three PVs that were added to my VG by mistake (namely /dev/sdi, /dev/sdj and /dev/sdk), I guess you see where the error is. I can access data on previous PVs (yet), but don't know how to remove PVs, there is nothing linke 'pvremove'. I can assure you there is no data (perhaps except signature) on those disks.

Another question regarding devfs, some time ago a guy had a problem with devfs and 'smart' libs and Heinz pointed him to mailing list archives to look for patches. I did so, too (because I have tha same probs) but didn't find anything regarding this issue, anyone can help me with this?

THanks in advance,

Signature · 6 lines
                                             freddy

----==-- _                      Adrien "freddy" Farkas
---==---(_)__  __ ____  __       [email protected]
--==---/ / _ \/ // /\ \/ /  We all know Linux is great... It
-=====/_/_//_/\___/ /_/\_\  does infinite loops in 5 seconds
#1 lore raw
Quoted 3 lines

Hey folks,

Hi Freddy.

Quoted 2 lines

the subject says it (almost) all, I need to remove three PVs that were added to my VG by mistake (namely /dev/sdi, /dev/sdj and /dev/sdk), I guess you see where the error is. I can access data on previous PVs (yet), but don't know how to remove PVs, there is nothing linke 'pvremove'. I can assure you there is no data (perhaps except signature) on those disks.

vgreduce YourVG /dev/sd[i-k]

- or, if the 3 partitions hold the only empty PVs of YourVG -

vgreduce -a YourVG

Quoted 1 line

Another question regarding devfs, some time ago a guy had a problem with devfs and 'smart' libs and Heinz pointed him to mailing list archives to look for patches. I did so, too (because I have tha same probs) but didn't find anything regarding this issue, anyone can help me with this?

I don't recall if it was me 8*)

If you refer to the code in tools/lib/pv_read_all_pv.c which tried to optimize performance while scanning the device special files, you can comment out lines 103-105 and 107 to fix this.

HTH.

Regards,
Heinz
--

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Systemmanagement CS-TS T-Nova
Entwicklungszentrum Darmstadt
Heinz Mauelshagen Otto-Roehm-Strasse 71c
Senior Systems Engineer Postfach 10 05 41

                                                 64205 Darmstadt
[email protected]                      Germany
                                                 +49 6151 886-425
                                                          FAX-386

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 6 lines · Heinz Mauelshagen
Quoted 3 lines

Hey folks,

Hi Freddy.

Quoted 8 lines
Quoted 2 lines

the subject says it (almost) all, I need to remove three PVs that were added to my VG by mistake (namely /dev/sdi, /dev/sdj and /dev/sdk), I guess you see where the error is. I can access data on previous PVs (yet), but don't know how to remove PVs, there is nothing linke 'pvremove'. I can assure you there is no data (perhaps except signature) on those disks.

vgreduce YourVG /dev/sd[i-k]

- or, if the 3 partitions hold the only empty PVs of YourVG -

vgreduce -a YourVG

yes, helped quite enough, just the /dev/sd[ghi] devices are still in list of valid PVs and when I run pvscan my partitions get destroyed (I suppose because of rewriting LVM marker to the device). How do I really, physically remove the devices from the PV list?

Thanks in advance,

Signature · 6 lines
                                             freddy

----==-- _                      Adrien "freddy" Farkas
---==---(_)__  __ ____  __       [email protected]
--==---/ / _ \/ // /\ \/ /  We all know Linux is great... It
-=====/_/_//_/\___/ /_/\_\  does infinite loops in 5 seconds
#3 lore raw
Quoted 6 lines · Adrien Farkas
Quoted 5 lines · Heinz Mauelshagen
Quoted 2 lines

the subject says it (almost) all, I need to remove three PVs that were added to my VG by mistake (namely /dev/sdi, /dev/sdj and /dev/sdk), I guess you see where the error is. I can access data on previous PVs (yet), but don't know how to remove PVs, there is nothing linke 'pvremove'. I can assure you there is no data (perhaps except signature) on those disks.

vgreduce YourVG /dev/sd[i-k]

Quoted 8 lines
Quoted 3 lines

- or, if the 3 partitions hold the only empty PVs of YourVG -

vgreduce -a YourVG

yes, helped quite enough, just the /dev/sd[ghi] devices are still in list of valid PVs and when I run pvscan my partitions get destroyed (I suppose because of rewriting LVM marker to the device). How do I really, physically remove the devices from the PV list?

or, if you aren't using partitions, write over the front of the drive with:

dd if=/dev/zero of=/dev/sdg bs=1024 count=5

I'm not sure how much is actually needed to be overwritten, I normally just don't put a limit on it and hit ctrl-c after awhile. (or let it run to the end of the drive...)

Signature · 3 lines
Ryan Murray ([email protected], [email protected])
Software Designer, Glenayre Technologies Inc.
The opinions expressed here are my own.