s2p(1) General Commands Manual s2p(1)

s2p - Emulates SCSI and SASI devices with the Raspberry Pi

s2p [--block-size/-b BLOCK_SIZE] [--blue-scsi-mode/-B] [--caching-mode/-m CACHING_MODE] [--config-files PROPERTY_FILES] [--connect-type/-C CONNECT_TYPE] [--help/-h] [--enable-irqs/-e] [--excluded-types/-x TYPES] [--id/-i n[:u] IMAGE_FILE] [--ignore-conf/-I] [--image-folder/-F IMAGE_FOLDER] [--locale/-z LOCALE] [--log-level/-L LEVEL[:ID:[LUN]]] [--log-limit LIMIT] [--log-pattern/-l PATTERN] [--name/-n VENDOR:PRODUCT:REVISION] [--port/-p PORT] [--property/-c KEY=VALUE] [--reserved-ids/-r IDS] [--scan-depth/-R SCAN_DEPTH] [--script-file/-f SCRIPT_FILE] [--scsi-level SCSI_LEVEL] [--token-file/-P ACCESS_TOKEN_FILE] [--type/-t DEVICE_TYPE] [--version/-v] [--zulu-scsi-mode/-Z]

s2p emulates SCSI and SASI devices with the Raspberry Pi and a PiSCSI/RaSCSI board.

In the arguments to s2p one or more SCSI/SASI (-i n[:u]) devices can be specified. The number (n) after the device identifier specifies the ID number for that device. The optional number (u) specifies the LUN (logical unit) for that device. The default LUN is 0. The ID is limited to 0-7. However, typically SCSI ID 7 is reserved for the "initiator" (the host computer). The LUN is limited to 0-31. SASI only supports LUNs 0-1. SASI and SCSI devices can be used simultaneously.

If no explicit device type is provided, s2p determines the type based on the file extension of the FILE argument.
hd1: Hard Disk image (generic, non-removable, SCSI-1-CCS)
hds: Hard Disk image (generic, non-removable, SCSI-2)
hdr: Hard Disk image (generic, removable, SCSI-2)
hda: Hard Disk image (Apple compatible - typically used with Macintosh computers, but also compatible with any other host, SCSI-2)
hdf: SASI Hard Disk image (non-removable)
mos: Magneto-Optical image (MO/MOD, SCSI-2)
is1: CD-ROM or DVD-ROM image (ISO 9660, SCSI-1-CCS)
iso, cdr, toast: SCSI CD-ROM or DVD-ROM image (ISO 9660, SCSI-2)
tar: Tape image (tar-compatible image, SCSI-2)
tap: Tape image (SIMH-compatible image, SCSI-2)

For example, if you want to specify an Apple-compatible HD image on ID 0, you can use the following command:
s2p -i 0 /path/to/drive/hdimage.hda

When s2p starts, it opens a socket (default port is 6868) to allow external management commands. Examples of management tools are s2pctl or the SCSI Control app.

To quit s2p, press Control-C. If it is running in the background, you can kill it using an INT signal. When terminating, s2p automatically flushes all cached data.

