<div dir="ltr">Hello,<div>I'm unable to deactivate an lvm.</div><div><br></div><div>My system is RHEL 6.5 with lvm2-2.02.100-8.el6.x86_64 and kernel 2.6.32-431.29.2.el6.x86_64</div><div><br></div><div>I get error code 5 with message<br></div><div>  Logical volume VG_AAA_TEMP/LV_AAA_TEMP in use.<br></div><div><br></div><div>You can find output of</div><div>lvchange -d -d -d -d -d -d -an VG_AAA_TEMP/LV_AAA_TEMP<br></div><div>here:</div><div><a href="https://drive.google.com/file/d/0BwoPbcrMv8mvTjlBMkRUbG9nczA/view?usp=sharing">https://drive.google.com/file/d/0BwoPbcrMv8mvTjlBMkRUbG9nczA/view?usp=sharing</a><br></div><div><br></div><div>Recreating sources from the related src.rpm the problem (as stated anyway in error message too) is in code</div><div><br></div><div>activate/activate.c:711   Logical volume in use<br></div><div><br></div><div>that is</div><div><div>        while (open_count_check_retries--) {</div><div>                if (info->open_count > 0) {</div><div>                        if (open_count_check_retries) {</div><div>                                usleep(OPEN_COUNT_CHECK_USLEEP_DELAY);</div><div>                                log_debug_activation("Retrying open_count check for %s/%s.",</div><div>                                                     lv->vg->name, lv->name);</div><div>                                if (!lv_info(cmd, lv, 0, info, 1, 0))</div><div>                                        return -1;</div><div>                                continue;</div><div>                        }</div><div>                        log_error("Logical volume %s/%s in use.",</div><div>                                  lv->vg->name, lv->name);</div><div>                        return 0;</div><div>                } else</div><div>                        break;</div><div>        }</div></div><div><br></div><div>In fact I get this information querying device:</div><div><br></div><div><div>[root@orapr2 activate]# dmsetup info --checks 360a9800037543544465d424130533177</div><div>Name:              360a9800037543544465d424130533177</div><div>State:             ACTIVE</div><div>Read Ahead:        256</div><div>Tables present:    LIVE</div><div>Open count:        1</div><div>Event number:      23</div><div>Major, minor:      253, 4</div><div>Number of targets: 1</div><div>UUID: mpath-360a9800037543544465d424130533177</div></div><div><br></div><div><div>[root@orapr2 activate]# dmsetup table 360a9800037543544465d424130533177</div><div>0 2097152 multipath 4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handler 1 alua 2 1 round-robin 0 4 1 66:160 1 69:192 1 133:224 1 8:288 1 round-robin 0 4 1 8:96 1 68:48 1 129:32 1 130:128 1 </div></div><div><br></div><div>I got in past days a problem related to sempahores </div><div>(maximum number of semaphore sets has been exceeded)</div><div>and I suspect that some resource could have been incorrectly locked.</div><div><br></div><div>The device is sort of</div><div>  [root@orapr2 ~]# multipath -l  360a9800037543544465d424130533177</div><div>360a9800037543544465d424130533177 dm-4 NETAPP,LUN</div><div>size=1.0G features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw</div><div>|-+- policy='round-robin 0' prio=0 status=active</div><div>| |- 1:0:1:7  sdaq 66:160  active undef  running</div><div>| |- 1:0:2:7  sdco 69:192  active undef  running</div><div>| |- 2:0:2:7  sdho 133:224 active undef  running</div><div>| `- 2:0:3:7  sdiy 8:288   active undef  running</div><div>`-+- policy='round-robin 0' prio=0 status=enabled</div><div>  |- 1:0:0:7  sdg  8:96    active undef  running</div><div>  |- 2:0:0:7  sdbp 68:48   active undef  running</div><div>  |- 1:0:3:7  sdeq 129:32  active undef  running</div><div>  `- 2:0:1:7  sdfm 130:128 active undef  running</div><div><br></div><div>and the filesystem on it has been successfully umounted, but</div><div><br></div><div><div>[root@orapr2 ~]# lvs VG_AAA_TEMP/LV_AAA_TEMP</div><div>  LV          VG          Attr       LSize    Pool Origin Data%  Move Log Cpy%Sync Convert</div><div>  LV_AAA_TEMP VG_AAA_TEMP -wi-ao---- 1020.00m</div></div><div><br></div><div>How can I see the responsible for the reference that apparently keeps it open?</div><div><br></div><div>Open count:        1<br></div><div>so I can check and eventually fix??</div><div><br></div><div>Thanks in advance.<br></div><div><br></div><div>Gianluca</div></div>