[linux-lvm] [PATCH] lib/metadata: add new api lv_is_available()

Zdenek Kabelac zkabelac at redhat.com
Fri Aug 28 16:04:44 UTC 2020

Dne 27. 08. 20 v 18:05 Zhao Heming napsal(a):
> It commit is enhancement for 1d0dc74f9147e3c1f3681efa4166cbe2edcb6571
> 1d0dc74f9147 only supports all raid type, this commit adds new api
> and extends support scope with linear/mirror type.
> This patch introduced a new flag NOT_AVAIL_LV, when a lv (includeing
> sub-lv or child-lv) doesn't work, this flag will set.
> With this patch, for linear type LV, one of two disks missing,
> lvdisplay will show
> from:
>    LV Status              available (partial)
> to:
>    LV Status              NOT available (partial)


LV 'available' has one simple meaning - LV is present in DM table.
Status is either available or NOT available.

Partially is completely different flag.

Please do not mix existing logic and existing script with some new unknown args.

Also note - preferred usage is 'lvs'  - lvdisplay is mostly a backward 
compatible tool with sometimes 'easier' to get some info - but normally all
the info should be obtained with 'lvs'  tool which is highly configurable
and support much easier output for parsing in scripts.
(lvdisplay is missing TONS of attributes otherwise accessible with lvs)



More information about the linux-lvm mailing list