Wednesday, March 24, 2010

How to remove a reservation key from a lun that is not used anymore

If you try to add a LUN to a server and you are not able to do anything on this LUN (e.g.: metainit is not working) most probubly this luns was used somewhere before and the reservation key was not removed from it.

in order to remove the reservation key (BEFORE you remove it make sure the LUN has been removed from the other system and it’s not needed anymore otherwise you will lose your data and the other system will panic)

1. Check if you have reservation key in the LUN (you will need the sun cluster to be installed, if you don’t have it in the system try to mount the directory /usr/cluster from any sun cluster node to your server (nfs), I know it’s a dirty trick, but it will help.

root@localhost# /usr/cluster/lib/sc/scsi -c inkeys -d /dev/rdsk/c8t6005076300C0B334000000000000170Ed0s2
Reservation keys(4):
0×420773ee00000001
0×420773ee00000002
0×420773ee00000004
0×420773ee00000003 <— reservation key number

root@localhost# /usr/cluster/lib/sc/scsi -c inresv -d /dev/rdsk/c8t6005076300C0B334000000000000170Ed0s2
Reservations(1):
0×420773ee00000002
type —> 5

2. Run the following command to clean/remove the reservation keys

root@localhost# /usr/cluster/lib/sc/scsi -c scrub -d /dev/rdsk/c8t6005076300C0B334000000000000170Ed0s2
Reservation keys currently on disk:
0×420773ee00000001
0×420773ee00000002
0×420773ee00000004
0×420773ee00000003
Attempting to remove all keys from the disk…
Scrubbing complete, use ‘/usr/cluster/lib/sc/scsi -c inkeys -d /dev/rdsk/c8t6005076300C0B334000000000000170Ed0s2′ to verify success

No comments: