Skip to contentSkip to conversation

what does 'orphan vg' mean?(global vg?)

linux-lvm Busby.Cheung 2 participants 7 messages Apr 13, 2010

lore
Share & tools
lore
#0 lore raw

Hi All,
While I was reading the lvm source code, I can't understand what 'is_orphan' means(like 'is_orphan_vg' function). what's the different between orphan and global vg? Thank you very much.

Best Regards,
Busby.Cheung

#1 lore raw
Quoted 3 lines · Busby.Cheung

While I was reading the lvm source code, I can't understand what
'is_orphan' means(like 'is_orphan_vg' function). what's the different between orphan and global vg?

Orphan PV is device with PV label which is not attached to any Volume Group. (IOW it is handled by LVM, but space on it is not yet allocatable.)

There is no such thing like Global VG in LVM2, only "global lock". It is internal lock used to avoid parallel scanning of all devices. (you will see it in vgscan command for example).

Milan

#2 lore raw

Hi Milan,
Thank you very much for so qucik answer.
The reason cause me to read the source code is you mentioned in your email: 'vgscan'. When I use the 'vgs' cmd, it maybe take a long time, the 'vgs' can't be executed parallelly? The 'vgs' cmd will scan all the devices, once one device locked, it will wait till timeout or err come(device err)?

Best Regards,
Busby

Quoted 20 lines

-----原始邮件-----
发件人: "Milan Broz" <[email protected]>
发送时间: 2010年4月13日 星期二
收件人: "LVM general discussion and development" <[email protected]> 抄送: "Busby.Cheung" <[email protected]>
主题: Re: [linux-lvm] what does 'orphan vg' mean?(global vg?)

Quoted 3 lines · Busby.Cheung

While I was reading the lvm source code, I can't understand what
'is_orphan' means(like 'is_orphan_vg' function). what's the different between orphan and global vg?

Orphan PV is device with PV label which is not attached to any Volume Group. (IOW it is handled by LVM, but space on it is not yet allocatable.)

There is no such thing like Global VG in LVM2, only "global lock". It is internal lock used to avoid parallel scanning of all devices. (you will see it in vgscan command for example).

Milan

#3 lore raw
Quoted 6 lines · Busby.Cheung

Thank you very much for so qucik answer.
The reason cause me to read the source code is you mentioned in
your email: 'vgscan'. When I use the 'vgs' cmd, it maybe take a long time, the 'vgs' can't be executed parallelly? The 'vgs' cmd will scan all the devices, once one device locked, it will wait till timeout or err come(device err)?

vgs take global lock for performance reasons (it can use cached metadata completely then), so it waits for some time if vgscan run in parallel. (but you do not need to run vgscan at all except adding new device or so)

full scan should not take too much time, but there was some bug fixed recently (missing device was searched too many times slowing everything down)

Milan

#4 lore raw
Quoted 8 lines · 在2010-04-13 18:54:37,"Milan Broz" <[email protected]> 写道:
Quoted 6 lines · Busby.Cheung

Thank you very much for so qucik answer.
The reason cause me to read the source code is you mentioned in
your email: 'vgscan'. When I use the 'vgs' cmd, it maybe take a long time, the 'vgs' can't be executed parallelly? The 'vgs' cmd will scan all the devices, once one device locked, it will wait till timeout or err come(device err)?

Quoted 9 lines

vgs take global lock for performance reasons (it can use cached metadata completely then), so it waits for some time if vgscan run in parallel. (but you do not need to run vgscan at all except adding new device or so)

full scan should not take too much time, but there was some bug fixed recently (missing device was searched too many times slowing everything down)

Milan

My LVM2 version is 2.02.54, haven't done any patch.
Did you mean that there were some patches to fix the 'take long time' 's bug?
I can't understand 'missing device was searched too many times slowing everything down' as you said, what does 'missing device was searched too many times' mean? Does that means some device like '/dev/sde' which is an missed device, but the lvm2 will open it (because it appears in the system's device list), so the 'timeout' comes (long time)? Thank you very much.

Regards,
Busby

#5 lore raw
Quoted 2 lines · Busby.Cheung

My LVM2 version is 2.02.54, haven't done any patch.
Did you mean that there were some patches to fix the 'take long time' 's bug?

I mean these not-yet released changes in upstream, not that fixes all problems, but should help

Version 2.02.63 -
Suppress repeated errors about the same missing PV uuids. Bypass full device scans when using internally-cached VG metadata. Only do one full device scan during each read of text format metadata.

Milan

#6 lore raw

Hi Milan,
Thank you very much for so detailed reply.
I still have one question, the full scan like 'vgs' will scan the devives(both used and unused in the LVM) to find the label info, I read the debug mesg by using 'vgs -vvvv' cmd. when it take a long time, it may stop for a while by output the '#device/dev-io.c:486 Opened /dev/sdp RO O_DIRECT' ('sdp' just for example,or may be a soft raid md device), I don't know why it will stop for a while, locking?device missing? or other reason? I need your help and advice.
The missing devices you mentioned in the emails before, means the devices used in the LVM (PVs), or the other devices in the system , or both? You said 'missing device was searched too many times slowing everything down'.

Best Regards,
Busby

Quoted 13 lines · 在2010-04-13 20:11:01,"Milan Broz" <[email protected]> 写道:
Quoted 2 lines · Busby.Cheung

My LVM2 version is 2.02.54, haven't done any patch.
Did you mean that there were some patches to fix the 'take long time' 's bug?

I mean these not-yet released changes in upstream, not that fixes all problems, but should help

Version 2.02.63 -
Suppress repeated errors about the same missing PV uuids. Bypass full device scans when using internally-cached VG metadata. Only do one full device scan during each read of text format metadata.

Milan