Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding new disk to mirror lv

Status
Not open for further replies.

AIRAK

MIS
Jan 28, 2003
3
CR
Hi gurus,
I have four lvols mirrored at second disk. BUT, I don't have more room on disk. Obviously, I need to add a new disk, but I need another disk to mirror the new one disk.
Can I do:
1. pvcreate -b new_disk_source
2. pvcreate -b new_disk_mirror
3. vgextend vgdatos new_disk_source
4. lvextend -L 2000 /dev/vgdatos/lvdatos new_disk_source
5. vgextend vgdatos new_disk_mirror
6. lvextend -m1 /dev/vgdatos/lvdatos new_disk_mirror

All above work?

Can I time while extend lvdatos and then mirror on second disk?
I worried for, when I do lvextend on source disk the mirror implicitly try to extend on first mirror disk wich don't have enough room...!!!

Thanks all....
 
I don't know that you have to use the -b option with pvcreate.

Also, because the LV already exists, I'm not sure how LVM will handle the mirroring. I suspect it will start the mirroring to the disk you already have and then go to the second new disk you are bringing into the VG. There's nothing wrong with this, but if you don't want it like that, you could create a temporary LV on the "old" disks to use all of the free physical extents on the disks so that LVM can't use it for the mirroring when you extend lvdatos. Then remove the temporary LV after you are done.

There might be an easier, less klunky way to do this, but I think this will work for what it appears you want:

lvcreate -n vgdatos lvtemp (to create the temporary LV)
lvextend -L nn /dev/vgdato/lvtemp (nn is the size to fill the rest of the free physical extents on the old disks)
pvcreate -f /dev/rdsk/cXtXdX (first new disk)
pvcreate -f /dev/rdsk/cYtYdY (second new disk)
vgextend vgdatos /dev/dsk/cXtXdX /dev/dsk/cYtYdY
lvextend -L 2000 /dev/vgdatos/lvdatos /dev/dsk/cXtXdX

The mirroring will be done on the second new disk. Then remove the temporary logical volume you created.
 
Thanks for your answer and time.

Yes, I already have one disk 36Gb with mirror on other disk.
BUT, I need to add one new disk b/c the old disk is full.
The procedure above work fine, Can I have enought time between lvextend on second disk and the lvextend -m1 command on other new disk for mirror?

The point is: while I make a lvextend on second new disk, What happend while this command is trying to extend on second new disk, in background for while, the mirror/ux will trying to extend the same phisical extends on other disk whicho is not yet configurated. Have I time between those commands lvextend on second new disk and before lvextend -m1 on other new disk for mirror.

Other, Can I get errors by policity?

Thanks
 
This is an existing logical volume that is already mirrored, right?

Because it is already mirrored, when you extend it to the new_disk_source disk, it will automatically start mirroring to whatever disk is available in the volume group. You don't have to do the lvextend -m 1 command, because it has already been done for that logical volume.

That is why I suggested that if you don't want it to mirror anything to the old_mirror_disk or the old_source_disk, create a temporary logical volume on those disks (don't mirror that temporary logical volume because that takes too much time). So, all disks in the VG will be full before you bring in the new disks to the VG.

Then, you do your pvcreate to bring the two new disks into the VG. Then you extend the existing logical volume to new_source_disk. Because the LV is already mirrored, LVM will look for a disk to mirror the extension to. Since the temporary LV has taken up all the physical extents on the old disks, the only place it can mirror to is new_mirror_disk.

Don't forget to remove the temporary logical volume when you are done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top