The optional default block size. The default size for SASI hard drives is 256 bytes, for other devices it is 512 bytes. There is no upper limit. s2p supports non-standard block sizes as long as they are multiples of 4. Non-standard sizes are only required for exotic platforms.
Enable BlueSCSI filename parsing compatibility mode for the respective device. In this mode the name of an image file is parsed based on the BlueSCSI parsing rules. This mode is useful in order to share drive images between SCSI2Pi and BlueSCSI. If there are SCSI2Pi command line options for the respective device they will override the settings derived from the filename. If there is additional text before the filename extension s2p tries to parse this text as INQUIRY product data.
Caching mode (piscsi|write-through|linux|linux-optimized), default is PiSCSI compatible caching.
An optional comma-separated list of configuration files with s2p configuration properties. The default global property file is /etc/s2p.conf. This file is parsed first. Explicitly specified property files override the previously defined properties.
Using STANDARD as the connection type allows s2p to be run with a STANDARD board (without initiator support). In /etc/s2p.conf, to permanently enable this setting, add "connect_type=STANDARD". CONNECT_TYPE can be STANDARD or FULLSPEC, with FULLSPEC being the default.
Do not disable IRQs during transfers. For testing purposes only.
Do not report the device types in the comma-separated list in the SCSI2Pi API, in order to avoid problems with the old PiSCSI web UI. DEVICE_TYPES is usually SCSG, because PiSCSI does not support the SCSI-to-USB bridge.
Display this help.
ID is the SCSI/SASI ID (0-7). LUN (0-31 for SCSI, 0-1 for SASI) is the optional LUN (logical unit). The default LUN is 0.
FILE is the name of the image file or a block device (/dev/sd* or /dev/sr*) to use for the SCSI/SASI device. For devices that do not support an image file, the filename may have a special meaning or a dummy name can be provided. For SCDP it is an optional prioritized list of network interfaces, an optional IP address and netmask, e.g. "interface=eth0,eth1,wlan0:inet=10.10.20(1)/24". For SCLP it is the print command to be used and a reservation timeout in seconds, e.g. "cmd=lp -oraw %f:timeout=60". For SCTP append mode can be configured with "append=MAXIMUM_FILE_SIZE".
Ignore any properties in the /etc/s2p.conf configuration file.
The absolute path of the image folder. It must be located in /var/lib/piscsi/ or in /home/.
Overrides the default locale (language) for client-facing error messages. A client can override this setting.
The s2p log level (trace, debug, info, warning, error, critical, off). The default log level is 'info' for all devices unless a device ID and an optional LUN are provided when setting the level.
Limits the number of data bytes being logged, default is 128 bytes.
The spdlog pattern to use for logging. See https://github.com/gabime/spdlog for details.
Set the optional vendor, product and revision for the device, to be returned with the 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 maximum length is automatically applied. Once set, the name of a device cannot be changed.
The s2p client service port, default is 6868.
Set the s2p configuration property with the name KEY to the value VALUE. Properties set with this option override properties from property files.
An optional comma-separated list of IDs to reserve. Pass an empty list in order to not reserve any ID.
Scan for image files recursively, up to a depth of SCAN_DEPTH. Depth 0 means to ignore any folders within the image folder. Be careful when using this option with many sub-folders in the default image folder. The default depth is 1.
Create a script file with a SCSI command sequence. This file contains all SCSI command blocks and their DATA OUT data and can be executed by s2pexec.
The optional SCSI/SPC standard level. The default level is device-specific and usually is SCSI-2. Be careful when 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 extensions and "--scsi-level 1" can be used. This option can also be used to "downgrade" a device. USB sticks used with the SCSG device type (SCSI-to-USB bridge) often report newer levels than SCSI-2. Some drivers might require older SCSI levels.
Enable authentication and read the access token from the specified file. The access token file must be owned by root and must be readable by root only.
The optional case-insensitive device type (SAHD, SCCD, SCDP, SCHD, SCHS, SCLP, SCMO, SCRM, SCSG, SCTP). If no type is specified for devices that support an image file or a block device, s2p tries to derive the type from the filename and the file extension.
Displays the s2p version.
The same as the BlueSCSI compatibility mode, because both modes are compatible.

Launch s2p with no devices attached:
s2p

Launch s2p with an Apple hard drive image as ID 0 and a CD-ROM as ID 2
s2p -i 0 /path/to/harddrive.hda -i 2 /path/to/cdimage.iso

Launch s2p with a removable SCSI drive image as ID 0 and the raw device file /dev/hdb (e.g. a USB stick) and a DaynaPort network adapter as ID 6:
s2p -i 0 -t scrm /dev/hdb -i 6 daynaport

Launch s2p with a SASI hard drive image as ID 1
s2p -i 1 -t sahd /path/to/harddrive.hds

To create an empty 100 MiB drive image, use the following command:
dd if=/dev/zero of=/path/to/new_image.hds bs=512 count=204800

In case the fallocate command is available, a much faster alternative to the dd command is:
fallocate -l 104857600 /path/to/newimage.hda

s2pctl(1), s2pdump(1), s2pexec(1), s2pformat(1), s2pproto(1), s2psimh(1), s2ptool(1)

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