Operating System - HP-UX
1827458 Members
5011 Online
109965 Solutions
New Discussion

Re: Clean the LVM structure after removing a package

 
Wei_9
Occasional Advisor

Clean the LVM structure after removing a package

What should be done to clean the LVM (VG and
disks - we are using SAN XP disk) after a package is removed from the MCSG environment?

During the process, are there any particular
steps needed attention?

Thanks.
8 REPLIES 8
RAC_1
Honored Contributor

Re: Clean the LVM structure after removing a package

How did you remove the package?
Did you use cmapplyconf?

Once package has been deleted, you use pvcreate command on those disks and use these disks.

If you are talking abt destroying whole data on disks, you can use mediainit command. Also there is one Gnu utility available for this.

Also a simple dd will erase data on disks.

dd if=/dev/null of=/dev/rdsk
There is no substitute to HARDWORK
Helen French
Honored Contributor

Re: Clean the LVM structure after removing a package

If you want to get rid of LVM defenitions on a disk:

# lvremove lv_name (repeat for all LVs in that PV)

# vgremove vg_name (if that disk in the only one on that VG) OR
# vgreduce pv_name (if that disk is part of a VG)
Life is a promise, fulfill it!
Marco Santerre
Honored Contributor

Re: Clean the LVM structure after removing a package

Just to add to Shiju.. if you really want nothing on your disks at all, once you are done with the vgremove, issue :

pvremove /dev/rdsk/alldisksinvg
Cooperation is doing with a smile what you have to do anyhow.
Jim Carter_1
Advisor

Re: Clean the LVM structure after removing a package

By cleaning, I assume you mean removing the filesystems, data, logical volumes, and volume groups. Under that assumption, here's a list of some steps to take:

1) make absolutely sure you have a backup copy of the data because after we delete it is too late to realize they want historical references.

2) In the package control script you will find a list of the logical volumes and mount points it used. Unmount those mount points (should already be done) to free up the LVs.

3) If the VG is still active, skip this step otherwise activate the VG using vgchange -a e .

4) Remove the logical volumes using the lvremove command.

5) Reduce the volume group to a single LUN using the vgreduce command.

6) Remove the volume group using the vgremove command.

7) on every node that hosted this package - vgexport the volume group which will remove it from the /dev directory and also the lvmtab directories.

8) clean up the /etc/lvmpvg file if it exists using an editor

Note: if you want to scrub the disks first, then after step 1, activate the volume group, mount the file systems, and using /dev/zero write over all of the data on the file systems. This is usually not done except by the most paranoid among us.
Just because I'm paranoid doesn't mean they're not out to get me
Sanjay_6
Honored Contributor

Re: Clean the LVM structure after removing a package

Hi Wei,

Once the SG package has been removed, make the vg non-cliuster aware. Then remove the vg and do a dd to the disk to destroy all the info from the disks which were part of that VG.

to make the vg cluster un-aware,

vgchange -c n /dev/vg_name

export the vg,

vgexport /dev/vg_name

now for all the disks that were part of the VG,

dd if=/dev/null of=/dev/rdsk/cxtydz bs=1024k

This will destroy all the info on the disks.

Hope this helps.

Regds
Geoff Wild
Honored Contributor

Re: Clean the LVM structure after removing a package

Here's what I'm about to do:

1. Shutdown package via cluster commandscmhaltpkg sappkg
2. Stop nfs/sbin/init.d/nfs.client stop/sbin/init.d/nfs.server stop/sbin/init.d/nfs.core stop
3. Delete the package
cmdeleteconf -p sapapkg
4. Remove cluster membership
vgchange -c n /dev/vg30
vgchange -c n /dev/vg31
vgchange -c n /dev/vg32
6. Export SAP volumes (from server4, server3, backupserver)
vgexport /dev/vg30
vgexport /dev/vg31
vgexport /dev/vg32
7. Remove access to disks on EMC
8. rmsf device files
9. Remove /etc/cmcluster/SAP

Not actually cleaning the disks - as they are going to be used by another server....

But, if you were to pvcreate -f them and add them to a new temp vg, then create 1 big filesystem on them, you would wipe out the disks...after created - just vgexport it....


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Wei_9
Occasional Advisor

Re: Clean the LVM structure after removing a package

what's the different between
vgremove and vgexport for removing the
VGs?
Sanjay_6
Honored Contributor

Re: Clean the LVM structure after removing a package