Operating System - HP-UX
1833771 Members
2151 Online
110063 Solutions
New Discussion

Re: How to extend a swap volume for mirroring

 
Gerard_10
Occasional Advisor

How to extend a swap volume for mirroring

Hi,

Does anybody know how to extend a swap volume for mirroring? The commands I
use fail for some reason but I can't understand why this is,as PE seems fine.

SMAR6:root> swapinfo -t
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1572864 0 1572864 0% 0 - 1 /dev/vg00/lvol2
dev 8912896 0 8912896 0% 0 - 1 /dev/vg00/lvol9
reserve - 3012892 -3012892
total 10485760 3012892 7472868 29% - 0 -


SMAR6:root> lvextend -m 1 /dev/vg00/lvol9
lvextend: Not enough free physical extents available.
Logical volume "/dev/vg00/lvol9" could not be extended.
Failure possibly caused by strict allocation policy
Failure possibly caused by strict allocation policy


SMAR6:root> lvdisplay -v /dev/vg00/lvol9 | more
--- Logical volumes ---
LV Name /dev/vg00/lvol9
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 8704
Current LE 2176
Allocated PE 2176
Stripes 0
Stripe Size (Kbytes) 0
Bad block off
Allocation strict/contiguous
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c2t6d0 2176 2176

--- Logical extents ---
LE PV1 PE1 Status 1
00000 /dev/dsk/c2t6d0 00050 current
00001 /dev/dsk/c2t6d0 00051 current
00002 /dev/dsk/c2t6d0 00052 current
00003 /dev/dsk/c2t6d0 00053 current
00004 /dev/dsk/c2t6d0 00054 current


16 REPLIES 16
Tom Geudens
Honored Contributor

Re: How to extend a swap volume for mirroring

Hi Gerard,
The above is not quite clear ...
Can you post the output of "vgdisplay -v vg00" ? The way I understand the above, you're trying to mirror to the same disk ?

Regards,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
Michael Tully
Honored Contributor

Re: How to extend a swap volume for mirroring

Swap *must* have contiguous strict extents, you can't just allocate anything to it.
You can only extend an existing swap volume if there is sufficient logical extents available immediately after the last used extent of the volume. The best way is to either create a new volume (not a bad idea for spreading the load) or create an ignite tape and extending it from booting from tape and making the changes that way.
Anyone for a Mutiny ?
Sunil Sharma_1
Honored Contributor

Re: How to extend a swap volume for mirroring

Hi,

How may disks you have in vg00 ?

if you have only once disk or if sufficient PE is not free in other disk it will not extend.

just paste the o/p of vgdisplay -v /dev/vg00

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Bernhard Mueller
Honored Contributor

Re: How to extend a swap volume for mirroring

You have less than 2176 "contigous" PE on your mirror disk,

Assuming you have two boot disks and all your Lvols are mirrored except for the additional swap then you need to rearrange the mirror disk a little. To make the available extents contiguous. (i.e. break mirror and remirror).

Check using pvdisplay -v on the mirror disk to see what is where on the mirror disk.

Regards,
Bernhard
Stuart Abramson_2
Honored Contributor

Re: How to extend a swap volume for mirroring

tom said it above.

This command is wrong:

SMAR6:root> lvextend -m 1 /dev/vg00/lvol9

If c2t6d0 is your primary disk, and you are mirroring to c3t6d0, which also must be contained in vg00, then you would type:

lvextend -m 1 /dev/vg00/lvol9 /dev/dsk/c3t6d0

Is that the case? do you have another disk in vg00? Preferably on another path?
GK_5
Regular Advisor

Re: How to extend a swap volume for mirroring

Gerald,

You need to specify the disk to which you are mirroring swap.
# lvextend -m 1 /dev/vg00/lvol9 /dev/dsk/cxtydz
Make sure disk /dev/dsk/cxtydz is in vg00 has continuous 2176 PE.
IT is great!
Gerard_10
Occasional Advisor

