s2pctl − SCSI2Pi Server Controller Tool


scsictl [−-id/i ID[:LUN]] | [−-list-extensions] | [−-list-images/-e] | [−-list-operations/-o] | [−-help/-h] | [−-version/-v] | [−-server-version/-V] | [−-detach-all-D] | [−-list-interfaces/-N] | [−-list-reserved-ids/-I] | [−-list-devices/-l] | [−-list-log-levels] | [−-list-properties/-P] | [−-list-statistics/-S] | [−-list-device-types/-T] | [−-shut-down/-X] | [−-prompt] | [−-text-protobuf] | [−-binary-protobuf FILENAME] | [−-json-protobuf FILENAME] | [−-delete/-d FILENAME] | [−-create/-C FILENAME:FILESIZE] | [−-list-image-info/-E FILENAME] | [−-image-folder/-F IMAGE_FOLDER] | [−-rename/-R CURRENT_NAME:NEW_NAME] | [−-cmd/-c COMMAND] | [−-block-size/-b BLOCK_SIZE] | [−-caching-mode/-m CACHING_MODE] | [−-file/f FILE|PARAM] | [−-log-level/-L LOG_LEVEL] | [−-host/-H HOST] | [−-name/-n NAME VENDOR:NAME_REVISION] | [−-port/-p PORT] | [−-reserved-ids/-r RESERVED_IDS] | [−-list-settings/-s [FOLDER_PATTERN:FILE_PATTERN:OPERATIONS]] | [−-type/-t TYPE] | [−-copy/-x CURRENT_NAME:NEW_NAME] | [−-locale LOCALE]


s2pctl sends commands to s2p in order to apply configuration changes at runtime or to check a device status.

You do not need root privileges to use s2pctl. s2pctl also runs on non-Pi Linux platforms. In this case use the -H option to select the s2p host s2pctl shall connect to.

When launched without arguments s2pctl enters interactive mode, where you can enter commands on the command line. In interactive mode the host and port settings are preserved between command invocations.


--id/-i ID[:LUN]

The SCSI or SASI ID and optional LUN that you want to control. (0-7:0-31 for SCSI, 0-7:0-1 for SASI.)


Create an image file in the default image folder with the specified name and size in bytes.


Detach all devices.

--list-image-info/-E FILENAME

Display image file information.

--image-folder/-F IMAGE_FOLDER

Set the default image folder.


Display reserved device IDs.

--log-level/-L LOG_LEVEL[:ID[:LUN]]

Set the s2p log level (trace, debug, info, warning, error, critical, off).

--host/-H HOST

The s2p host to connect to, default is ’localhost’.


Lists all network interfaces that are up and available for setting up a DaynaPort emulation.


Display the available s2p log levels and the current log level.


Prompt for the access token in case s2p requires authentication.


List all of the devices that are currently being emulated, as well as their current status.


List all supported file extensions and the device types they map to.


List all images files in the default image folder.


List available remote interface operations.


Rename an image file in the default image folder.

--port/-p PORT

The s2p port to connect to, default is 6868.

--list-properties/-P PORT

Display the current s2p properties. The resulting output can directly be used for property files, e.g. for /etc/s2p.conf when running s2p as a system service.

--reserved-ids/-r RESERVED_IDS

Comma-separated list of IDs to reserve. Pass an empty list in order to not reserve anything.


Display all s2p settings. Filenames are optionally filtered by folder and file patterns. OPERATIONS is an optional comma-seperated list of server operations to take into account, in order to limit the amount of output.


Display s2p statistics.


Display available device types and their properties.


Display usage information.


Display the s2pctl version.


Display the s2p server version.


Shut down the s2p process.

--delete/-d FILENAME

Delete an image file in the default image folder.


Copy an image file in the default image folder.

--binary-protobuf FILENAME

Do not send the command to s2p but write it to a protobuf binary file.

--json-protobuf FILENAME

Do not send the command to s2p but write it to a protobuf JSON file.

--text-protobuf FILENAME

Do not send the command to s2p but write it to a protobuf text format file.

--locale LOCALE

Overrides the default locale (language) for client-facing error messages.

--command/-c COMMAND

Command is the operation being requested. Options are:
a(ttach): Attach device
d(etach): Detach device
i(nsert): Insert medium (removable media devices only, i.e. SCRM, SCMO, SCCD)
e(ject): Eject medium (removable media devices only, i.e. SCRM, SCMO, SCCD)
p(rotect): Write protect the medium (not for CD-ROMs, which are always read-only)
u(nprotect): Remove write protection from the medium (not for CD-ROMs, which are always read-only)

eject, protect and unprotect are idempotent.

--block-size/-b BLOCK_SIZE

The optional block size, usually 256 (SASI only), 512, 1024, 2048 or 4096 bytes. The default size for SASI hard drives is 256 bytes, for SCSI hard drives it is 512 bytes. s2p supports non-standard SCSI hard drive sector sizes as long as they are multiples of 4, but these sizes are only required for exotic platforms.

--caching-mode/-m CACHING_MODE

Caching mode (piscsi|write-through|linux|linux-optimized), default currently is PiSCSI compatible caching.

--file/-f FILE|PARAMS

Device-specific: Either a path to a disk image file, or parameters for a non-disk device. See the s2p(1) man page for permitted file types.

--type/-t TYPE

Specifies the device type. This type overrides the type derived from the file extension of the specified image. See the s2p(1) man page for the available device types. For some types there are shortcuts (only the first letter is required):
sahd: SASI hard drive
schd: SCSI hard drive
scrm: SCSI removable media drive
sccd: CD-ROM drive
scmo: Magneto-optical disk
scdp: DaynaPort network adapter
sclp: SCSI printer
schs: Host services device


The optional vendor, product and revision for the device, to be returned with the SCSI INQUIRY data. A complete set of name components must be provided. VENDOR may have up to 8, PRODUCT up to 16, REVISION up to 4 characters. Padding with blanks to the maxium length is automatically applied. Once set the name of a device cannot be changed.

--scsi-level SCSI_LEVEL

The optional SCSI standard level. The default level is device-specific and usually is SCSI-2. Be careful with using this option, you will usually not need it. Explicitly setting the level may be required for drives with removable media if they are attached without providing an image file. In this case the SCSI-1-CCS level cannot be derived from the ".is1" or ".hd1" filename extension and "--scsi-level 1" can be used.


Logical unit number (0-31 for SCSI, 0-1 for SASI). The LUN defaults to 0. This option is used when there are multiple SCSI/SASI devices for the same SCSI ID.


Show the completer remote service information.
s2pctl -s

Request s2p to attach a disk (assumed) to SCSI ID 0 with the contents of the file system image "hdimage0.hds".
s2pctl -i 0 -f hdimage0.hds


s2p(1), s2pdump(1), s2pexec(1), s2pproto(1)

Also see <https://www.scsi2pi.net> and <https://github.com/uweseimet/scsi2pi>.