diff options
Diffstat (limited to 'usr.sbin/ctladm/ctladm.8')
-rw-r--r-- | usr.sbin/ctladm/ctladm.8 | 122 |
1 files changed, 39 insertions, 83 deletions
diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8 index 114b5fe..61b6d42 100644 --- a/usr.sbin/ctladm/ctladm.8 +++ b/usr.sbin/ctladm/ctladm.8 @@ -1,5 +1,6 @@ .\" .\" Copyright (c) 2003 Silicon Graphics International Corp. +.\" Copyright (c) 2015 Alexander Motin <mav@FreeBSD.org> .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -34,7 +35,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd June 3, 2015 +.Dd September 12, 2015 .Dt CTLADM 8 .Os .Sh NAME @@ -43,28 +44,28 @@ .Sh SYNOPSIS .Nm .Aq Ar command -.Op target:lun +.Op lun .Op generic args .Op command args .Nm .Ic tur -.Aq target:lun +.Aq lun .Op general options .Nm .Ic inquiry -.Aq target:lun +.Aq lun .Op general options .Nm .Ic reqsense -.Aq target:lun +.Aq lun .Op general options .Nm .Ic reportluns -.Aq target:lun +.Aq lun .Op general options .Nm .Ic read -.Aq target:lun +.Aq lun .Op general options .Aq Fl l Ar lba .Aq Fl d Ar datalen @@ -74,7 +75,7 @@ .Op Fl N .Nm .Ic write -.Aq target:lun +.Aq lun .Op general options .Aq Fl l Ar lba .Aq Fl d Ar datalen @@ -83,19 +84,13 @@ .Op Fl c Ar cdbsize .Op Fl N .Nm -.Ic bbrread -.Aq target:lun -.Op general options -.Aq Fl -l Ar lba -.Aq Fl -d Ar datalen -.Nm .Ic readcap -.Aq target:lun +.Aq lun .Op general options .Op Fl c Ar cdbsize .Nm .Ic modesense -.Aq target:lun +.Aq lun .Aq Fl m Ar page | Fl l .Op Fl P Ar pc .Op Fl d @@ -103,19 +98,19 @@ .Op Fl c Ar size .Nm .Ic start -.Aq target:lun +.Aq lun .Op general options .Op Fl i .Op Fl o .Nm .Ic stop -.Aq target:lun +.Aq lun .Op general options .Op Fl i .Op Fl o .Nm .Ic synccache -.Aq target:lun +.Aq lun .Op general options .Op Fl l Ar lba .Op Fl b Ar blockcount @@ -129,14 +124,10 @@ .Ic startup .Op general options .Nm -.Ic hardstop -.Nm -.Ic hardstart -.Nm .Ic lunlist .Nm .Ic delay -.Aq target:lun +.Aq lun .Aq Fl l Ar datamove|done .Aq Fl t Ar secs .Op Fl T Ar oneshot|cont @@ -144,11 +135,11 @@ .Ic realsync Aq on|off|query .Nm .Ic setsync interval -.Aq target:lun +.Aq lun .Aq Fl i Ar interval .Nm .Ic getsync -.Aq target:lun +.Aq lun .Nm .Ic inject .Aq Fl i Ar action @@ -176,6 +167,7 @@ .Ic modify .Aq Fl b Ar backend .Aq Fl l Ar lun_id +.Op Fl o Ar name=value .Aq Fl s Ar size_bytes .Nm .Ic devlist @@ -245,8 +237,8 @@ utility has a number of primary functions, many of which require a device identifier. The device identifier takes the following form: .Bl -tag -width 14n -.It target:lun -Specify the target (almost always 0) and LUN number to operate on. +.It lun +Specify the LUN number to operate on. .El Many of the primary functions of the .Nm @@ -364,34 +356,6 @@ to the kernel when doing a write, just execute the command without copying data. This is to be used for performance testing. .El -.It Ic bbrread -Issue a SCSI READ command to the logical device to potentially force a bad -block on a disk in the RAID set to be reconstructed from the other disks in -the array. This command should only be used on an array that is in the -normal state. If used on a critical array, it could cause the array to go -offline if the bad block to be remapped is on one of the disks that is -still active in the array. -.Pp -The data for this particular command will be discarded, and not returned to -the user. -.Pp -In order to determine which LUN to read from, the user should first -determine which LUN the disk with a bad block belongs to. Then he should -map the bad disk block back to the logical block address for the array in -order to determine which LBA to pass in to the -.Ic bbrread -command. -.Pp -This command is primarily intended for testing. In practice, bad block -remapping will generally be triggered by the in-kernel Disk Aerobics and -Disk Scrubbing code. -.Bl -tag -width 10n -.It Fl l Ar lba -Specify the starting Logical Block Address. -.It Fl d Ar datalen -Specify the amount of data in bytes to read from the LUN. This must be a -multiple of the LUN blocksize. -.El .It Ic readcap Send the .Tn SCSI @@ -545,22 +509,6 @@ START STOP UNIT command with the start bit set and the on/offline bit set to all direct access LUNs. This will mark all direct access LUNs "online" again. It will not cause any LUNs to start up. A separate start command without the on/offline bit set is necessary for that. -.It Ic hardstop -Use the kernel facility for stopping all direct access LUNs and setting the -offline bit. Unlike the -.Ic shutdown -command above, this command allows shutting down LUNs with I/O active. It -will also issue a LUN reset to any reserved LUNs to break the reservation -so that the LUN can be stopped. -.Ic shutdown -command instead. -.It Ic hardstart -This command is functionally identical to the -.Ic startup -command described above. The primary difference is that the LUNs are -enumerated and commands sent by the in-kernel Front End Target Driver -instead of by -.Nm . .It Ic lunlist List all LUNs registered with CTL. Because this command uses the ioctl port, it will only work when the FETDs @@ -623,7 +571,7 @@ sending SYNCHRONIZE cache commands. An interval of 0 means that the cache will be flushed for this LUN every time a SYNCHRONIZE CACHE command is received. .Pp -You must specify the target and LUN you want to modify. +You must specify the LUN you want to modify. .It Ic getsync Get the interval at which we actually service the SYNCHRONIZE CACHE command, as set by the @@ -633,7 +581,7 @@ The reported number means that we will actually flush the cache on every Nth SYNCHRONIZE CACHE command. A value of 0 means that we will flush the cache every time. .Pp -You must specify the target and LUN you want to query. +You must specify the LUN you want to query. .It Ic inject Inject the specified type of error for the LUN specified, when a command that matches the given pattern is seen. @@ -913,6 +861,12 @@ and .Dq block . .It Fl l Ar lun_id Specify the LUN number to remove. +.It Fl o Ar name=value +Specify a backend-specific name/value pair. +Multiple +.Fl o +arguments may be specified. +Refer to the backend documentation for arguments that may be used. .It Fl s Ar size_bytes Specify the size of the LUN in bytes. For the @@ -1011,6 +965,9 @@ Specifies LUN NAA identifier. Either EUI or NAA identifier should be set to UNIQUE value to allow EXTENDED COPY command access the LUN. Non-unique LUN identifiers may lead to data corruption. +.It Va ha_role +Setting to "primary" or "secondary" overrides default role of the node +in HA cluster, set by kern.cam.ctl.ha_role sysctl. .It Va insecure_tpc Setting to "on" allows EXTENDED COPY command sent to this LUN access other LUNs on this host, not accessible otherwise. @@ -1042,7 +999,6 @@ Specify physical block size and offset of the device. .It Va ublockoffset Specify UNMAP block size and offset of the device. .It Va rpm -.It Va rpm Specifies medium rotation rate of the device: 0 -- not reported, 1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. .It Va formfactor @@ -1071,34 +1027,34 @@ Specifies file or device name to use for backing store. Specifies number of backend threads to use for this LUN. .El .Sh EXAMPLES -.Dl ctladm tur 0:1 +.Dl ctladm tur 1 .Pp Send a .Tn SCSI TEST UNIT READY command to LUN 1. .Pp -.Dl ctladm modesense 0:1 -l +.Dl ctladm modesense 1 -l .Pp Display the list of mode pages supported by LUN 1. .Pp -.Dl ctladm modesense 0:0 -m 10 -P 3 -d -c 10 +.Dl ctladm modesense 0 -m 10 -P 3 -d -c 10 .Pp Display the saved version of the Control mode page (page 10) on LUN 0. Disable fetching block descriptors, and use a 10 byte MODE SENSE command instead of the default 6 byte command. .Bd -literal -ctladm read 0:2 -l 0 -d 1 -b 512 -f - > foo +ctladm read 2 -l 0 -d 1 -b 512 -f - > foo .Ed .Pp Read the first 512 byte block from LUN 2 and dump it to the file .Pa foo . .Bd -literal -ctladm write 0:3 -l 0xff432140 -d 20 -b 512 -f /tmp/bar +ctladm write 3 -l 0xff432140 -d 20 -b 512 -f /tmp/bar .Ed .Pp Read 10240 bytes from the file .Pa /tmp/bar -and write it to target 0, LUN 3. +and write it to LUN 3. starting at LBA 0xff432140. .Pp .Dl ctladm create -b ramdisk -s 10485760000000000 @@ -1142,12 +1098,12 @@ List all LUNs in the system, along with their inquiry data and device type. This only works when the FETDs are enabled, since the commands go through the ioctl port. .Pp -.Dl ctladm inject 0:6 -i mediumerr -p read -r 0,512 -c +.Dl ctladm inject 6 -i mediumerr -p read -r 0,512 -c .Pp Inject a medium error on LUN 6 for every read that covers the first 512 blocks of the LUN. .Bd -literal -offset indent -ctladm inject 0:6 -i custom -p tur -s 18 "f0 0 02 s12 04 02" +ctladm inject 6 -i custom -p tur -s 18 "f0 0 02 s12 04 02" .Ed .Pp Inject a custom error on LUN 6 for the next TEST UNIT READY command only. |