Operating System - HP-UX
1855657 Members
8765 Online
104113 Solutions
New Discussion

RFQ: Online - extension of /stand

 
SOLVED
Go to solution
Florian Heigl (new acc)
Honored Contributor

RFQ: Online - extension of /stand

Hi,

before I even start:

THIS IS UNSUPPORTED BY HP.
and it is unsupported by me of course too.
I'm just asking for comments on this method and will not feel responsible for sunk ships or websites if anyone actually uses it.
OTOH I have tested it and it worked for me.

Requirements:
- MirrorDisk/UX
- Mirrored vg00
- Perfect mirror layout in vg00 at start.
(that is: 1:1 copy, no unmirrored volumes or other mess)
- Free Space as required
- Someone taking responsibility for running a system at times unmirrored and unbootable (unless You can do a 3-way mirror)


technical view, script

call lvlnboot -v, gather primary and secondary disks of vg00

for lv in `vgdisplay -v /dev/vg00 | grep "LV Name" | awk '{print $3}'`
do
lvreduce -m 0 $lv /dev/dsk/#secondary
done
lvlnboot -b /dev/vg00/lvol1
lvlnboot -r /dev/vg00/lvol3

EXTENSION=100 # MB
vgdisplay -v /dev/vg00 | grep "LV Name" | awk '{print $3}' > /tmp/lvs.$$
lvextend -m 1 /dev/vg00/lvol1
lvcreate -L $EXTENSION -m 1 -n lvexttemp -s y /dev/vg00
for lv in `grep -v lvol1 /tmp/lvs.$$`
do
lvextend -m 1$lv
done
lvlnboot -b /dev/vg00/lvol1
lvlnboot -r /dev/vg00/lvol3
# now check the mirror states of vg00 in whole and lvexttemp

cd /tmp
mkdir 700 stand
cd /stand
find . -depth | cpio -pdm /tmp/stand/
cd /tmp
umount /stand

# From here on the system is not bootable for approximately a minute

lvremove -f /dev/vg00/lvol1

for lv in `grep -v lvol1 /tmp/lvs.$$`
do
lvreduce -m 0 $lv /dev/dsk/#primary
done

NEWSIZE=260
lvremove -f /dev/vg00/lvexttemp
lvcreate -l 1 -m 1 -r n -C y -s y -n lvol1 /dev/vg00
lvextend -L $NEWSIZE /dev/vg00/lvol1
newfs -Fhfs /dev/vg00/rlvol1
mount /stand
cd /tmp/stand
find . -depth | cpio -pdm /stand/
lvlnboot -b /dev/vg00/lvol1
lvlnboot -r /dev/vg00/lvol3
cd /tmp/

# bootable again *phew*

# Now manually check the mirroring

lvdisplay -v /dev/vg00/lvol1 | more

# The numbers for LE, PE1, PE2 should, err, MUST be identical now.

for lv in `grep -v lvol1 /tmp/lvs.$$`
do
lvextend -m 1 $lv /dev/dsk/#primary
done
lvlnboot -b /dev/vg00/lvol1
lvlnboot -r /dev/vg00/lvol3

That's it.

Comments? I think of forwarding this to our CSS team so it get's into the LVM manuals.
yesterday I stood at the edge. Today I'm one step ahead.
7 REPLIES 7
Geoff Wild
Honored Contributor

Re: RFQ: Online - extension of /stand

Only thing I can see - is that your lvol1 will not be the first partition on the disk - because it has to be contiguous - and you didn't reduce lvol2 (swap)...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Patrick Wallek
Honored Contributor
Solution

Re: RFQ: Online - extension of /stand

VERY interesting procedure. This is something I would not want to do without extensive personal testing first (no offense intended) on a machine I really don't care about.

If one thing were to go wrong at just the WRONG, or RIGHT depending on your point of view, then you could wind up with a thoroughtly screwed up system.

I'm going to have to bookmark or print this so I can come back to it and give it some more thought and study.
Florian Heigl (new acc)
Honored Contributor

