Tuesday, February 3, 2009

lquerypr - low level tool to break scsi disk reservation

lquerypr -Vh /dev/vpath13 -- list
lquerypr -Vph /dev/vpath13 -- to reset


1. To test the persistent reservation status on the device:

lquerypr -h /dev/vpath30

This will try to read the persisten reservation on the device without displaying.
If there is a persistent reservation, shell return code will be 0 if device
reserved by the current host, or 1 if device reserved by the other hosts.

2. To test and display the persistent reservation on the device:

lquerypr -vh /dev/vpath30

Same as above. In addtion, it displays the persistent reservation key.

3. To release the persistent reservation if the device is reserved by the current host:

lquerypr -rh /dev/vpath30

Release the persistent reservation if device is reserved by the current host.
Return code should be 0 if the command succeeds or if device is not reserved.
If the command fails, return code is 2.

4. To remove the persistent reservation and clear all reservation key registration:

lquerypr -ch /dev/vpath30

Removes the persistent reservation and clears all reservation key registration.
Return code is 0 if the command succeeds or 2 if the command fails.

5. To remove the persistent reservation if the device is reserved by the other host

lquerypr -ph /dev/vpath30


Removes the persistent reservation by preempting the persistent reservation
reserved by the other hosts . Return code is 0 if the command succeeds or if the
device is not reserved;.or it returns 2 if the command fails.

Note: If the command issued without options of -p, -r or -c, the command
will return 0 if there is no persistent reservation key on the device, or the
device is reserved by the current host; it returns 1 if the persistent reservation
key is different from the host reservation key; it returns 2 if the command fails,
or it returns 3 if device is already opened.

If the command issued with one of the options of -p, -r or -c, it returns
0 if the command succeeds; it returns 2 if the command fails, or it returns 3
if device is alreayd opened.


**Thanks to Suhaila for contribution.