Operating System - HP-UX
1833758 Members
2361 Online
110063 Solutions
New Discussion

How to cleanup the old disk path

 
SOLVED
Go to solution
praveen..
Super Advisor

How to cleanup the old disk path

The fiber connections for HP-UX Servers was moved and When the storage and host connections are moved to new switches, the disk IDâ s for all servers will changed.The HBA connections for the hosts to the ESAN fiber channel fabrics was changed.


If I give the command â #vgdisplay â v /dev/vgXXâ & â # strings /etc/lvmtabâ , it shows the old disk path name (like c20t1d4)
While â # ioscan â fnC diskâ is showing the new disk path name (like c32t1d4).


Please find the attached files i.e. output of the below commands:

1. vgdisplay -v /dev/vgXX
2. strings /etc/lvmtab
3. ioscan -fnC disk
4. powermt display dev=all


Please let me know what i need to do:

1. The reboot of each server successfully created the new paths for each disk and imported the Volume groups with the new device IDâ s and paths.
So should i only cleanup / remove all of the dead paths? If Yes, How?

2. The powermt commands below will clear dead powerpath paths, but to fix the volume group, does I need to vgexport and vgimport the new disk back in?
# powermt check force
# powermt save

3. Should i restart the servers?

This is the same issue on 5 Servers (HP-UX 11iv1 & 11iv2)

Please suggest.

Thanks
6 REPLIES 6
Denver Osborn
Honored Contributor
Solution

Re: How to cleanup the old disk path

You should only have to reboot if something with your cleanup effort goes wrong...

I would start with the least critical of your 5 servers to do the cleanup on. Use that box to test and document your steps...

Steps to cleanup could be as simple as vgexport, powermt check, vgimport, rmfs.

1) pick a vg and export it
umount filesystems
vgchange -a n
(make note of /dev/vgname/group minor#)
vgexport -v -s -m /tmp/vgname.map /dev/vgname
2) cleanup powerpath (powermt check). only the devices not being used by LVM will be removed.
3) import the volume group
mkdir /dev/vgname
mknod /dev/vgname c 64 0x??0000 (minor number from before export)
vgimport -f /tmp/vginfile -m /tmp/vgname.map /dev/vgname
(/tmp/vginfile contains /dev/dsk/cXtXdX for the vg, otherwise import w/ -s but could take longer)
4) if you imported with "-s" option, remove the alternate links.
vgreduce /dev/vgname `vgdisplay -v /dev/vgname |grep Alternate |awk '{print $3}'
5) repeat

Once the volumes are good and powerpath is cleaned up, you can rmsf device special files. Use rmsf -k with care. It will remove DISK class devices from your ioscan output, but if you don't cleanup powerpath 1st you'll end up having to reboot to fix.

You also have the option to reduce the alternate links for all Volumes, then run powermt check to get rid of all the old devices except for the last PV in use. So rather than seeing 4 dead paths, you'd only see 1 until you perform the steps above.

Ask questions if you run into problems or are unsure of something.

Good luck,
-denver
praveen..
Super Advisor

Re: How to cleanup the old disk path

Hi,
These are production servers and I am not in condition to take the risk.

Please suggest

does restart will solve this issue.
Thanks
praveen..
Super Advisor

Re: How to cleanup the old disk path

Hi,
please suggest sothat I can solve this issue.
Thanks in advance
Mridul Shrivastava
Honored Contributor

Re: How to cleanup the old disk path

I will do the vgcfgrestore at the new path but deactiving vg would be required.

vgcfgrestore -n -o

I guess this should resolve the issue. make sure that u resotore the cfg on raw device and you have a last working cfg backup under /etc/lvmconf
Time has a wonderful way of weeding out the trivial
praveen..
Super Advisor

Re: How to cleanup the old disk path

Please help me to provide step by step commands,

I dont to lose my data.

Please go through the attachment which i already attached.

Thanks
Denver Osborn
Honored Contributor

Re: How to cleanup the old disk path

I had one more look, you can do this without an outage.

We'll start with one of the volume groups, do these steps then post your results. You should do this from the node where you collected the info that was posted (vg_display.txt powermt_display_dev=all.txt, etc...)

Let's use VG03 as the example...

# step 1, reduce the alternate links:

vgreduce /dev/vg03 `vgdisplay -v vg03 2>/dev/null |grep Alternate |awk '{print $3}'`

# step 2, add new paths for luns

vgextend /dev/vg03 /dev/dsk/c24t1d1
vgextend /dev/vg03 /dev/dsk/c24t1d2
vgextend /dev/vg03 /dev/dsk/c24t1d3

# step 3, reduce the last bad path

vgreduce /dev/vg03 /dev/dsk/c16t1d1
vgreduce /dev/vg03 /dev/dsk/c16t1d2
vgreduce /dev/vg03 /dev/dsk/c16t1d3

# step 4, remove dead devices from powerpath

powermt remove dev=c16t1d1
powermt remove dev=c16t1d2
powermt remove dev=c16t1d3
powermt save

# repeat the powermt remove for c18t1d1, d2, d3, c20t1d1, d2, d3, and c22t1d1, d2, d3

Now vg03 is done and power path should look a little cleaner.
Use this same concept for your other volume groups.


I broke it down doing one lun at a time to keep it simple as possible.

Hope this helps,
-denver