Skip to content
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

Closed
npu21 opened this issue Aug 9, 2022 · 16 comments
Closed

lvs display less lv than /dev/mapper #89

npu21 opened this issue Aug 9, 2022 · 16 comments

Comments

@npu21
Copy link

npu21 commented Aug 9, 2022

image
lvs only display two lvs ,while there are five lvs in fact,
image
We can see vgchange -ay lvmvg -vvvv log below

#device/dev-cache.c:352         /dev/disk/by-id/dm-name-lvmvg-pvc--ca875c4b--0487--4b08--b961--4c12d237bfdd: Aliased to /dev/dm-0 in device cache (preferred name) (253:0)
#device/dev-cache.c:352         /dev/disk/by-id/dm-uuid-LVM-h4qwOTOOuBsBhbMzH24uA0lmnDlA6u0vGgzFNEN8qeHpIngzHUwzkD6AE5aAWzd0: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--ca875c4b--0487--4b08--b961--4c12d237bfdd in device cache (253:0)
#device/dev-cache.c:352         /dev/disk/by-uuid/8841ac6d-a19c-4dbd-bc9f-4efe9d5a3af6: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--ca875c4b--0487--4b08--b961--4c12d237bfdd in device cache (253:0)
#device/dev-cache.c:352         /dev/lvmvg/pvc-ca875c4b-0487-4b08-b961-4c12d237bfdd: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--ca875c4b--0487--4b08--b961--4c12d237bfdd in device cache (preferred name) (253:0)
#device/dev-cache.c:352         /dev/mapper/lvmvg-pvc--ca875c4b--0487--4b08--b961--4c12d237bfdd: Aliased to /dev/lvmvg/pvc-ca875c4b-0487-4b08-b961-4c12d237bfdd in device cache (253:0)
#device/dev-cache.c:356         /dev/dm-1: Added to device cache (253:1)
#device/dev-cache.c:352         /dev/disk/by-id/dm-name-lvmvg-pvc--6c0d9470--19cb--4f1c--9c3c--c248f7514540: Aliased to /dev/dm-1 in device cache (preferred name) (253:1)
#device/dev-cache.c:352         /dev/disk/by-id/dm-uuid-LVM-h4qwOTOOuBsBhbMzH24uA0lmnDlA6u0vpTtxHY43tRa0Ulb85xekKJoECQL1tDFz: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--6c0d9470--19cb--4f1c--9c3c--c248f7514540 in device cache (253:1)
#device/dev-cache.c:352         /dev/disk/by-uuid/4752770f-afb9-4fa6-ae2f-3ee4480befc7: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--6c0d9470--19cb--4f1c--9c3c--c248f7514540 in device cache (253:1)
#device/dev-cache.c:352         /dev/lvmvg/pvc-6c0d9470-19cb-4f1c-9c3c-c248f7514540: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--6c0d9470--19cb--4f1c--9c3c--c248f7514540 in device cache (preferred name) (253:1)
#device/dev-cache.c:352         /dev/mapper/lvmvg-pvc--6c0d9470--19cb--4f1c--9c3c--c248f7514540: Aliased to /dev/lvmvg/pvc-6c0d9470-19cb-4f1c-9c3c-c248f7514540 in device cache (253:1)
#device/dev-cache.c:356         /dev/dm-2: Added to device cache (253:2)
#device/dev-cache.c:352         /dev/disk/by-id/dm-name-lvmvg-pvc--668a527b--0266--450a--9fd4--6bcdd14985b6: Aliased to /dev/dm-2 in device cache (preferred name) (253:2)
#device/dev-cache.c:352         /dev/disk/by-id/dm-uuid-LVM-h4qwOTOOuBsBhbMzH24uA0lmnDlA6u0vxdtsRrpCNZQAOJw1uR0oNNlFzIqgCUiU: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--668a527b--0266--450a--9fd4--6bcdd14985b6 in device cache (253:2)
#device/dev-cache.c:352         /dev/disk/by-uuid/3fcd2180-2cc6-4181-9082-d0a73b3bbdaa: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--668a527b--0266--450a--9fd4--6bcdd14985b6 in device cache (253:2)
#device/dev-cache.c:352         /dev/lvmvg/pvc-668a527b-0266-450a-9fd4-6bcdd14985b6: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--668a527b--0266--450a--9fd4--6bcdd14985b6 in device cache (preferred name) (253:2)
#device/dev-cache.c:352         /dev/mapper/lvmvg-pvc--668a527b--0266--450a--9fd4--6bcdd14985b6: Aliased to /dev/lvmvg/pvc-668a527b-0266-450a-9fd4-6bcdd14985b6 in device cache (253:2)
#device/dev-cache.c:356         /dev/dm-3: Added to device cache (253:3)
#device/dev-cache.c:352         /dev/disk/by-id/dm-name-lvmvg-pvc--8df5edc6--e6df--448c--a9ed--4729effa54e6: Aliased to /dev/dm-3 in device cache (preferred name) (253:3)
#device/dev-cache.c:352         /dev/disk/by-id/dm-uuid-LVM-h4qwOTOOuBsBhbMzH24uA0lmnDlA6u0vBqfUWZ0MJf021NcaEvrMOtPwu1xkn0ZI: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--8df5edc6--e6df--448c--a9ed--4729effa54e6 in device cache (253:3)
#device/dev-cache.c:352         /dev/disk/by-uuid/a5c70905-ca27-4652-879c-4950d68e53c5: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--8df5edc6--e6df--448c--a9ed--4729effa54e6 in device cache (253:3)
#device/dev-cache.c:352         /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--8df5edc6--e6df--448c--a9ed--4729effa54e6 in device cache (preferred name) (253:3)
#device/dev-cache.c:352         /dev/mapper/lvmvg-pvc--8df5edc6--e6df--448c--a9ed--4729effa54e6: Aliased to /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6 in device cache (253:3)
#device/dev-cache.c:356         /dev/dm-6: Added to device cache (253:6)
#device/dev-cache.c:352         /dev/disk/by-id/dm-name-lvmvg-pvc--16f827ed--d7d7--4b01--a742--60ea85c186cd: Aliased to /dev/dm-6 in device cache (preferred name) (253:6)
#device/dev-cache.c:352         /dev/disk/by-id/dm-uuid-LVM-h4qwOTOOuBsBhbMzH24uA0lmnDlA6u0vjEv977cGJWwkCuFBT3tJ66m3tt8pIEXC: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--16f827ed--d7d7--4b01--a742--60ea85c186cd in device cache (253:6)
#device/dev-cache.c:352         /dev/disk/by-uuid/0e96280e-a46e-468c-8046-a5aa881b7944: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--16f827ed--d7d7--4b01--a742--60ea85c186cd in device cache (253:6)
#device/dev-cache.c:352         /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: Aliased to /dev/disk/by-id/dm-name-lvmvg-pvc--16f827ed--d7d7--4b01--a742--60ea85c186cd in device cache (preferred name) (253:6)
#device/dev-cache.c:352         /dev/mapper/lvmvg-pvc--16f827ed--d7d7--4b01--a742--60ea85c186cd: Aliased to /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd in device cache (253:6)
#cache/lvmcache.c:1871         lvmcache /dev/vdb1: now in VG #orphans_lvm2 (#orphans_lvm2) with 0 mda(s).
#libdm-config.c:997       Setting size to 1044480
#libdm-config.c:997       Setting start to 4096
#libdm-config.c:997       Setting ignore to 0
#metadata/vg.c:74         Allocated VG lvmvg at 0x56341bc44840.
#format_text/import_vsn1.c:597         Importing logical volume lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd.
#format_text/import_vsn1.c:597         Importing logical volume lvmvg/pvc-668a527b-0266-450a-9fd4-6bcdd14985b6.
#cache/lvmcache.c:522         lvmcache has no info for vgname "lvmvg" with VGID h4qwOTOOuBsBhbMzH24uA0lmnDlA6u0v.
#cache/lvmcache.c:522         lvmcache has no info for vgname "lvmvg".
#cache/lvmcache.c:1871         lvmcache /dev/vdb1: now in VG lvmvg with 1 mda(s).
#cache/lvmcache.c:1635         lvmcache /dev/vdb1: VG lvmvg: set VGID to h4qwOTOOuBsBhbMzH24uA0lmnDlA6u0v.
#cache/lvmcache.c:1944         lvmcache /dev/vdb1: VG lvmvg: set system_id to .
#cache/lvmcache.c:202         Metadata cache: VG lvmvg (h4qwOT-OOuB-sBhb-MzH2-4uA0-lmnD-lA6u0v) stored (1371 bytes).
#cache/lvmetad.c:2292         Sending lvmetad vg_clear_outdated_pvs
#libdm-config.c:966       Setting response to OK
#libdm-config.c:966       Setting response to OK
#libdm-config.c:966       Setting response to OK
#device/dev-io.c:570         Opened /dev/vdb1 RO O_DIRECT
#device/dev-io.c:330       /dev/vdb1: size is 4192223 sectors
#metadata/pv_manip.c:421         /dev/vdb1 0:      0    256: pvc-668a527b-0266-450a-9fd4-6bcdd14985b6(0:0)
#metadata/pv_manip.c:421         /dev/vdb1 1:    256    225: NULL(0:0)
#metadata/pv_manip.c:421         /dev/vdb1 2:    481     25: pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd(0:0)
#metadata/pv_manip.c:421         /dev/vdb1 3:    506      5: NULL(0:0)
#metadata/vg.c:74         Allocated VG lvmvg at 0x56341bc48850.
#format_text/import_vsn1.c:597         Importing logical volume lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd.
#format_text/import_vsn1.c:597         Importing logical volume lvmvg/pvc-668a527b-0266-450a-9fd4-6bcdd14985b6.
#toollib.c:1970       Process single VG lvmvg
#metadata/vg.c:89         Freeing VG lvmvg at 0x56341bc3bfd0.

and pvscan --cache -vvvv log below

#device/dev-io.c:570         Opened /dev/loop3 RO O_DIRECT
#device/dev-io.c:330       /dev/loop3: size is 0 sectors
#filters/filter-usable.c:44         /dev/loop3: Skipping: Too small to hold a PV
#device/dev-io.c:625         Closed /dev/loop3
#ioctl/libdm-iface.c:1848         dm status   (253:3) [ noopencount noflush ]   [16384] (*1)
#device/dev-io.c:570         Opened /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6 RO O_DIRECT
#device/dev-io.c:330       /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: size is 409600 sectors
#device/dev-io.c:625         Closed /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6
#device/dev-io.c:570         Opened /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6 RO O_DIRECT
#device/dev-io.c:145         /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: block size is 1024 bytes
#device/dev-io.c:156         /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: physical block size is 512 bytes
#device/dev-io.c:625         Closed /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6
#device/dev-io.c:308       /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: using cached size 409600 sectors
#device/dev-io.c:570         Opened /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6 RO O_DIRECT
#device/dev-io.c:145         /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: block size is 1024 bytes
#device/dev-io.c:156         /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: physical block size is 512 bytes
#device/dev-io.c:625         Closed /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6
#device/dev-cache.c:1536         Using /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6
#label/label.c:286         Reading label from device /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6
#device/dev-io.c:570         Opened /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6 RO O_DIRECT
#device/dev-io.c:145         /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: block size is 1024 bytes
#device/dev-io.c:156         /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: physical block size is 512 bytes
#label/label.c:189       /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6: No label detected
#device/dev-io.c:625         Closed /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6
#cache/lvmetad.c:2091     No PV label found on /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6.
#cache/lvmetad.c:1738         Telling lvmetad to forget any PV on /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6
#libdm-config.c:966       Setting response to unknown
#libdm-config.c:966       Setting response to unknown
#libdm-config.c:966       Setting response to unknown
#libdm-config.c:966       Setting response to unknown
#cache/lvmetad.c:781       Request to drop PV /dev/lvmvg/pvc-8df5edc6-e6df-448c-a9ed-4729effa54e6 in lvmetad did not find any matching object.
#device/dev-io.c:570         Opened /dev/loop4 RO O_DIRECT
#device/dev-io.c:330       /dev/loop4: size is 0 sectors
#filters/filter-usable.c:44         /dev/loop4: Skipping: Too small to hold a PV
#device/dev-io.c:625         Closed /dev/loop4
#device/dev-io.c:570         Opened /dev/loop5 RO O_DIRECT
#device/dev-io.c:330       /dev/loop5: size is 0 sectors
#filters/filter-usable.c:44         /dev/loop5: Skipping: Too small to hold a PV
#device/dev-io.c:625         Closed /dev/loop5
#device/dev-io.c:570         Opened /dev/loop6 RO O_DIRECT
#device/dev-io.c:330       /dev/loop6: size is 0 sectors
#filters/filter-usable.c:44         /dev/loop6: Skipping: Too small to hold a PV
#device/dev-io.c:625         Closed /dev/loop6
#ioctl/libdm-iface.c:1848         dm status   (253:6) [ noopencount noflush ]   [16384] (*1)
#device/dev-io.c:570         Opened /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd RO O_DIRECT
#device/dev-io.c:330       /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: size is 204800 sectors
#device/dev-io.c:625         Closed /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd
#device/dev-io.c:570         Opened /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd RO O_DIRECT
#device/dev-io.c:145         /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: block size is 1024 bytes
#device/dev-io.c:156         /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: physical block size is 512 bytes
#device/dev-io.c:625         Closed /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd
#device/dev-io.c:308       /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: using cached size 204800 sectors
#device/dev-io.c:570         Opened /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd RO O_DIRECT
#device/dev-io.c:145         /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: block size is 1024 bytes
#device/dev-io.c:156         /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: physical block size is 512 bytes
#device/dev-io.c:625         Closed /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd
#device/dev-cache.c:1536         Using /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd
#label/label.c:286         Reading label from device /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd
#device/dev-io.c:570         Opened /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd RO O_DIRECT
#device/dev-io.c:145         /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: block size is 1024 bytes
#device/dev-io.c:156         /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: physical block size is 512 bytes
#label/label.c:189       /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd: No label detected
#device/dev-io.c:625         Closed /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd
#cache/lvmetad.c:2091     No PV label found on /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd.
#cache/lvmetad.c:1738         Telling lvmetad to forget any PV on /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd
#libdm-config.c:966       Setting response to unknown
#libdm-config.c:966       Setting response to unknown
#libdm-config.c:966       Setting response to unknown
#libdm-config.c:966       Setting response to unknown
#cache/lvmetad.c:781       Request to drop PV /dev/lvmvg/pvc-16f827ed-d7d7-4b01-a742-60ea85c186cd in lvmetad did not find any matching object.
#device/dev-io.c:570         Opened /dev/loop7 RO O_DIRECT

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

@zkabelac
Copy link
Contributor

zkabelac commented Aug 9, 2022

lvs comes with option '-a' to show also 'hidden' LV (various 'metadata/auxiliary devices - I'd not call them abnormal).
Also for 'old thick snapshot' there are layered devices that are completely hidden from view and only maintained by LV.

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)
Users shall not try to 'randomly' access hidden devices as it may cause troubles to them - so unless they are experts with knowledge about DM/LVM internals - publicLVs are only those to be used...

Assuming this fixes you issue (so closing)

@npu21
Copy link
Author

npu21 commented Aug 10, 2022

However, lvs -a still only show the two LVs
image
lvs.txt

@zkabelac
Copy link
Contributor

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.
You can explore those 'orphan' devices with commands: 'dmsetup table', 'dmsetup info -c', 'dmsetup status' - and if you decide there are some 'forgotten' devs you can remove them with 'dmsetup remove devname' command.

@npu21
Copy link
Author

npu21 commented Aug 10, 2022

@zkabelac Thanks for your quick reply
In fact, we want the three LVs appear in lvs. Could you tell me why the three LVs doesn't show?
image

@zkabelac
Copy link
Contributor

From the provided output of 'dmsetup info -c' - all your devices seem to be 'in-use' (open count > 0)
From the same UUID prefix - it looks like your DM/LV devices do come originally from the same VG (LVM-"VG_UUID""LV_UUDI"). So my guess can be - that some has made 'vgcfgrestore' and restored some previous content of lvm2 metadata - so you've lost info about all LVs - only 2 them remained visible.

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.

