-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lvs display less lv than /dev/mapper #89
Comments
lvs comes with option '-a' to show also 'hidden' LV (various 'metadata/auxiliary devices - I'd not call them abnormal). lvm2 users are supposed to be accessing devices via: /dev/vgname/lvname path and not through /dev/mapper/ where the name mangling may make the access by name non-trivial (see the 'man lvm' for more details) Assuming this fixes you issue (so closing) |
However, lvs -a still only show the two LVs |
lvm2 lvs command prints information only about LVs known from vg metadata (lvmvg in your case). If you have there any other 'dm' devices (even created by lvm2 - but without matching metadata) lvs will NOT print them as LV. |
@zkabelac Thanks for your quick reply |
From the provided output of 'dmsetup info -c' - all your devices seem to be 'in-use' (open count > 0) So please check your /etc/lvm/archive for the history of lvm2 operation and check if you can find out 'better' version corresponding to your observed 'reality'. Archived lvm2 metadata are relatively easily readable so you should be able to figure out which LVs are present and what are their UUIDs and eventually you may spot the history of changes. I'd also highly recommend to switch to use latest versions of lvm2. |
In fact, we've already checked the archive folder but found no history of the three LVs |
Well since I could hardly guess what you've been all doing on your machine - or what kind of storage you use as PV (possible shared ? mounted on multiple host ?) I could only guess from what I see out of your 'dm table' report: Dm/LV device '...pvc--668a527b....' is using the very same physical disk space of your device 252:17 as dm device '...pvc--6c0d9470...', disk '...pvc--8df5edc6...' and also disk '..pvc--ca875c4b...'. So whatever strange was going on your machine - I'd highly recommend to immediately restart the machine and figure out who was doing such wild manipulation with dm table. So really there are only these 2 'separate' device: '...pvc--668a527b...' & '...pvc--16f827ed...' as your lvs prints... Rest is some 'duplicated' garbage which was created in some very 'unusual' command execution.... |
@zkabelac Thanks for your quick reply! |
@zkabelac Is there a way to get lvs show the missed LVs back manually?Thanks in advance! |
LVS only shows LVs known in your 'existing' metadata. For 'archeology' of some forgotten devices in your system you would need to examine history of metadata located '/etc/lvm/archive' whether you will find there some matching identifiers. Lvm2 metadata is 'reasonably' readable for a human. The last trace of history could be found in 'header' of your PV device (usually in the first MiB).... |
@zkabelac Thanks for your quick reply! |
As mentioned above - you can check from 'dmsetup table' or 'dmsetup deps' a device in-use by your DM target - such device should be your PV - if you then read first 1MiB of such device (by i.e. DD command' - you could explore the metadata ring buffer located there - it's not exactly 'trivial' - but not a rocket science - so if you want to discover out of where your DM device comes from... |
@zkabelac They are the very same physical disk space of 252:17 because the LVs are all created in vdb1
Anyway,Is there a way to get the lost LVs shown in lvs command ? For now, the /dev/mapper and /dev/lvmvg works well, though no record in the lvm archive(which is really wired).But if reboot,the LV will lost forever. |
@zkabelac Does this issue triggered by locking_type in /etc/lvm/lvm.conf ? My test env didn't config this previously. |
It's hard to give any advice, if you don't know how the machine is operated, how many sysadmins do have access to this box, and who is capable to active devices. From your shown traces - you had there 'several' DM devices mapping same physical disk space - so if you have no idea how they were 'created' - and this is would be very 'hard' to reach this state just by 'chance' if you would be using 'regular' commands (with a normal 'way' of using - avoiding all '--force' behavior, locking or other type of misconfiguration) - we can't really move any further... I'd recommend simply reboot your seriously badly misconfigured box - and try to figure out who were all the admins doing this setup.... |
Closing issue - as this is certainly not a bug on lvm2 side. |
lvs only display two lvs ,while there are five lvs in fact,
We can see vgchange -ay lvmvg -vvvv log below
and pvscan --cache -vvvv log below
From the two logs, there's no difference from the normal lv and the abnormal lv.
Could anyone take a look please?
pvscan.txt
vgchange.txt
The text was updated successfully, but these errors were encountered: