1836752 Members
2691 Online
110109 Solutions
New Discussion

Removing Disks

 
Mike_21
Frequent Advisor

Removing Disks

I am removing some disks from a Jamaica box. What is the best way to remove all the information from the lvmtab, etc, files? The disks will be removed and used for something else, so the information can be destroyed.

Does deactivate the volume group do the trick? It doesn't look like it, asthere are still references in the /etc/lvmtab file.

Thanks
7 REPLIES 7
harry d brown jr
Honored Contributor

Re: Removing Disks

dd if=/dev/zero of=devicepath count=howmanyblocksondisk

a block is 512 chracters


have fun!!!!!!!!


live free or die
harry
Live Free or Die
James R. Ferguson
Acclaimed Contributor

Re: Removing Disks

Hi Mike:

The easist method is to 'vgexport' the volume group. This will perform the necessary maintenance to /etc/lvmtab and remove the /dev files.

Regards!

...JRF...
Sanjay_6
Honored Contributor

Re: Removing Disks

Hi Mike,

If the disk(s) you are removing belong to one single VG and there are no other disk(s) in that VG other than the one you are removing, do a vgexport for the vg and that will remove all the information for those disk and the VG concerned from the system. If you do not want to remove the Vg but just want to remove some disks from the VG, do a vgreduce. This will remove the disk info from the VG and from the other system files. If you want to scrap all the info on the disk, do a "dd" as suggested by harry and this will destroy the data on the disk. do a "man dd" for info on the dd command.

Hope this helps.

Regds
Helen French
Honored Contributor

Re: Removing Disks

Hi Mike,

First of all, you have to find the VG information on the specific disks you are going to remove. Do:
# pvdisplay -v /dev/dsk/cxtxdx

If the disks are part of a single VG, then you can do 'vgexport' or 'vgremove'. Or else, you have to do 'vgreduce' to remove each physical volume. Remember to take backups of file systems, if the FS spans on different disks.

HTH,
Shiju
Life is a promise, fulfill it!
T. M. Louah
Esteemed Contributor

Re: Removing Disks

.. When you say removing disks? , if they belong to some vg, u need to:
# vgreduce /dev/vgname /dev/dsk/cXtYdZ
Force reduction of missing PVs from volume group: vg01
vgreduce -f /dev/vg01
# vgscan -v will recreate lvmtab

G'd luck
t++
Little learning is dangerous!
Darrell Allen
Honored Contributor

Re: Removing Disks

Hi Mike,

vgexport will not cleanup /etc/fstab. You will have to do that manually or either remove the logical volumes before vgexporting. SAM does this nicely.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Kenny Chau
Trusted Contributor

Re: Removing Disks

Hi Mike,

First of all, you have to remove all the LVs under that VG. Then vgremove the VG by command "vgremove /dev/vgXX". Do an "strings /etc/lvmtab" and you will not see the VG in the lvmtab file. Then you can shutdown the machine and unplug the harddisk.

Hope this helps.
Kenny.
Kenny