Re: RFQ: Online - extension of /stand

Geoff, it is the first, that's the whole point of the mirror-side-swapping.

see the following output
(I have to edit out the disk names)

--- Logical volumes ---
LV Name /dev/vg00/lvol1
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 272
Current LE 17
Allocated PE 34
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/primary 17 17
/dev/dsk/secondary 17 17

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/primary 00000 current /dev/dsk/secondary 00000 current
00001 /dev/dsk/primary 00001 current /dev/dsk/secondary 00001 current
00002 /dev/dsk/primary 00002 current /dev/dsk/secondary 00002 current
00003 /dev/dsk/primary 00003 current /dev/dsk/secondary 00003 current
00004 /dev/dsk/primary 00004 current /dev/dsk/secondary 00004 current
00005 /dev/dsk/primary 00005 current /dev/dsk/secondary 00005 current
00006 /dev/dsk/primary 00006 current /dev/dsk/secondary 00006 current
00007 /dev/dsk/primary 00007 current /dev/dsk/secondary 00007 current
00008 /dev/dsk/primary 00008 current /dev/dsk/secondary 00008 current
00009 /dev/dsk/primary 00009 current /dev/dsk/secondary 00009 current
00010 /dev/dsk/primary 00010 current /dev/dsk/secondary 00010 current
00011 /dev/dsk/primary 00011 current /dev/dsk/secondary 00011 current
00012 /dev/dsk/primary 00012 current /dev/dsk/secondary 00012 current
00013 /dev/dsk/primary 00013 current /dev/dsk/secondary 00013 current
00014 /dev/dsk/primary 00014 current /dev/dsk/secondary 00014 current
00015 /dev/dsk/primary 00015 current /dev/dsk/secondary 00015 current
00016 /dev/dsk/primary 00016 current /dev/dsk/secondary 00016 current
yesterday I stood at the edge. Today I'm one step ahead.
Patrick Wallek
Honored Contributor

Re: RFQ: Online - extension of /stand

Yes, it will Geoff.

In the first part he unmirrors lvols from the secondary disk, then remirrors lvol1, creates a placeholder lvol of the amount he wants to extend by, then remirrors all other LVOLs.

In the 2nd part where he talks about the system being unbootable for a bit, he removes lvol1 completely, then reduces the mirrors off the primary. He then removes the placeholder lvol, recreate's lvol1 at the new size, restores from cpio archive, and remirrors all others.

LVOL1 is now totally at the beginning of the disk and at a new size.
Geoff Wild
Honored Contributor

Re: RFQ: Online - extension of /stand

Okay - I see it now...

Worse thing that could happen then is, during that one minute your server crashes....

So, I would do an ignite first - just to be safe :)

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Florian Heigl (new acc)
Honored Contributor

Re: RFQ: Online - extension of /stand

Patrick, the failure risk is the thing that's still worrying me a lot, too.

that's why I do those extensive lvlnboots at very step, so the OS has a maximized chance of still finding it's pieces.

If I had a bit more experience with actual software testing, I could try out some arcane utilities like maelstrom to really catch everything that can fail.

but I think it's better to keep i.e. a dd image of /dev/vg00/rlvol1 and just get two hours of downtime for the procedure: take one shot, if it works, be set and done, otherwise boot ignite and go life again.

on a production system I'd probably stick an ignite tape into the drive and in case of failures just remirror, hold my breath till weekend and boot from tape.

this is not a procedure to use careless, but I think it's better be documented anyway than someone failing there while under pressure.
(i.e. on my first try I forgot the lvlnboot, everything went right, but I have to fix the boot settings from the os CDs :)
yesterday I stood at the edge. Today I'm one step ahead.
Florian Heigl (new acc)
Honored Contributor

Re: RFQ: Online - extension of /stand

oh, and the minute is far overexaggerated - on the A400 I used it was *two seconds*, as /stand's contents while still be in the filesystem buffer :)
yesterday I stood at the edge. Today I'm one step ahead.