Search This Blog

Wednesday, February 27, 2013

Reducing the mirror of Logical Volume using PV Key of the disk



Replaced Disk was not coming in available state:

Following below mirror disk was in defective

/dev/dsk/c0t6d0

   PV Name                     /dev/dsk/c0t6d0
   PV Status                   unavailable              
   Total PE                    1023    
   Free PE                     0       
   Autoswitch                  On        

After Disk Replacement dd command was working fine, but still the disk was not coming in available state.

dd if=/dev/rdsk/c0t6d0 of=/dev/null bs=1024

root@hosttest1# dd if=/dev/rdsk/c0t6d0 of=/dev/null bs=1024
553+0 records in
553+0 records out


Forcefully Reducing the disk from vg00

# vgreduce -l /dev/vg00 /dev/dsk/c0t6d0

root@hosttest1# pvcreate -f /dev/rdsk/c0t6d0
Physical volume "/dev/rdsk/c0t6d0" has been successfully created.
root@hosttest1# vgextend /dev/vg00 /dev/dsk/c0t6d0
Volume group "/dev/vg00" has been successfully extended.


Reducing the mirror of  Logical Volume using PV Key of the disk

I see that c0t6d0 is in available state but probably it doesnt contain the full information about vg
you can run a lvdisplay -v -k lvolname to find the pvkey identify the PV key number of the failed disk c0t6d0 and then run a lvreduce with -k option to remove c0t6d0


root@hosttest1# lvdisplay -v /dev/vg00/lvol4|more
--- Logical volumes ---
LV Name                     /dev/vg00/lvol4
VG Name                     /dev/vg00
LV Permission               read/write   
LV Status                   available/stale           
Mirror copies               1            
Consistency Recovery        MWC                 
Schedule                    parallel     
LV Size (Mbytes)            12              
Current LE                  3         
Allocated PE                6           
Stripes                     0       
Stripe Size (Kbytes)        0                   
Bad block                   on           
Allocation                  strict                    
IO Timeout (Seconds)        default             

   --- Distribution of logical volume ---
   PV Name            LE on PV  PE on PV  
   /dev/dsk/c2t6d0    3         3         

   --- Logical extents ---
   LE    PV1                PE1   Status 1 PV2                PE2   Status 2 
   00000 /dev/dsk/c2t6d0    00494 current  ???                00494 stale    
   00001 /dev/dsk/c2t6d0    00495 current  ???                00495 stale    
   00002 /dev/dsk/c2t6d0    00496 current  ???                00496 stale    

Here the mirror PE status is showing stale, which was on failed disk c0t6d0

root@hosttest1# lvdisplay -v -k /dev/vg00/lvol4
--- Logical volumes ---
LV Name                     /dev/vg00/lvol4
VG Name                     /dev/vg00
LV Permission               read/write   
LV Status                   available/stale           
Mirror copies               1            
Consistency Recovery        MWC                 
Schedule                    parallel     
LV Size (Mbytes)            12              
Current LE                  3         
Allocated PE                6           
Stripes                     0       
Stripe Size (Kbytes)        0                   
Bad block                   on           
Allocation                  strict                    
IO Timeout (Seconds)        default             

   --- Distribution of logical volume ---
   PV Name            LE on PV  PE on PV  
   /dev/dsk/c2t6d0    3         3         

   --- Logical extents ---
   LE    PV1                PE1   Status 1 PV2                PE2   Status 2 
   00000      0             00494 current       3             00494 stale    
   00001      0             00495 current       3             00495 stale    
   00002      0             00496 current       3             00496 stale


So The PV Key of disk 
lvreduce -k -m 0 /dev/vg00/lvol4 3



root@hosttest1# lvreduce -k -m 0 /dev/vg00/lvol4 3
Logical volume "/dev/vg00/lvol4" has been successfully reduced.

root@hosttest1# lvdisplay -v /dev/vg00/lvol4|more
--- Logical volumes ---
LV Name                     /dev/vg00/lvol4
VG Name                     /dev/vg00
LV Permission               read/write   
LV Status                   available/syncd           
Mirror copies               0            
Consistency Recovery        MWC                 
Schedule                    parallel     
LV Size (Mbytes)            12              
Current LE                  3         
Allocated PE                3           
Stripes                     0       
Stripe Size (Kbytes)        0                   
Bad block                   on           
Allocation                  strict                    
IO Timeout (Seconds)        default             

   --- Distribution of logical volume ---
   PV Name            LE on PV  PE on PV  
   /dev/dsk/c2t6d0    3         3         

   --- Logical extents ---
   LE    PV1                PE1   Status 1 
   00000 /dev/dsk/c2t6d0    00494 current  
   00001 /dev/dsk/c2t6d0    00495 current  
   00002 /dev/dsk/c2t6d0    00496 current  


No comments:

Post a Comment