Re: How to extend a swap volume for mirroring

Attached is the vgdisplay -v vg00

Thanks all for your help!!
TOMAS BERNABEU
Frequent Advisor

Re: How to extend a swap volume for mirroring



Reduce an create mirror for vg00 -.:

1.- Reduce alls lv on c1t6d0
for i in 1 2 3 4 5 6 7 8
do
lvreduce -m 0 /dev/vg00/lvol"$i" /dev/dsk/c1t6d0
done
for i in 1 2 3 4 5 6 7 8 9
do
lvextend -m 1 /dev/vg00/lvol"$i"
done

Tom

Stuart Abramson_2
Honored Contributor

Re: How to extend a swap volume for mirroring

It seems like vg00/lovl9 is 2176 PEs on c2t6d0. c1t6d0 has 2519 PEs available, more than enough. I can't imagine why it won't fit, even given the strict/contiguous. Normally, space is allocated from the beginning of the disk, so that 2519 should be contiguous at the end of the disk... The only way it wouldn't be contiguous is if someone created two mirror LVs and then remove the first one.

Get a pvdisplay -v /dev/dsk/c1t6d0 and see if you can figure out what is where.
TOMAS BERNABEU
Frequent Advisor

Re: How to extend a swap volume for mirroring


Hi Gerard !

before to reduce lv's , it's advisable to make a ignite backup.

Tom
Bernhard Mueller
Honored Contributor

Re: How to extend a swap volume for mirroring

Please check
pvdisplay -v /dev/dsk/c1t6d0 | grep -i free

and you will most likley see that your free extends are not "contiguous" .

You can check where the gap is and maybe you just need to lvreduce -m 0 one or two lvols...

Regards,
Bernhard
Gerard_10
Occasional Advisor

Re: How to extend a swap volume for mirroring

Hi,

Attached is

pvdisplay -v /dev/dsk/c1t6d0 | grep -i free

output. Ihave noticed the following gap,


02548 free 00000
02549 free 00000
03937 free 00000
03938 free 00000

What are the commands i need to run to resolve this so the mirroring command can then work and what would cause such a gap and is this the reason with the mirror command will not work?

Thanks for your expert help!!
Bernhard Mueller
Honored Contributor

Re: How to extend a swap volume for mirroring


Use
pvdisplay -v /dev/dsk/c1t6d0 | more
and scroll through to check which lvols use extents in the range from
PE 2550
to
PE 3936

for each of these lvols you do
lvreduce -m 0 /dev/vg00/lvolXYZ

when you're done
setup mirrors again for each lvol using
lvextend -m 1 /dev/vg00/lvolXYZ

(and also for swap-lvol lvol9)

At some time there were one or more lvols in the range from the first free PE on c1t6d0 up to PE 2550.

Regards,
Bernhard
Gerard_10
Occasional Advisor

Re: How to extend a swap volume for mirroring

Hi,

Thanks for that.

One more question do i have to be in single user mode to run lvreduce commands?

Would the application be affected when running the lvextend and lvreduce commands on lvols that have crucial file systems mounted on them?

Thanks again!!
Bernhard Mueller
Honored Contributor

Re: How to extend a swap volume for mirroring

Hi,

you can do that anytime you want, just need to know that you are removing disk mirrors.

So in case your remaining boot disk breaks while you are doing this, i.e. *before* you have setup the mirrors again and they are sync'd, you'll be in trouble!

lvextending a mirror and syncing 3-4 GB will take a few minutes... don't get nervous.

If you want to be on the safe side and have a tape drive attached to the system it would be a good idea to create an Ignite image before you break those mirrors.

Regards,
Bernhard
Bernhard Mueller
Honored Contributor

Re: How to extend a swap volume for mirroring

You should also specify the disk from which to remove the mirror:
lvreduce -m 0 /dev/vg00/lvolXYZ /dev/dsk/c1t6d0

else you could possibly remove it from the wrong disk.

Regards,
Bernhard