清除磁盘上的scsi pr锁

查询磁盘上是否有锁,如下图所示,有一个锁,key是0x3943d99f0001734d

[root@localhost ~]# sg_persist -r /dev/sdb
  DotHill   DH3000            G22x
  Peripheral device type: disk
  PR generation=0x521, Reservation follows:
    Key=0x3943d99f0001734d
    scope: LU_SCOPE,  type: Write Exclusive, registrants only

如果有锁,解决方法是,在另外一个机器上,先注册一个锁,然后解除你注册的锁。这样磁盘就放出来了

注册锁(123abc这个ID可以自己随意起一个)

[root@localhost ~]# sg_persist --out --register --param-sark=123abc /dev/sdb
  DotHill   DH3000            G22x
  Peripheral device type: disk

取消注册锁

[root@localhost ~]# sg_persist --out  --param-rk=123abc --clear /dev/sdb
  DotHill   DH3000            G22x
  Peripheral device type: disk

再次查询确认是否还有锁

[root@localhost ~]# sg_persist -r /dev/sdb
  DotHill   DH3000            G22x
  Peripheral device type: disk
  PR generation=0x523, there is NO reservation held
posted @ 2022-01-13 16:08  一只不会飞的猪  阅读(725)  评论(0)    收藏  举报