Operating System - HP-UX
1753828 Members
8512 Online
108806 Solutions
New Discussion юеВ

Filesystem extend on a mirrored VG

 
SOLVED
Go to solution
kcw
Advisor

Filesystem extend on a mirrored VG

Hi all,
I have got a question while I am trying to extend a filesystem which is already mirrored.

For example, I have a file system /abc which is mounted on the following path: /dev/vg00/lvol3, and as far as I known, the vg00 is mirrored, should I perform the following steps in order to extend the filesystem /abc to 400MB??

#lvextend -L 400 /dev/vg00/lvol3
#lvextend -m 1 /dev/vg00/lvol3
#fsadm -b 400M /abc

Many thanks, I appreciate if anyone can answer my question.

Cheers
Sun33
7 REPLIES 7
Steven E. Protter
Exalted Contributor
Solution

Re: Filesystem extend on a mirrored VG

Shalom,

This type of situation always twisted my brain.

What I normally did was to break the mirror, extend the logical volume and re-mirror.

That avoids headaches.

Prior to doing this, I would run lvdisplay -v on the logical volume and plane hte space.

So lvextend -m 0 /dev/vg00/lvol3
(don't think this will work may need lvsplit
lvextend /dev/vg00/lvol3
lvextend -m 1 /dev/lvol3
fsadm

It gets more fun if you have to extend the mirror to a different disk than you were using for the original logical volume.

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
kcw
Advisor

Re: Filesystem extend on a mirrored VG

Hi Steven,
Thanks for your kindly reply, according to your suggestion: 1) Break the mirror, 2) lvextend, 3) Re-mirror, and 4) filesystem extend, I have been thinking about the following commands. Should the set of commands looks like this??
(Assume that lvol3 is the LV that needed to be increased in size (to 400MB), /dev/dsk/c?t?d? is the mirror disk device, and /ora is mounted on lvol3, and finally, lvol3 and mirror disk are different PV)

#lvreduce -m 0 /dev/vg00/lvol3 /dev/dsk/c?t?d?
#lvextend -L 400 /dev/vg00/lvol3
#lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c?t?d?
#fsadm -b 400M /ora


Thank you very much for your help

Best Regards
Sun33
James R. Ferguson
Acclaimed Contributor

Re: Filesystem extend on a mirrored VG

Hi:

There is *no* need to break the mirror. Simply 'lvextend' with the new size specification and target the physical devices that will hold the mirrored extents:

# lvextend -L 400 /dev/vgNN/lvolN /dev/dsk/cXtYdZ /dev/dsk/cZtYdX

Now, that said, in your case, extending the logical volume is probably going to fail anyway. 'lvol3' of 'vg00' is the root filesystem which *must* be 'strict' and 'contiguous'. The 'contiguous' allocation requirement means that physical extents must exist without gaps. Your 'lvol4' will likely lie next to 'lvol3' and will have used the contiguous physical extents that you seek to extend into.

A better question is why you think you need to extend the root filesystem. Unless you are upgrading an OS there is little need if you manage it correctly. An Ignite restoration of 'vg00' and and re-specification of the logical volume sizes during that restoration is the safest and surest method to extend 'lvol3'.

Regards!

...JRF...


Jannik
Honored Contributor

Re: Filesystem extend on a mirrored VG

If ignite is not and option :-) or if you are just in for some LVM funn.

Find a spare disk and move:
strings /etc/lvmtab |grep c7t0d6
pvcreate -f /dev/rdsk/c7t0d6
vgextend /dev/vg00 /dev/dsk/c7t0d6
lvdisplay -v /dev/vg00/lvol4 |more
lvreduce -m 0 /dev/vg00/lvol4
lvdisplay -v /dev/vg00/lvol4 |more
pvmove -n /dev/vg00/lvol4 /dev/dsk/c0t6d0 /dev/dsk/c7t0d6

lvextend -L 1024 /dev/vg00/lvol3
fsadm -b 1024M /

pvmove -n /dev/vg00/lvol4 /dev/dsk/c7t0d6 /dev/dsk/c0t6d0
vgreduce /dev/vg00 /dev/dsk/c7t0d6

lvextend -m 1 /dev/vg00/lvol4

I have done it many times and it has never failed.

If you don't have a spare disk, then you split away all you lvols on vg00 and use that as your spare disk :-). Remember to mirror your vg00 after the move.

To be on the safe site make a ignite backup before you start.
jaton
MHudec
Frequent Advisor

Re: Filesystem extend on a mirrored VG

Hello,

no need to do anything with the mirror.

I am taking that lvol3 is just an example and that you are not trying to extend / (which is actually quite possible and easy without any ignite/sparedisks ways, though as whole not supported) - nevertheless the only serious reason I can think of for needing / extend is to have new volumegroups with their lvm config files introduced to the system, which situation happens from time to time.

First of all, check volumegroup PE size and logical volume extent distribution via:
# vgdisplay -v vg00
# lvdisplay -v /dev/vg00/lvol3

see for the lines like:

LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c2t4d0 00211 current /dev/dsk/c5t4d0 00372 current
00001 /dev/dsk/c2t4d0 00212 current /dev/dsk/c5t4d0 00373 current
00002 /dev/dsk/c2t4d0 00213 current /dev/dsk/c5t4d0 00374 current

PV1 (/dev/dsk/c2t4d0) is original and PV2 (/dev/dsk/c5t4d0) is the mirror.

Then you can extend via:
# lvextend -l /dev/vg00/lvol3

- total number of extents
- original physical volume
- mirrored physical volume

I use -l option and putting total number of logical extents (like PE has 4M and we want 400M logical volume, then we use -l 100). -L is not that good, it rounds up (might round in incorrect way while using pvg distribution, but that's another story).

Recheck extend distribution via:
# lvdisplay -v /dev/vg00/lvol3

There should be consistent distribution, like PV1 in first row and PV2 in second row etc.

Extend the filesystem via:
# fsadm -F vxfs -b 400M /abc

Martin
Thomas J. Harrold
Trusted Contributor

Re: Filesystem extend on a mirrored VG

I'm sure you have the idea from a few of the responses above, but no need to do anything with the mirrors.

Just simply lvextend, and fsadm to grow the filesystem.

-tjh
I learn something new everyday. (usually because I break something new everyday)
Sunny Lo
New Member

Re: Filesystem extend on a mirrored VG

Sun33,

It seemed like your emails have been erroneously forwarded to my Yahoo email account. Would you please take a look at the email address you registered with this HP support forum and see if there's any typo in it?

Thanks!

Sunny