1827260 Members
2103 Online
109717 Solutions
New Discussion

Re: LVM mirroring

 
David Bellamy
Respected Contributor

LVM mirroring

hi
i have 2 hp disks mirrored to 2 hp disks.
the disks are 4GB and with a PEsize of 4MB,
if i want of increase /var and /opt will it unbalance my mirrors or is there an easy way to do it without breaking my mirrors. thanks
--- Physical volumes ---
PV Name /dev/dsk/c0t5d0
PV Status available
Total PE 1023
Free PE 473

PV Name /dev/dsk/c0t6d0
PV Status available
Total PE 1023
Free PE 107

PV Name /dev/dsk/c2t5d0
PV Status available
Total PE 1023
Free PE 473

PV Name /dev/dsk/c2t6d0
PV Status available
Total PE 1023
Free PE 107


4 REPLIES 4
John Palmer
Honored Contributor

Re: LVM mirroring

Hi David,

When you increase the size of a volume, just specify both the prinary disk and the mirror in the lvextend command...

For instance, if /opt is on c0t6d0 and mirrored onto c2t6d0 you need to

lvextend -L /dev/vg00/lvol? /dev/dsk/c0t6d0 /dev/dsk/c2t6d0

You don't have to break the mirrors.

Regards,
John
Johan Carlsson
Occasional Advisor

Re: LVM mirroring

Hi David,

Just to make you aware. After you have extended the logical volume with lvextend you will have to extend the filesystem and unless you have "online-jfs" installed you will have to unmount the logical volume (in many cases this means booting in single user mode).

After you have unmounted the filesystem you use the extendfs command:
extendfs -F vxfs /dev/vg00/rlvol6
(this is if /opt is at the default lvol6 and you use vxfs filesystem)

If you should have "online-jfs" installed you dont have to unmount the filesystem. After extending logical volume with lvextend you just use the fsadm command:

fsadm -F vxfs -b $(expr * 1024)

For example if you want to extend /opt to 2000 MB:

fsadm -F vxfs -b $(expr 2000 * 1024) /opt

Hope that this is of help to you.

Regards

Johan Carlsson
David Bellamy
Respected Contributor

Re: LVM mirroring

thanks all for ur kind responses.
by the way i tried it and it worked flawlessly. one thing i did notice tho
was that when i did an lvdisplay on all the lvs in that vg it wasnt in order any more
(pe was no longer in order, pe 405 was followed by pe 406, but when i increased it
took pe 1507 the last of the pes) any way i
can get around that next time or is that not
necessarily bad
Carlos Fernandez Riera
Honored Contributor

Re: LVM mirroring


it is not necesary bad.

You can arrange manualy, doing a lvreduce -m 0 each lvol for the second disk

then lvextend again.

Now your second disk is in order.

Do the same with the first.

But it will be not better than actual.


Now think in a VG containing 10 disks... and let LVM works.

unsupported