1820390 Members
3442 Online
109623 Solutions
New Discussion юеВ

Two VGs over one PV

 
SOLVED
Go to solution
Taurian
Valued Contributor

Two VGs over one PV

Hi everyone,

I wanted to know if it's possible to create two VGs over a single PV? If yes, let me know the procedure. If no, let me know the reason why not. Thanks.
21 REPLIES 21
James R. Ferguson
Acclaimed Contributor

Re: Two VGs over one PV

Hi:

No, a Volume Group can span multiple physical volumes but a single physical volume cannot host more than one volume group. This is the way LVM works.

http://docs.hp.com/en/B2355-60130/lvm.7.html

Regards!

...JRF...
AVV
Super Advisor

Re: Two VGs over one PV

Hello,

You cannoy use a single PV for more than a VG. You can have mutiple path for the same PV but ever and never use that for different VGs.
Michal Kapalka (mikap)
Honored Contributor

Re: Two VGs over one PV

hi,

that is not possible.

mikap
Vishu
Trusted Contributor

Re: Two VGs over one PV

Hi,

I agree with everyone here. It is simply not possible.

and the reason is "LVM dont allow this". This is a feature of Volume Manager.

Thanks
Torsten.
Acclaimed Contributor

Re: Two VGs over one PV

Let's assume you create 2 partitions on 1 disk, each will be handled as a single PV, but this would be highly unsupported.


But it isn't just impossible.


;-)

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!   
SoorajCleris
Honored Contributor

Re: Two VGs over one PV

Hi,

Its possible in Integrity systems , but please avoid going for it. I think now a days disks are cheap .. :)


regards,
sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
SoorajCleris
Honored Contributor
Solution

Re: Two VGs over one PV

Remember when you use the term PV - its not possinble , becaseu if you create PV on different partitions , it become different PV. on the same physical disk if you ask, yes.

here we go ..

# cat sooraj
3
EFI 400MB
HPUX 100%
HPUX 1000MB
[rx26-156]/

======

idisk -f /sooraj -w /dev/rdsk/c15t0d6

insf -eC disk

Ioscan -fnC disk

disk 49 0/4/1/1.109.13.0.0.0.6 sdisk CLAIMED DEVICE HP HSV200
/dev/dsk/c15t0d6 /dev/rdsk/c15t0d6
/dev/dsk/c15t0d6s1 /dev/rdsk/c15t0d6s1
/dev/dsk/c15t0d6s2 /dev/rdsk/c15t0d6s2
/dev/dsk/c15t0d6s3 /dev/rdsk/c15t0d6s3


# pvcreate -f /dev/rdsk/c19t0d6s2
Physical volume "/dev/rdsk/c19t0d6s2" has been successfully created.
[rx26-156]/

# pvcreate -f /dev/rdsk/c19t0d6s3
Physical volume "/dev/rdsk/c19t0d6s3" has been successfully created.
[rx26-156]/

# diskinfo /dev/rdsk/c19t0d6s3
SCSI describe of /dev/rdsk/c19t0d6s3:
vendor: HP
product id: HSV200
type: direct access
size: 1024000 Kbytes
bytes per sector: 512
[rx26-156]/

# diskinfo /dev/rdsk/c19t0d6s2
SCSI describe of /dev/rdsk/c19t0d6s2:
vendor: HP
product id: HSV200
type: direct access
size: 2759680 Kbytes
bytes per sector: 512
[rx26-156]/


# vgcreate -s 32 vgpart2 /dev/dsk/c19t0d6s2
Volume group "/dev/vgpart2" has been successfully created.
Volume Group configuration for /dev/vgpart2 has been saved in /etc/lvmconf/vgpart2.conf
[rx26-156]/

# vgcreate -s 32 vgpart3 /dev/dsk/c19t0d6s3
Volume group "/dev/vgpart3" has been successfully created.
Volume Group configuration for /dev/vgpart3 has been saved in /etc/lvmconf/vgpart3.conf
[rx26-156]/

# vgdisplay /dev/vgpart2
--- Volume groups ---
VG Name /dev/vgpart2
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 0
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 1016
VGDA 2
PE Size (Mbytes) 32
Total PE 84
Alloc PE 0
Free PE 84
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 1.0
VG Max Size 508g
VG Max Extents 16256

[rx26-156]/

# vgdisplay /dev/vgpart3
--- Volume groups ---
VG Name /dev/vgpart3
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 0
Open LV 0
Max PV 16
Cur PV 1
Act PV 1
Max PE per PV 1016
VGDA 2
PE Size (Mbytes) 32
Total PE 31
Alloc PE 0
Free PE 31
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0
VG Version 1.0
VG Max Size 508g
VG Max Extents 16256

[rx26-156]/
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
mogiro
Regular Advisor

Re: Two VGs over one PV

Hi all,
All we are supposing we are talking about creating two different VG over the same PV on THE SAME SYSTEM, but if this PV belongs to a disk array that is showed with no masking restriction to two different systems, then yes, you can use the same PV to create a VG on one system and another VG on the other system. BUT then both systems are going to write on the PV without control and finally they are going to try to write on the same portion of disk at the same time, so your data is going to become corrupted.
So, anyway, never try to do so. I talk with experience...
Taurian
Valued Contributor