@npu21
Copy link
Author

npu21 commented Aug 10, 2022

In fact, we've already checked the archive folder but found no history of the three LVs
image
Really frustrated. Help @zkabelac

@zkabelac
Copy link
Contributor

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....

@npu21
Copy link
Author

npu21 commented Aug 11, 2022

@zkabelac Thanks for your quick reply!
If reboot , the three LVs will disappear from /dev/mapper and /dev/lvmvg, and the data will lose forever(can't recover from /etc/lvm/archive).
We have experienced this situation days ago.
In fact, we don't do any wild manipulation. There's a chance of this issue happening.

@npu21
Copy link
Author

npu21 commented Aug 24, 2022

@zkabelac Is there a way to get lvs show the missed LVs back manually?Thanks in advance!
image

@zkabelac
Copy link
Contributor

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)....

@npu21
Copy link
Author

npu21 commented Aug 24, 2022

@zkabelac Thanks for your quick reply!
In fact,I've tried this
image
There only records are my amtempt to recreate the LV

@zkabelac
Copy link
Contributor

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...

@npu21
Copy link
Author

npu21 commented Aug 25, 2022

@zkabelac They are the very same physical disk space of 252:17 because the LVs are all created in vdb1
image

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....

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.

@npu21
Copy link
Author

npu21 commented Aug 25, 2022

@zkabelac Does this issue triggered by locking_type in /etc/lvm/lvm.conf ? My test env didn't config this previously.
I've configured this and retest now

image

@zkabelac
Copy link
Contributor

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....

@zkabelac
Copy link
Contributor

Closing issue - as this is certainly not a bug on lvm2 side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants