SCSI-to-USB Bridge

With the SCSG device type, you can use USB drives like SCSI drives. This device maps SCSI devices to the generic SCSI driver of Linux (SG 3). Therefore, SCSG can represent any drive supported by this driver, particularly USB mass storage devices. SCSI commands are not emulated, but they are directly sent to the connected device.

Attaching SCSG devices

The SCSG type expects a device file /dev/sg* as a parameter. Linux automatically creates these device files when a device supported by the Linux SG driver is connected, e.g. a USB stick, a USB hard drive or a USB DVD drive. Even USB floppy disk drives and SATA drives connected to a USB-to-SATA adapter have successfully been tested.
lsscsi lists all devices available for a bridge and the respective device files:

>lsscsi --generic
[0:0:0:0]    disk    Y-E DATA USB-FDU          4.01  /dev/sdc   /dev/sg3
[1:0:0:0]    disk    Generic  MassStorageClass 2011  /dev/sda   /dev/sg0
[1:0:0:1]    disk    Generic  MassStorageClass 2011  /dev/sdb   /dev/sg1
[2:0:0:0]    cd/dvd  TSSTcorp CDDVDW SN-208AB  LA02  /dev/sr0   /dev/sg2

With this information, you can create bridges for USB devices, which for the computer appear to be SCSI devices:

>s2p -i 0 /dev/sg0 -i 4 /dev/sg3 -i 4:1 /dev/sg2
>s2pctl -l
+--------+------+-------------------------------------------
| ID:LUN | Type | Image File/Device File/Description
+--------+------+-------------------------------------------
|  0:0   | SCSG | /dev/sg0 (Generic  MassStorageClass 2011)
|  4:0   | SCSG | /dev/sg3 (Y-E DATA USB-FDU          4.01)
|  4:1   | SCSG | /dev/sg2 (TSSTcorp CDDVDW SN-208AB  LA02)
+--------+------+-------------------------------------------

There are no image files with the SCSG device type. s2p forwards all SCSI commands directly to a connected device. SCSG therefore does not emulate a particular device, but represents a real device connected to the Pi.

SCSI-to-USB bridge with IDE and SATA drives

With a USB adapter, you can also use IDE and SATA drives. How well this works depends on the adapter and the respective device. With a Linux PC, the SCSI2Pi SCSI-to-USB bridge and a SATA DVD writer it was even possible to burn DVDs. But there are also drives that do not work that well.

Adjusting the SCSI level

Some USB devices support much newer SCSI versions than SCSI-2:

>s2pdump -g /dev/sg7 -I
Checking device corresponding to Linux SG driver device file '/dev/sg7'

INQUIRY product data:
Vendor:               'Generic '
Product:              'MassStorageClass'
Revision:             '2011'
Device Type:          Direct Access
SCSI Level:           SPC-4
Response Data Format: SCSI-2
Removable:            Yes
...

With drivers that do not support new standards, the s2p option --scsi-level may help, which permits a "downgrade" of the SCSI version. The device name can be changed with --name.
HDDRIVER is a driver package for Atari computers that also supports up-to-date SCSI levels. HDDRIVER and the related tools even make use of new SCSI commands for optimizations.