Content-type: text/html
plus one of:
-r { k | r }
-c plus one of:
r -k key [ -A ]
i -k key [ -A ]
c -k key
p -k new -K old -t { e | E | A | w | W | a }
a -k key -K old -t { e | E | A | w | W | a }
-E -k key
-R -k key -t { e | E | A | w | W | a }
-Q
The cdi_pr program issues various SCSI Persistent Reservation commands to a tape device. It is mainly intended as a tools for exploring the behavior of Persistent Reserve and should not normally be used for day-to-day operations.
You may also specify a persistent reservation key. This key is used to identify the host you are running on to the tape drive, and may be an 8 character text string (e.g. NetWorkr) or a text representation of a 64-bit hex number (e.g. 0x123456789abcdef0). The default reservation key is NetWorkr. This utility will always use the "exclusive access" type of persistent reservation.
The cdi_pr program also returns the status of the named SCSI device (specified by the -f option).
Send a Persistent Reserve Out preempt command to preempt the reservation held by key
oldkey
and replace it with a reservation for key
key
of type specified by
Send a Persistent Reserve Out preempt and abort command to preempt the reservation held by key
oldkey
and replace it with a reservation for key
key
of type specified by
and abort any currently running tape command.
Persistent Reserve Out Reserve command with specified key and reservation type
A persistent reservation key is a 64-bit value. This can hold 8 text characters or a 64-bit number. You can specify either for this parameter. If the
key
entered starts with
0x
(zero x) then it is assumed to be a 64-bit number, otherwise it will be treated as an 8 character text string. The default value if you do not specify a key is
NetWorkr.
a
write exclusive - all registrants
A
exclusive access - all registrants
e
exclusive access - registrants only
E
exclusive access
w
write exclusive - registrants only
W
write exclusive
For information on what those all mean, please consult your handy-dandy SCSI-3 specification, such as ANSI NCITS 351-2001 (SPC-2) or SPC-3 working draft T10/1416-D.
Sample output including drive status information:
Query different drives for their Persistent Reserve capabilities
cdi_pr -f /dev/rmt/1cbn -Q Device /dev/rmt/1cbn (HP Ultrium 2-SCSI ): supports Persistent Reserve but NOT Activate Persist Through Power Loss bit cdi_pr -f /dev/rmt/0cbn -Q Device /dev/rmt/0cbn (HP Ultrium 1-SCSI ): does not seem to support Persistent Reserve at all Register from this host with the key Solaris cdi_pr -c r -k Solaris -f /dev/rmt/1cbn CDI_PR command Register succeeds Key "Solaris " was successfully registered cdi_info.drivestat is: status = 0, DRIVE_STATUS_READY msg = The tape drive is ready for use Read the keys from this drive cdi_pr -f /dev/rmt/1cbn -r k CDI_PR command Read Keys succeeds Read keys returns: generation = 12 data length = 16 Keys: "Solaris " "Windows " cdi_info.drivestat is: status = 0, DRIVE_STATUS_READY msg = The tape drive is ready for use Reserve this drive using the previously registered key of Solaris with reservation type of Exclusive cdi_pr -f /dev/rmt/1cbn -R -k Solaris -t E CDI_PR command Reserve succeeds Reserve of type Exclusive Res only (3) with key "Solaris " was successful cdi_info.drivestat is: status = 0, DRIVE_STATUS_READY msg = The tape drive is ready for use Read the reservations from this rive cdi_pr -f /dev/rmt/1cbn -r r CDI_PR command Read Reservations succeeds Read reservations returns: generation = 12 data length = 16 Reservations: Key: "Solaris ", type: Exclusive Res only (3), scope: LU, scope address: 0 cdi_info.drivestat is: status = 0, DRIVE_STATUS_READY msg = The tape drive is ready for use Release the reservation of this drive that was made using the key Solaris of type Exclusive cdi_pr -f /dev/rmt/1cbn -E -k Solaris -t E CDI_PR command Release succeeds Release with key "Solaris " was successful cdi_info.drivestat is: status = 0, DRIVE_STATUS_READY msg = The tape drive is ready for use If the drive is reserved by another host, you should see something like this: cdi_pr -f /dev/rmt/1cbn -r r CDI_PR command Read Reservations succeeds Read reservations returns: generation = 12 data length = 16 Reservations: Key: "Windows ", type: Exclusive Res only (3), scope: LU, scope address: 0 cdi_info.drivestat is: status = 0, DRIVE_STATUS_READY msg = The tape drive is ready for use cdi_pr -f /dev/rmt/1cbn -R -k Solaris -t E CDI_PR command Reserve failed. cdi_info.status = CDI_RESERVATION_ERROR (c) cdi_info.drivestat is: status = 0, DRIVE_STATUS_READY msg = The tape drive is ready for use