Operating System - HP-UX
1751780 Members
4375 Online
108781 Solutions
New Discussion юеВ

Re: LVM - help extending VG's

 
SOLVED
Go to solution
Ewan McDonald
Advisor

LVM - help extending VG's

Hi guys could you give me any assistance here?
I've got a system with two 9gb disks as a root mirror. I've been asked to spread VG00 over four 9gb disks so we have 18gb on each half of the mirror. I'm used to changing disks etc with LVM but I've never done this before. Can someone point me in the right direction? So far I've split the mirror so I only have one disk in VG00. I have my new 9gb disk which I want to add to the VG but do I use the vgextend command? Then when I have the pair of disks as one VG, how do I get both disks to look like a mirror?
A cookbook would be handy if you could point me to one?

Cheers
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: LVM - help extending VG's

install disks.

If they are hot swaps, run ioscan, see that they are claimed.

insf -C will get you device drivers

pvcreate -f /dev/dsk/c#t#d#
#make sure this part is right. Use real data.

then vgextend /dev/vg00 /dev/dsk/c#t#d#

At that point you can extend filesystems.

/ root must be contiguous.
swap must be contiguous.

Here are my general instructions for adding a complete mirror set. A portion of these will do the job for you:

pvcreate -B /dev/rdsk/c1t0d0 #use real disk

mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t0d0 # use real disk


# mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?

If you are running 64-bit OS:

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?


vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot
setboot -a 52.1.0 # second disk



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
Sanjay_6
Honored Contributor

Re: LVM - help extending VG's

Hi Ewan,

you asked for it, Here it is.

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000073345589

The itrc doc id is LVMKBRC00005103.

Do remeber we mirror all the lvs in vg00 and not only lvol1-lvol3. They need to be done in the order specified and must be done first. For the other lvs there is no specific order neccessary.

Hope this helps.

Regds
Ewan McDonald
Advisor

Re: LVM - help extending VG's

Hi guys, thanks for the help. I'll look through this document now. I'm used to mirroring two disks together. I do it most days... The problem is I've never done it with four disks before.
Once I've used the vgextend command I can see the free extents are added when I do a vgdisplay but its extending my logical volumes over the two disks I seem to be having the most problems with?
Victor BERRIDGE
Honored Contributor

Re: LVM - help extending VG's

Hi Ewan,
In order to help you in your brainstorming may I ask you more information on the system and what you can do (e.g. make_recovery and rebuild vg00?) :
Are your disks hotswap?
Are they on separate controllers?
What is installed on vg00? Just system?
etc...
It would have been easyer if you were given 2 disks of 18 GB...

All the best
Victor
Ewan McDonald
Advisor

Re: LVM - help extending VG's

Hi victor,

I have an N-class hooked up to a SC10 for the purpose of this test, as I├в d like to try it on my test machine before going to the customer site.

I have four disks in the SC10 > c0t0d0(9gb), c0t8d0(18gb), c0t1d0(9gb) & c0t9d0(18gb)

c0t0d0 is in VG04 and has one lvol (lvol1). I want to increase the space on this lvol but have 90% disk usage. So have added a second disk.
I├в ve used c0t8d0:
pvcreate ├в f /dev/rdsk/c0t8d0
vgextend /dev/vg04 /dev/dsk/c0t8d0
lvextend ├в L 700 /dev/vg04/lvol1 /dev/dsk/c0t8d0

Now I├в ve pvcreated c0t1d0 & c0t9d0 seperately
I├в ve also vgextended the both of them separately so now all four disks are in the volume group but not mirrored.

The part I am stuck on is the next step? With two disks I would normally do an lvextend ├в m 1 /dev/vg04 /dev/dsk/├в the disk device file├в ├в but I have two disks to add here.

I├в ve tried: lvextend ├в m 1 /dev/vg04/lvol1 /dev/dsk/c0t1d0 /dev/dsk/c0t9d0 but it doesn├в t like it.

Surely the
Bill Costigan
Honored Contributor
Solution

Re: LVM - help extending VG's

Have you looked at using PVGs?

You could put 2 disks into 1 group and the other 2 in the other group.

Another possibility is to use pvmove to move the extents for lvol4,5,6,7,or 8 to another disk and mirror them to another specific disk.

eg.

lvol1-3 disk1 mirror disk2
lvol4-6 disk3 mirror disk4
lvol7 disk1 mirror disk2
lvol8 disk3 mirror disk4
Ewan McDonald
Advisor

Re: LVM - help extending VG's

Bill, thank you VERY much! That is what I've been looking for all day :)
I've set it up on my test machine perfect, now I can go do the real thing...

Cheers to all of you for your help!
D Block 2
Respected Contributor

Re: LVM - help extending VG's

Create_mirror script


The easiest thing to do is to just take the commands you just listed and put them into a script.

You can make the disk device and hardware path variables so that you change everything at the beginning and that is it.

In your case something like:

# cat create_mirror

DISK=c2t6d0
PRI_HWPATH="0/0/2/1.6.0"
ALT_HWPATH="0/0/2/0.6.0"

pvcreate -B /dev/rdsk/${DISK}
mkboot /dev/rdsk/${DISK}
mkboot -a "hpux -lq" /dev/rdsk/${DISK}
vgextend /dev/vg00 /dev/dsk/${DISK}
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/${DISK}
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/${DISK}
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/${DISK}
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/${DISK}
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/${DISK}
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/${DISK}
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/${DISK}
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/${DISK}

lvlnboot -R
lvlnboot -v

setboot -p ${PRI_HWPATH}
setboot -a ${ALT_HWPATH}
setboot


That's all there is to it. Scripting isn't as difficult as you think it is.


Also, note the vgdisplay -v , used PE(s) before and after mirroring.
Golf is a Good Walk Spoiled, Mark Twain.