Operating System - HP-UX
1832567 Members
5186 Online
110043 Solutions
New Discussion

Re: Change SCSI ID on LVM disk

 
SOLVED
Go to solution
Tom Jackson
Valued Contributor

Change SCSI ID on LVM disk

Hi:

I want to change the SCSI ID on two disks. Both are logical volumes. The current IDs are 12 and 14 and I want to make them 6 and 5. I am adding two SE devices to the SCSI bus, so the 12 and 14 addresses won't work. The two disks mirror the two internal disks on the system, so I'm not too concerned about the contents. On the other hand, I don't have a tape drive, so the mirror disks are the only way for me to recover the system and data. I'm concerned about corrupting the logical volumes and getting the system to recognize the new addresses.

Is there a safe way to do this?:-/

Please help!

Tom
11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: Change SCSI ID on LVM disk

Tom,

From your earlier question, I'm assuming these are the external drives. What kind of drives are they? Are they in some kind of storage enclosure? Generally, to change the SCSI id, you either have a thumbwheel selector on the enclosure or jumpers on the drive itself but without knowing exactly what we're dealing with, it's kind of hard to say.

Pete

Pete
Pete Randall
Outstanding Contributor

Re: Change SCSI ID on LVM disk

Tom,

It also occurs to me that what you're really asking is how do you do this without trashing the LVM configuration.

If that's the case, I've still got a couple of questions. Are these external drives in the same VG as your internals? If so, I think you should lvremove them from the VG, then add them back in after you've changed the SCSI id. If they're in a different VG, you could use vgexport/vgimport.

Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: Change SCSI ID on LVM disk

This is rather straightforward and safe. You first need to unmirror each LVOL using lvreduce -m 0 /dev/vgxx/lvol1 /dev/dsk/c1t12d0. Do this for each LVOL and make sure that you specify the correct disk. Next you do a vgreduce to remove each of the mirror drives from the VG.

You can then shutdown and change the SCSI ID's. Boot and run insf -e to create the new device nodes. At this time, you should be able to run ioscan -C disk -fn and see the new devices. Next, do a pvcreate -f (-B also if one of these is an alternate boot disk) on each of the renumbered drives. Next, do a vgextend to add each of these new PV's to the VG. Finally, do an lvextend -m 1 /dev/vgxx /dev/c1t5d0 for each of the mirror disks.

Man lvreduce, vgreduce, pvcreate, vgextend, lvextend, and insf before doing any of this so that you better understand the process.

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Change SCSI ID on LVM disk

This is rather straightforward and safe. You first need to unmirror each LVOL using lvreduce -m 0 /dev/vgxx/lvol1 /dev/dsk/c1t12d0. Do this for each LVOL and make sure that you specify the correct disk. Next you do a vgreduce to remove each of the mirror drives from the VG.

You can then shutdown and change the SCSI ID's. Boot and run insf -e to create the new device nodes. At this time, you should be able to run ioscan -C disk -fn and see the new devices. Next, do a pvcreate -f (-B also if one of these is an alternate boot disk) on each of the renumbered drives. Next, do a vgextend to add each of these new PV's to the VG. Finally, do an lvextend -m 1 /dev/vgxx /dev/c1t5d0 for each of the mirror disks.

You will also need to run mkboot on this disk if it is an alternate boot disk. You should be able to search on "mirror boot disk" to find several recipes for this process.

Man lvreduce, vgreduce, pvcreate, vgextend, lvextend, and insf before doing any of this so that you better understand the process.



If it ain't broke, I can fix that.
Pete Randall
Outstanding Contributor

Re: Change SCSI ID on LVM disk

Clay,

Tom is manually mirroring with dd, so he can just blow them away.

Pete

Pete
Tom Jackson
Valued Contributor

Re: Change SCSI ID on LVM disk

Hi Pete:

The two drives that I want to change the address on are external.

All four disks on the system are Seagate ST336704LC.

J6 sets the ID and I have the settings.

And YES! I don't want to trash logical volumes.

I have one VG for each of the four disks on the system. The external disks are vg02 and vg02, the internal disks are vg00 and vg01.

Tom
Tom Jackson
Valued Contributor

Re: Change SCSI ID on LVM disk

Pete:

And yes, I think I want to do a vgexport/import, but I had problems doing that a couple years back and I'm a little gunshy. Can I get some insight on how it should work?

Tom
Pete Randall
Outstanding Contributor
Solution

Re: Change SCSI ID on LVM disk

Tom,

Here's the plan, then:

vgexport -s -m /tmp/vg02map /dev/vg02

change SCSI id's

mkdir /dev/vg02

mknod /dev/vg02/group c64 0x020000

vgimport -s -m /tmp/vg02map /dev/vg02


That should do it.

Pete

Pete
Pete Randall
Outstanding Contributor

Re: Change SCSI ID on LVM disk

Tom,

One more thing, I haven't noticed what version of the OS you're running, so, if it's pre 11.x, you might not be able to use the -s option. In that case your vgimport will have to identify the disks: vgimport -v /dev/vg02 /dev/dsk/c0t1d0 /dev/dsk/c0t3d0



Pete

Pete
Tom Jackson
Valued Contributor

Re: Change SCSI ID on LVM disk

Hi again Pete:

I'm running 11i. Should be set.

Thanks again!

Tom ;)
Pete Randall
Outstanding Contributor

Re: Change SCSI ID on LVM disk

Tom,

Good luck.


Pete

Pete