System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Extending mirrored logical volume

panks
Regular Advisor

Extending mirrored logical volume

Hi,
I want to extend /var file system by 500MB.
When I checked with vgdisplay -v vg00 I found that its mirrored as PV used are showinf as 2.
Can you please tell me how I can extend the file system for mirrored volume. I think fsadm would be the command but not sure for mirrored volume.
Thanks
10 REPLIES
SUDHAKAR_18
Trusted Contributor

Re: Extending mirrored logical volume

Steven E. Protter
Exalted Contributor

Re: Extending mirrored logical volume

Shalom,

Break the mirror.

lvextend -m 0
lvsplit can also be used.

lvextend -M

lvextend -m 1 < logical volume name> < disk name(s)> to rebuild the mirror.

Not breaking the mirror might lead to incomplete mirroring, or the logical volume not being complete in the event of a lost disk.

You would to extend the file system itself need to umount /var and run extendfs unless you have online JFS.

See Berd's response in this thread:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1080381

fsadm -F vxfs -b M

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Roopesh Francis_1
Trusted Contributor

Re: Extending mirrored logical volume

remove strict allocation using
#lvchange -C n lvname
split the logical volume
#lvsplit lvname
extend the logical volume
#lvextend -L size lvname
#lvextend -L size lvnameb
merge the logical volume
#lvmerge lvname lvnameb
extend the file system
#fsadm -F vxfs -b M fs
R.K. #
Honored Contributor

Re: Extending mirrored logical volume

Hi Panks,

You already got different procedures to extend /var when it is mirrored.

NOte: Used PV in vgdisplay can be 2 but that does NOT mean it is mirrored.....check with "lvdisplay /dev/vg00/xxxx" and look for mirror copies, if it is one that means its mirrored.

Regds,
R.K.
Don't fix what ain't broke
R.K. #
Honored Contributor

Re: Extending mirrored logical volume

Also before extending you can check the "Free PE" in vgdisplay o/p to know the free space available in the VG.

Regds,
R.K.
Don't fix what ain't broke
James R. Ferguson
Acclaimed Contributor

Re: Extending mirrored logical volume

Hi:

> SEP: Break the mirror. Not breaking the mirror might lead to incomplete mirroring, or the logical volume not being complete in the event of a lost disk.

What?!? There is NO NEED to break the mirror to extend the logical volume! This unnecessarily complicates your actions and creates a window (albeit small) where you have no high-availability and data protection.

To extend a filesystem housed in a mirrored logical volume, 'lvextend' the logical volume. All mirrors by default will be extended too. Then, enlarge the filesystem using 'fsadm' if you have OnlineJFS. If you lack OnlineJFS boot into single user mode and using the commands in '/sbin' perform an 'lvextend' and and 'extendfs'. A reboot afterwards is the simplest way to resume normal operations.

To see if a _logical_volume_ is mirrored, do:

# lvdisplay /dev/vgNN/lvolX

Look for "Mirror copies" greater than zero (0). If the number of mirror copies exceeds zero, the logical volume is mirrored.

Adding '-v' to the 'lvdisplay' will show you the physical volumes on which the mirrored extents live.

Regards!

...JRF...
Sharma Sanjeev
Respected Contributor

Re: Extending mirrored logical volume

Hi Panks

I agree with James, There is not need to break mirror.

1. Check for Mirror status with lvdisplay -v

than check for Free PE on Disk
than

lvextend -L 500
Than
fsadm

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
Patrick Wallek
Honored Contributor

Re: Extending mirrored logical volume

Why on earth does everyone insist on making this more complicated than it needs to be?

Saying that you need to un-mirror a mirrored LV or lvsplit a mirrored LV in order to extend it is patently ridiculous. There's absolutely no need to do any of that.

If you have free extents on ALL disks in the mirror then it is as simple as JRF has said above.

Anything else is unnecessarily complicated.
Vishu
Trusted Contributor

Re: Extending mirrored logical volume

I agree to James, Sanjeev and Patrick...

if you have online JFS, do it on fly. Even no need to unmount it.

Thanks
sarfaraj ahmad
Trusted Contributor

Re: Extending mirrored logical volume

hi,
if you are using default hpux file system then you can refer below procedure.
first check free PE,

1. Login via MP and login to CO
2. Boot the server into Single User mode.
# shutdown -ry now
4) The below message will come

To discontinue, press any key within 10 seconds.

When prompted, press "ESC" to interrupt the boot.

5) Boot from the primary device and invoke ISL interaction.

Main menu... > bo pri

NOTE: If prompted to interact with ISL, respond "Y"

6) Boot into single user mode
ISL> hpux -is

NOTE: Nothing will be mounted.

# fsck -y
# mount /var

7) Extend the logical volume that holds the filesystem.
# /sbin/lvextend -L 9760 /dev/vg00/lvol8

(NOTE: the -L option is the NEW size
The new size of /var will be 9760 MB)

8) Extend the file system.
#/sbin/extendfs -F vxfs /dev/vg00/rlvol8

NOTE: The use of the character device.(Check rlvol8)

9) Ensure the filesystem now reports to be the new size
# bdf

10) Reboot the system to its normal running state.
# shutdown -r now