cancel
Showing results for 
Search instead for 
Did you mean: 

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
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
Rasheed Tamton
Honored Contributor

Re: LVM in HPUX

You cannot directly put the PV in a LV on HP-UX. What you have to do is:

first you extend the VG belongs that LV by adding the new PVs.

i.e.,
if your LV is /dev/vg02/lvol1
and your new PV is /dev/dsk/c4t2d3

you first extend the vg02:
vgextend /dev/vg02 /dev/dsk/c4t2d3

Then extend the LV

lvextend -L 100000 /dev/vg02/lvol1

100000 = is the new size in MegaBytes. While you lvextend it MUST BE BIGGER THAN the old LV Size. You must note that existing LV Size before you extend the LV to a new size and it MUST BE BIGGER. Otherwise, you will lose the data.
Torsten.
Acclaimed Contributor

Re: LVM in HPUX

Ahsan, please think about this again ;-)

"Then create pv

#pvcreate -f /dev/dsk/cxtxdx

#lvextend /dev/vgX/lv_X

then extend the size in file system"

Some steps are missing, right?

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!   
YAQUB_1
Respected Contributor

Re: LVM in HPUX

Sajjad Sahir
Honored Contributor

Re: LVM in HPUX

Dear

To better understand lvm, I am defining the
three basic terms
physical volume
volume group
logical volume

physcial volume- is the actual physical volume disk drive
volume group: u can combine many physical volume to the volume group, means collection of physical volume is the volume group
logical volume: in the volume group u can create logical volume it is an are where u can create the file system.

how to create a logical volume
1. create a physical volume
2. create a volume group
3.create a logical volume
also u can extend the existing volume group
by adding new physical volume
ok
thanks and regards

sajjad
Sajjad Sahir
Honored Contributor

Re: LVM in HPUX


Dear
Please assign points who are answerign u thread otherwise u have to close u thread ASAP, if u are giving points to the peoples they will answer u thread ASAP, otherwise they will hesitate to answer u questions ok
take care, co-operate with team

thanks and regards

sajjad
Vinayak_HPUX
Frequent Advisor

Re: LVM in HPUX

I got the solutions
"Success is matter of law not luck, Make ur own & follow them -Shivkhera[You Can Win] "