Disk Arrays
cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing disk having the main mirror copy

John Jayaseelan
Super Advisor

Replacing disk having the main mirror copy

Hi,

Found the following procedure for replacing the mirror disk. Step 8 says make sure the disk to be replaced is associated with LV lvol14b, If the disk is to be replaced is associated with lvol14b,what would be the procedure. Does LV needs to be recreated.?
_____________
1. lvsplit the Logical Volume (LV) that is mirrored.

2. pvcreate /dev/rdsk/c0t11d0 the disks associated with lvol14:

c3t5d0
c3t6d0
c4t5d0 <- remove
c4t6d0 <- remove

3. Add new disks:

c0t11d0
c0t13d0

4. Prepare the disks for being used in the Logical Volume Manager (LVM):

pvcreate /dev/rdsk/c0t11d0
pvcreate /dev/rdsk/c0t13d0

5. Add the new disks to the VG:

vgextend /dev/vg_orlistat /dev/dsk/c0t11d0
vgextend /dev/vg_orlistat /dev/dsk/c0t13d0

6. umount /dev/vg_orlistat/lvol14

7. Split the mirror of lvol14 to create lvol14 and lvol14b1.

lvsplit /dev/vg_orlistat/lvol14

8. Verify the disks you want to reduce out of the VG are associated
with lvol14b by doing a:

lvdisplay -v /dev/vg_orlistat/lvol14b.

9. Remove the old mirror of lvol14:

lvremove -f /dev/vg_orlistat/lvol14b

10. Reduce out the old disks from the VG:

vgreduce /dev/vg_orlistat /dev/dsk/c4t5d0
vgreduce /dev/vg_orlistat /dev/dsk/c4t6d0

11. Extend the lvol14 to 1 mirror on the new disks:

lvextend -m 1 /dev/vg_orlistat/lvol14 /dev/dsk/c0t11d0
/dev/dsk/c0t13d0

The lvol should now sync up and then it can be mounted.
________________________

Thanks
John Jayaseelan
7 REPLIES
John Jayaseelan
Super Advisor

Re: Replacing disk having the main mirror copy

Found the following procedure for replacing the mirror disk. Step 8 says make sure the disk to be replaced is associated with LV lvol14b, If the disk is to be replaced is associated with lvol14,what would be the procedure. Does LV needs to be recreated.?
Michael Steele_2
Honored Contributor

Re: Replacing disk having the main mirror copy

This is not the proceedure for replacing a mirroed drive. So I'm not sure what to infer from 8. However, you can sync up logical volumes two ways:

# vgsync vg##
# lvsync /dev/vg##/lvol#

Here's a better procedure for replacing mirrored disks:

1) vgcfgrestore -n /dev/vg## /dev/rdsk/cXtYdZ

2) vgchange -a y /dev/vg##

3) vgsync /dev/vg##
Support Fatherhood - Stop Family Law
John Jayaseelan
Super Advisor

Re: Replacing disk having the main mirror copy

Hi,

Found the following procedure for replacing the mirror disk. Step 8 says make sure the disk to be replaced is associated with LV lvol14b, If the disk is to be replaced is associated with lvol14,what would be the procedure. Does LV needs to be recreated.?
_____________
1. lvsplit the Logical Volume (LV) that is mirrored.

2. pvcreate /dev/rdsk/c0t11d0 the disks associated with lvol14:

c3t5d0
c3t6d0
c4t5d0 <- remove
c4t6d0 <- remove

3. Add new disks:

c0t11d0
c0t13d0

4. Prepare the disks for being used in the Logical Volume Manager (LVM):

pvcreate /dev/rdsk/c0t11d0
pvcreate /dev/rdsk/c0t13d0

5. Add the new disks to the VG:

vgextend /dev/vg_orlistat /dev/dsk/c0t11d0
vgextend /dev/vg_orlistat /dev/dsk/c0t13d0

6. umount /dev/vg_orlistat/lvol14

7. Split the mirror of lvol14 to create lvol14 and lvol14b1.

lvsplit /dev/vg_orlistat/lvol14

8. Verify the disks you want to reduce out of the VG are associated
with lvol14b by doing a:

lvdisplay -v /dev/vg_orlistat/lvol14b.

9. Remove the old mirror of lvol14:

lvremove -f /dev/vg_orlistat/lvol14b

10. Reduce out the old disks from the VG:

vgreduce /dev/vg_orlistat /dev/dsk/c4t5d0
vgreduce /dev/vg_orlistat /dev/dsk/c4t6d0

11. Extend the lvol14 to 1 mirror on the new disks:

lvextend -m 1 /dev/vg_orlistat/lvol14 /dev/dsk/c0t11d0
/dev/dsk/c0t13d0

The lvol should now sync up and then it can be mounted.
________________________

Thanks
John Jayaseelan
Michael Steele_2
Honored Contributor

Re: Replacing disk having the main mirror copy

Sigh.....

This procedure has nothing to do with replacing a bad mirror. The LOGICAL VOLUME DOES NOT NEED TO BE RECREATED. JUST USE 'vgcfgrestore'. See above.

Regarding "... Does LV needs to be recreated.?..."

- No.

That's what 'vgcfgrestore' will do. See previous message.

Regarding "...lvsplit the Logical Volume (LV) that is mirrored...."

- No.

'lvsplit' works when disks are responding, not dead. You can lvreduce it out with the PV Number but this is extreme.

As I read the rest of this procedure I start to infer that its meant for substituting smaller disks with larger. See #10 and vgreduce.

So again, ignore this procedure and,

Thanks!
Support Fatherhood - Stop Family Law
John Jayaseelan
Super Advisor

Re: Replacing disk having the main mirror copy

Michael,

The disks are to be replaced for substituting smaller disks with larger. That is the reason why want to use lvsplit. If the disk to be removed holds the main mirror copy 'lvol1' what needs to be done.

Thanks
DGH_2
Valued Contributor

Re: Replacing disk having the main mirror copy

Hi
it depends if your disk that should be replaced is a root disk or not.

i understand here that you have a non root disk. this is the procedure:
if it's hot swap then replace the disk and do:

- pvcreate -f /dev/rdsk/cXtYdZ
- vgcfgrestore -n /dev/vgxx /dev/rdsk/cXtYdZ

- vgchange -a y /dev/vg
here the volume group will synchronize automatically and if not do
- vgsync /dev/vgxx

please advice if it is a root disk.
Regards
Michael Steele_2
Honored Contributor

Re: Replacing disk having the main mirror copy

Run vgdisplay and note PE_SIZE and MAX_PE values which have defaults of 4 mb and 1016. These values are fine for small disk up ~36 GB. Greater sizes need larger values. So going smaller will only be an issue at the file system level when copying over the data: Do I have enough room? At the LVM level there should be no issue. But if you want to be certain then there would still be a different procedure to follow then the one you've outlined. Here is the best way to make sure:

- Make a new volume group with the new disks.
- Make temporary mount points, (* mkdir *)
- And copy the data over between old and temporary mount points, then,
- Update /etc/fstab giving the new vg the old mount points.

This procedure would have the added benefit of defragmenting all of old data when copying it over into the new file system.


Support Fatherhood - Stop Family Law