1752781 Members
6518 Online
108789 Solutions
New Discussion юеВ

LVM in HPUX

 
SOLVED
Go to solution
Vinayak_HPUX
Frequent Advisor

LVM in HPUX

in HPUX LVM I am able to create PV using single raw disk as below
# pvcreate -f /dev/rdsk/c4t2d0
But below is not working
# pvcreate -f /dev/rdsk/c4t2d0 /dev/rdsk/c4t2d2 /dev/rdsk/c4t2d3
How to create the PV using multiple raw disk in HPUX whereas 2nd command is working in Linux but not in HPUX plz help ?
"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "
15 REPLIES 15
Torsten.
Acclaimed Contributor
Solution

Re: LVM in HPUX

You can run this command to a single device only - easy with cut'n'paste or a small script line.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Johnny Damtoft
Regular Advisor

Re: LVM in HPUX

I use a small script - like this:

Ref. url:
http://www.knowledgeroot.dk/hp-ux/lvm/creating-volume-group-and-logical-volume-with-distributed-and-pvg-strict/

# list=`xpinfo -d -l |awk -F, {'print $8" "$5" "$4" "$1'}| sed 's/\/dev\/rdsk\///g' |awk {'print $4'}`
# for i in $list
> do
> print "pvcreate /dev/rdsk/$i"
> done
pvcreate /dev/rdsk/c8t0d0
pvcreate /dev/rdsk/c9t0d0
pvcreate /dev/rdsk/c10t0d0
pvcreate /dev/rdsk/c11t0d0
pvcreate /dev/rdsk/c8t0d1
pvcreate /dev/rdsk/c9t0d1
pvcreate /dev/rdsk/c10t0d1

After i check the output, i just copy/paste. :)

-- Johnny Damtoft
Rasheed Tamton
Honored Contributor

Re: LVM in HPUX

pvcreate will initialize the disk, destroy the existing data on it. So care must be taken before you issue the pvcreate command. That might be the reason HP does not support more than one pv_path.

If you want more than one you can do something like this. But be sure about the device names.

for i in /dev/rdsk/c4t2d0 /dev/rdsk/c4t2d2 /dev/rdsk/c4t2d3
do
echo $i
pvcreate $i
done
Torsten.
Acclaimed Contributor

Re: LVM in HPUX

BTW, I would NEVER use the "-f" to force the command unless it is really needed!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Vinayak_HPUX
Frequent Advisor

Re: LVM in HPUX

Then what the use of LVM ? suppose one of my disk got full then I extended lv upto pv's size its ok.... but if still its not enough. then how to add new pv from different disk to old one?
let I have created PVs as below
pvcreate -f /dev/rdsk/c4t2d0
pvcreate -f /dev/rdsk/c4t2d2
pvcreate -f /dev/rdsk/c4t2d3

but how could I
add one PV to another when I need to extend lv in /dev/rdsk/c4t2d0 disk when this disk donot have space ?
"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "
Torsten.
Acclaimed Contributor

Re: LVM in HPUX

"how to add new pv from different disk to old one?
let I have created PVs as below
pvcreate -f /dev/rdsk/c4t2d0
pvcreate -f /dev/rdsk/c4t2d2
pvcreate -f /dev/rdsk/c4t2d3"

Let's say your new LUN is

/dev/rdsk/c4t2d3

you run

pvcreate /dev/rdsk/c4t2d4

and add this PV to your VG using vgextend.
After this you can lvextend the LVOL.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Jeeshan
Honored Contributor

Re: LVM in HPUX

Then create pv

#pvcreate -f /dev/dsk/cxtxdx

#lvextend /dev/vgX/lv_X

then extend the size in file system
a warrior never quits
Torsten.
Acclaimed Contributor

Re: LVM in HPUX

sorry, typo.

Let's say your new LUN is

/dev/rdsk/c4t2d4

you run

pvcreate /dev/rdsk/c4t2d4

and add this PV to your VG using vgextend.
After this you can lvextend the LVOL.


see also

http://docs.hp.com/en/B2355-90950/ch06s01.html

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Jeeshan
Honored Contributor

Re: LVM in HPUX

sorry about last line

then mount the file system
a warrior never quits