Operating System - HP-UX
1825768 Members
3533 Online
109687 Solutions
New Discussion

Re: increase size of a logical volume that is already mirrored

 
SOLVED
Go to solution
Marc Ahrendt
Super Advisor

increase size of a logical volume that is already mirrored

is the following procedure OK to increase /home from 2GB to 4GB knowing that the 2GB are mirrored to another disk
(i want to do this online!)

lvreduce -m 0 /dev/vg00/lvolhome /dev/dsk/c1t0d0
lvextend -L 4000 dev/vg00/lvolhome /dev/dsk/c2t0d0
lvextend -m 1 /dev/vg00/lvolhome /dev/dsk/c1t0d0
fsadm -F vxfs -b 4000M /home

...or is there a more efficient way?
NOTE: not needing contiguous PEs ...thankfully
hola
8 REPLIES 8
Michael Tully
Honored Contributor

Re: increase size of a logical volume that is already mirrored

Hi,

If you are just increasing the LV on the same
disk as before and there is enough disk space
there is no need to actually reduce the mirror.

All you need to do is the
# lvextend -L 4096 /dev/vg00/lvolhome (4Gb)
and the fsadm to increase the filesystem size.

HTH
-Michael
Anyone for a Mutiny ?
Sanjay_6
Honored Contributor

Re: increase size of a logical volume that is already mirrored

Hi Marc,

Do you have 2 GB of free space on both the disks c2t0d0 and c1t0d0. If you have, then the command should are okay.

I'm not using online jfs myself, so i can't say anything about the last command "fsadm", but if you are not using online JFS, then you have to use extendfs in place of "fsadm".

hope this helps.

thanks
James R. Ferguson
Acclaimed Contributor

Re: increase size of a logical volume that is already mirrored

Hi Marc:

There is no need to reduce (eliminate) the mirror. You can extend the logical volume and mirrored extents will be created automatically.

Remember to make sure that you have (and you probably do have, because this is the default) a 'strict' allocation policy is in force. That is, mirrors of a logical extent cannot share the same physical volume. If necessary, this can be set or changed by 'lvchange'.

Regards!

...JRF...


Sanjay_6
Honored Contributor
Solution

Re: increase size of a logical volume that is already mirrored

Hi Marc,

In my post, i omitted one thing. If you want that the mirror should be on c1t0d0 only, then you should do lvreduce -m 0, else you can simply do a lvextend and the mirror will also get extended in that VG. If you using a pvg strict mirroring, the mirror will be on a different disk/path.

remember you have to do a lvreduce only if you want that the mirror copy after extendng the volume the volume should be on a particular disk only.

If you don't do lvreduce and just do a lvextend and fsadm/extendfs, there is no gurantee that the mirror will be on the disk you want, even if you have a pvg strict mirroring in place (and if you have more that 1 pv in each set of disks).

Hope this helps.

Thanks
A. Clay Stephenson
Acclaimed Contributor

Re: increase size of a logical volume that is already mirrored

Hi Marc:

There is no need whatsoever to do the lvreduce and in fact why make yourself vulnerable. That is what the mirror is for even for the brief time involved. The other way to do this is via SAM; it will extent the lvol for you and extend the filesystem. Before I ever let SAM do this for me, I looked through every piece of the code and it is solid. One tip: Make certain that there is a .fsadm under /home/lost+found or the filesystem extend will fail. Two tip: Why not move /home to another volume group - there is no need or requirement that it be in vg00.

Regards, Clay
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: increase size of a logical volume that is already mirrored

Your message indicates that you have enough space on the mirror disk c2t0d0. So, you don't have to worry about reducing the mirror. Just use lvextend and fsadm commands. They will take care of extending the mirror too.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Marc Ahrendt
Super Advisor

Re: increase size of a logical volume that is already mirrored

to all: i forgot to mention that there are 4 PVs in vg00, and that each PV has more than enough free PEs

Michael: i think i need to reduce the mirror because of having 4 PVs in vg00 ...thx for reminding me that 4GB is better represented as 4096

Sanjay: thx for pointing out that i did not mention how many PVs i had and how much free PEs they had! and based on my situation i think i need to do what you said and "lvreduce -m 0 ..." my LV first!

James: thx for pointing out the need for "strict" allocation. also i want to control where the mirrored PEs go since there are 4 PVs. if i just do a lvextend then i am not guaranteed that the same 2 PVs will be used to extend the LV (sorry on my part for not stating better my environment)

Clay: SAM is solid but SAM uses the "Default Allocation Policy" which to me is not solid. also i do not have a file called /home/lost+found/.fsadm and have never even heard of that requirement before?? are you sure i need that file? also i agree about /home not needing to be in vg00, but on this small system all the PVs are owned by vg00!

Sridhar: thx for pointing out like some others that lvextend does take care of mirroring automatically. it is just that i want to control what PV gets the mirrored PEs.
hola
Hai Nguyen_1
Honored Contributor

Re: increase size of a logical volume that is already mirrored

Clay and Marc,

the man page fsadm_vxfs (paragraph 3 from the bottom of page 4) states that "... When fsadm is invoked, it opens the file lost+found/.fsadm in the root of the file system specified by mount_point. If the file does not exist, it is created..."

Regards,
Hai