Operating System - Linux
1828838 Members
2854 Online
109985 Solutions
New Discussion

How do I remove a physical volume in RedHat Linux AS 4

 
Danesh Qureshi
Regular Advisor

How do I remove a physical volume in RedHat Linux AS 4

I have created a physical volume using the following command on my Linux server:-

pvcreate /dev/cciss/c0d1p1

How do remove the physical volume ?

I have tried using pvremove (see below) and receive an error. Can anyone help me?

[root@metis cciss]# pvremove -v /dev/cciss/c0d0p1
No physical volume label read from /dev/cciss/c0d0p1
Can't open /dev/cciss/c0d0p1 exclusively. Mounted filesystem?
[root@metis cciss]#
6 REPLIES 6
Vitaly Karasik_1
Honored Contributor

Re: How do I remove a physical volume in RedHat Linux AS 4

probably your physical volume part of some group?
heybails
Regular Advisor

Re: How do I remove a physical volume in RedHat Linux AS 4

What about using the fdisk command? Run fdisk /dev/cciss and then delete the partition by running option d and choosing the number of the partition.
"What the...?"
heybails
Regular Advisor

Re: How do I remove a physical volume in RedHat Linux AS 4

nevermind, that won't work. it's under LVM.
"What the...?"
heybails
Regular Advisor

Re: How do I remove a physical volume in RedHat Linux AS 4

Make sure everything is deleted out of the filesystem and unmount the filesystem created under the physical volume. That should free it up to run pvremove. You can also run it under the GUI system-config-lvm to see a good graph of how it's set up.
"What the...?"
Sung Oh
Respected Contributor

Re: How do I remove a physical volume in RedHat Linux AS 4

Hi Danesh,

Try "pvdisplay /dev/cciss/c0d1p1" to see if you have physical volume. And try "vgreduce my_volume_group /dev/cciss/c0d1p1" to remove your physical volume group.

Regards,
Sung
Jun Yu
Frequent Advisor

Re: How do I remove a physical volume in RedHat Linux AS 4

it's better to run #pvscan before you check the pv status by invoke #pvdisplay. #pvremove is still the best way to remove your exists pv.
just for fun