Re: Two VGs over one PV

Thank you all for your replies. Sorry to have used the term PV, when I meant that I've been asked to create two VGs on the same "physical disk".

The twist in the matter is that I been given the task to create another VG (say vg01) on the same "physical disk" that has the root VG vg00 on it. vg00 is already present on that disk and HP-UX is up and running. On the leftover space, I've been asked to create the vg01.

Please let me know how to achieve this. Thanks.
Torsten.
Acclaimed Contributor

Re: Two VGs over one PV

This makes absolutely no sense - don't even try this.

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!   
Taurian
Valued Contributor

Re: Two VGs over one PV

@Sooraj Cleris:

Thanks for correcting me. I have three questions about the procedure you've listed:

1. You start off with device /dev/rdsk/c15t0d6, but then after ioscan you shift to device /dev/rdsk/c19t0d6. I am assuming this is a typo?

2. After you create the PVs, the diskinfo shows their sizes. Where are we specifying these sizes? We need to specify our own sizes.

3. Please list the procedure according to my scenario that I've described in my reply above, i.e. vg00 is already present. I don't need to disturb vg00. I need to find the leftover space, then use that space to create another VG (say vg01) on it.

Thanks.
Torsten.
Acclaimed Contributor

Re: Two VGs over one PV

The example was a "proof of concept" using an empty disk. You cannot do this with a disk containing data without data loss.
The vg00 is something special, each tool (ignite, recovery etc.) assumes this disk is only used for this VG.




You need simply another new disk to create a new VG.

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!   
Vishu
Trusted Contributor

Re: Two VGs over one PV

Hey Taurian,

I completely agree with Torsten. Don't even try thinking of touching your VG00 for creating new VG over same PV which vg00 is using, else you end up with a mess with your VG00 too.

Sooraj gives an example by having a new disk and creating partition on it and then used each partition as a different PV for different VGs.

But if your PV is already in use, dont try it.
mvpel
Trusted Contributor

Re: Two VGs over one PV

Are disks really that expensive where you are that you feel the need to scrape a few measly megabytes out of the bottom of the vg00 jelly jar - and lay a punji trap for any sysadmin that comes in after you're gone while you're at it - rather than just buying a new disk on eBay and leaving the vg00 space available for future expansion?

The logical volume manager makes a few basic assumptions as its software logic is constructed, among which is that a physical volume may not be a member of more than one volume group.

This assumption results in a very clear, clean, mathematical (set theory) hierarchy:

Filesystem
...consisting of one
Logical volume
...consisting of one or more
Logical extents
...selected from the
Volume Group
...consisting of one or more
Physical Volumes
...consisting of one or more
Physical Extents
...selected from the
Storage media

The LVM like a beautifully crafted topiary tree, groomed and shaped into a work of art over decades of careful planning and hard-won experience.

What you're proposing is like hacking off a limb from the tree and grafting it back on upside down, for the sake of a few lousy bucks worth of disk space.

Would you try to put a file system onto two separate logical volumes? It's the same basic idea.
Gordon Sjodin
Frequent Advisor

Re: Two VGs over one PV

Why not just extend the existing vg and create a new lvol with the left over space?
Taurian
Valued Contributor

Re: Two VGs over one PV

Hi guyz,
This is really not my decision or wish. I've been asked to do something, and I have to follow orders.
SoorajCleris
Honored Contributor

Re: Two VGs over one PV

Thanks for correcting me. I have three questions about the procedure you've listed:

1. You start off with device /dev/rdsk/c15t0d6, but then after ioscan you shift to device /dev/rdsk/c19t0d6. I am assuming this is a typo?

it is a pvlink. thats why . leave that , there is no mistake.

2. After you create the PVs, the diskinfo shows their sizes. Where are we specifying these sizes? We need to specify our own sizes.

The first file which we used for idisk.

3 - number of partition
EFI 500MB
HPUX 100% - what ever the space left after creating partition mentioned int he file.

3. Please list the procedure according to my scenario that I've described in my reply above, i.e. vg00 is already present. I don't need to disturb vg00. I need to find the leftover space, then use that space to create another VG (say vg01) on it.


As Torsten said. Forget about all these. I just shown this to show the concept. but never use this practically.

This is nto approved by ME, by HP or anyone.

Regards,
Sooraj

"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
SoorajCleris
Honored Contributor

Re: Two VGs over one PV

Hi,

"This is really not my decision or wish. I've been asked to do something, and I have to follow orders."

THIS IS AM IMPOSSIBLE TASK.

I cant agree that somebody is giving an order which is nonsense and you are doiing it. ( you are a technical person).

* Playing with root disk is foolishness you may need downtime for your production.

I think it is the time to close this thread

:)

Regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
Torsten.
Acclaimed Contributor

Re: Two VGs over one PV

And there is still the unanswered question about the reason for this ...

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!   
Taurian
Valued Contributor

Re: Two VGs over one PV

Bro, the person ordering me is also technical and has more experience than me. Plus he is my boss, so.......

Anywayz, it is time to close this thread. Thanks you guys for your responses.
Taurian
Valued Contributor

Re: Two VGs over one PV

The procedure is not possible.