I'm trying to do a hot swap on a mirrored lvm.

$ vgdisplay -v /dev/vg00

   --- Physical volumes ---
PV Name                     /dev/dsk/c2t0d0s2
PV Status                   unavailable
Total PE                    4318
Free PE                     845
Autoswitch                  On
Proactive Polling           Off

PV Name                     /dev/dsk/c2t1d0s2
PV Status                   available
Total PE                    4318
Free PE                     845
Autoswitch                  On
Proactive Polling           Off

After swapping disks I run an ioscan to find the new device and then do a insf. I know it's the new disk because it shows as a HP instead of a Seagate.

$ ioscan -C disks

disk      1  0/1/1/0.0.0     sdisk      CLAIMED     DEVICE       HP 36.4GMAP3367NC
                        /dev/dsk/c2t0d0     /dev/dsk/c2t0d0s2   /dev/rdsk/c2t0d0
                        /dev/rdsk/c2t0d0s2  /dev/dsk/c2t0d0s1   /dev/dsk/c2t0d0s3  
                        /dev/rdsk/c2t0d0s1  /dev/rdsk/c2t0d0s3

disk      2  0/1/1/0.1.0     sdisk      CLAIMED     DEVICE       SEAGATE ST373307LC
                        /dev/dsk/c2t1d0     /dev/dsk/c2t1d0s2   /dev/rdsk/c2t1d0    
                        /dev/rdsk/c2t1d0s2  /dev/dsk/c2t1d0s1   /dev/dsk/c2t1d0s3   
                        /dev/rdsk/c2t1d0s1  /dev/rdsk/c2t1d0s3

So far it's going good. Then I hit my first snag.

$ vgcfgrestore -n /dev/vg00 /dev/rdsk/c2t0d0s2

vgcfgrestore: Could not open Physical Volume "/dev/rdsk/c2t0d0s2".

Maybe I needed to reduce the volume group first.

$ vgreduce /dev/vg00 /dev/dsk/c2t0d0s2

vgreduce: Physical volume "/dev/dsk/c2t0d0s2" could not be removed since some of its
physical extents are still in use.

How can some of the physical extents be in use? I pulled the old drive.

So then I thought maybe I need to create a physical volume first.

$ pvcreate -f -B /dev/rdsk/c2t0d0s2

pvcreate: Couldn't open physical volume "/dev/rdsk/c2t0d0s2":
I/O error

I can't create a pv from that partition of the drive but it'll let me from the main partition.

$ pvcreate -f -B /dev/rdsk/c2t0d0
Physical volume "/dev/rdsk/c2t0d0" has been successfully created.

Can someone please tell me what I'm missing. Why is the new disk still showing c2t0d0s1,c2t0d0s2, and c2t0d0s3? Why can't I do a pvcreate on c2t0d0s2? Why can't I do a 'vgcfgrestore' or a 'vgreduce'?


You first need to deactivate the physical volume:

# pvchange -a n /dev/dsk/c2t0d0s2

After that,

# vgcfgrestore -n /dev/vg00 /dev/rdsk/c2t0d0s2
# pvchange -a y /dev/dsk/c2t0d0s2

Don't do the pvcreate on the whole disk, that will screw up the disk layout.

  • I needed to to an idisk to format the system partitions. That's what I was missing. Then after doing a pvchange -a n I was off to the races. – Jeight Feb 3 '15 at 23:06
  • Yes, sure, you have to make the partitions with idisk before . Sorry for not mentioning it. – manolonte Feb 5 '15 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.