vgchange may not properly deactivate a VG when there are many mirrored LV active
Issue
- vgchange may not be able to fully deactivate all maps of mirrored LVs when there are many mirrored LVs active:
[root@localhost disks]# vgchange -an mirrors ; lvs -a mirrors
0 logical volume(s) in volume group "mirrors" now active
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
[...]
mirror4 mirrors mwi--- 52.00M mirror4_mlog
[mirror4_mimage_0] mirrors Iwi-a- 52.00M
[mirror4_mimage_1] mirrors Iwi-a- 52.00M
[mirror4_mlog] mirrors mwi-a- 4.00M 100.00
[mirror4_mlog_mimage_0] mirrors iwi-ao 4.00M
[mirror4_mlog_mimage_1] mirrors iwi-ao 4.00M
mirror5 mirrors mwi--- 52.00M mirror5_mlog
[mirror5_mimage_0] mirrors Iwi-a- 52.00M
[mirror5_mimage_1] mirrors Iwi-a- 52.00M
[mirror5_mlog] mirrors mwi-a- 4.00M 100.00
[mirror5_mlog_mimage_0] mirrors iwi-ao 4.00M
[mirror5_mlog_mimage_1] mirrors iwi-ao 4.00M
[root@localhost disks]# dmsetup table | grep "^mirrors"
mirrors-mirror4_mlog: 0 8192 mirror core 2 1024 block_on_error 2 252:260 0 252:261 0
mirrors-mirror5_mlog_mimage_0: 0 8192 linear 7:3 33152
mirrors-mirror5_mimage_1: 0 106496 linear 7:1 524672
mirrors-mirror5_mimage_0: 0 106496 linear 7:0 524672
mirrors-mirror5_mlog: 0 8192 mirror core 2 1024 block_on_error 2 252:296 0 252:297 0
mirrors-mirror4_mlog_mimage_1: 0 8192 linear 7:4 24960
mirrors-mirror4_mimage_1: 0 106496 linear 7:1 418176
mirrors-mirror4_mlog_mimage_0: 0 8192 linear 7:3 24960
mirrors-mirror4_mimage_0: 0 106496 linear 7:0 418176
mirrors-mirror5_mlog_mimage_1: 0 8192 linear 7:4 33152
-
In the example above : although the main LVs (the one that is supposed to be used,
mirror4andmirror5) have been removed, not all the underlying maps (mirror legs and logs) remain active. -
In a High Availability environment (HA-LVM, tag based or clvmd based), this leads to rgmanager failure when attempting to deactivate the
resource:
lvm[21268]: No longer monitoring mirror device mirrors-mirror4_mlog for events.
multipathd: dm-127: devmap not registered, can't remove
lvm[21268]: dm_task_run failed, errno = 6, No such device or address
multipathd: dm-138: remove map (uevent)
lvm[21268]: mirrors-mirror4 disappeared, detaching
multipathd: dm-138: devmap not registered, can't remove
lvm[21268]: No longer monitoring mirror device mirrors-mirror4 for events.
clurgmgrd: [10593]: <err> Logical volume mirrors/ failed to shutdown
clurgmgrd[10593]: <notice> stop on lvm "HALVM" returned 1 (generic error)
clurgmgrd: [10593]: <info> unmounting /mnt/share
The typical failure has the particularity NOT to show the failed LV, but an empty name in place of the LV, thus only the VG is shown:
<err> Logical volume mirrors/ failed to shutdown
Environment
- Red Hat Enterprise Linux 5 (RHEL 5)
lvm2, with several mirrored LVs- Optionally seen together with High Availability and mirrored HA-LVM resources
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
