Questions tagged [scsi]

Small Computer System Interface (SCSI, pronounced skuz-ee) is a set of parallel interface standards developed by the American National Standards Institute (ANSI) for physically connecting and transferring data between computers and peripheral devices(like printers, disk drives, scanners and other). It is a fast bus and supported by all major operating systems.

Small Computer System Interface (SCSI, pronounced skuz-ee) is a set of standards for physically connecting and transferring data between computers and peripheral devices. The official name of the SCSI standard is: ANSI X3.131.

The SCSI standards define commands, protocols, and electrical and optical interfaces. SCSI uses a low-voltage differential (LVD) bus, a method where data is transmitted by comparing the difference in voltage between a pair of wires. SCSI is most commonly used for hard disks and tape drives, but it can connect a wide range of other devices, including scanners and CD drives.

Some important features:

  • SCSI is capable of supporting eight devices, or sixteen devices with Wide SCSI.
  • The latest version, 16-bit Ultra-640 (Fast-320) SCSI has a 640 MBps transfer speed.
  • SCSI standards are generally backward-compatible.

Common SCSI components:

  • Initiator - it issues requests for service by the SCSI device and receives responses.
  • Target - A SCSI target is typically a physical storage device like a hard-disk or a storage array
  • Service delivery subsystem - it allows communication to occur between the initiator and the target

The SCSI subsystem has a 3 level architecture with the "upper" level being closest to the user/kernel interface while the "lower" level is closest to the hardware.

For more info: http://en.wikipedia.org/wiki/SCSI

181 questions
1
vote
1 answer

Windows repeatedly sends SCSI READ CAPACITY requests

I'm developing a USB-based mass storage device. Control is via SCSI commands. One of the LUNs of this device is "hidden", all commands (except INQUIRY and REQUEST SENSE) return COMMAND FAILED (1). REQUEST SENSE returns NOT READY (MEDIUM NOT…
1
vote
1 answer

How to access physical address from a DriverKit driver?

Now I am trying to write an IOUserSCSIParallelInterfaceController driver which uses neither DMA nor PCI and emulates a SCSI target. I realized that fBufferIOVMAddr (…
yuuzi41
  • 11
  • 2
1
vote
1 answer

how to know sg_sanitize is supported?

i have installed sg-utills in ubuntu in vmware workstation: sudo apt instll sg-utills and i want to use sg_sanitize. as you can see in https://rackhd.readthedocs.io/en/latest/server_workflow/secure_erase.html , about sg_sanitize: "not all SCSI…
capstonene
  • 179
  • 11
1
vote
1 answer

Android SCSI USB communication issues

This is not a question about code as much as correct SCSI procedures. I'm using an open source Android USB library which works fine, but I'm trying to solve some issues with a device I'm having. When a device is connected the library goes through…
DaedalusAlpha
  • 1,610
  • 4
  • 20
  • 33
1
vote
1 answer

SCSI application client log page - how to write to it?

As I learned from SCSI Commands Reference Manual, many scsi devices have a reserved place for custom logs. This is page 0xF - Application Client log page. So I'm looking for a way to write some data to that area. At fist I tried to use sg_logs…
gtristan
  • 355
  • 2
  • 10
1
vote
0 answers

How can I put a SCSI request in the queue in Linux Kernel?

I try to create a Linux kernel module that filters SCSI requests. The idea is very simple: I enumerate all Scsi_hosts by calling the function scsi_host_lookup() and modify the corresponding pointers host->hostt->queuecommand. This hooking…
StaTik
  • 13
  • 4
1
vote
0 answers

How to use arbitrary "sg_raw " argument in golang?

I am trying to replicate sg_inq through sg_raw This is the command used: inq_cmd := exec.Command("sg_raw", "-r", "512", "/dev/sg0", "12 00 00 00 60 00") stdoutStderr, err := read_cmd.CombinedOutput() if err != nil { …
1
vote
0 answers

Multi-Queue (MQ) in SCSI and iSCSI

I have a question regarding multi-queue (MQ) in SCSI layer and consequently iSCSI. Apparently there is good technical and scientific literature explaining multi-queue (MQ) on block layer level. But there is rarely any good explanation that how this…
BZKN
  • 1,499
  • 2
  • 10
  • 25
1
vote
1 answer

how to fix 'invalid argument' for ioctl requests to block device

I'm writing a small c program to make tape status and seek requests via ioctl(int fd, long int request, &io_buf) but after trial and plenty of error, ioctl is returning -1 with the errno message "Invalid Argument" I'm on Linux and…
David Tahvildaran
  • 307
  • 1
  • 3
  • 10
1
vote
1 answer

What are implications of executing SCSI WRITE BUFFER with mode 0x0F when deferred microcode is not present on device

I am referring to SCSI SPC-5 (Scsi Primary Commands) Specification. While going through SCSI write buffer command (opcode=0x3B), I found various values for MODE field (0x04, 0x05, 0x0E, 0x0E .. and so on). To be specific, Spec mentions that Mode…
Pravar Jawalekar
  • 605
  • 1
  • 6
  • 18
1
vote
1 answer

Linux scsi ata cmd write or read sometimes work and sometimes didn't work when transfer length is over 1345

My code is as follows: unsigned char cmd[16]; cmd[0] = WRITE_16; //lba is start address cmd[2] = (lba >> 54) & 0xFF; cmd[3] = (lba >> 48) & 0xFF; cmd[4] = (lba >> 40) & 0xFF; cmd[5] = (lba >> 32) & 0xFF; cmd[6] = (lba >> 24) & 0xFF; cmd[7] = (lba >>…
Easyhyum
  • 307
  • 1
  • 3
  • 5
1
vote
1 answer

Command line tool or library to interrogate iSCSI target

I'm trying to debug a problem with iPXE when it attempts to mount an iSCSI LUN from an LIO target. It's not getting the protocol quite right and that's leaving the LUN in a bad state. I need the flexibility to manually replay the steps, and to…
tlum
  • 913
  • 3
  • 13
  • 30
1
vote
1 answer

sg_write_same( sg3_utils ) and dd command

I am writing a file at particular lba with sg_write_same command. Then i am reading the particular block with the dd command. I am unable to retrieve the file. Here are the sequence of steps i follow. a> sg_write_same --32 --lba=2468 --in=sg_modes.c…
1
vote
0 answers

Max transfer size of SCSI Read(10) on a Physical Drive

Refer to here, IOCTL_STORAGE_QUERY_PROPERTY with StorageAdapterProperty can be used to get the max transfer size of per SCSI Read(10) command. In this code, 16 sectors are read from start of lba. I tried to modify the number and in my Win7…
林偉誠
  • 11
  • 3
1
vote
0 answers

How does in linux the scsi generic (sg) driver choose low-level driver(sd or sr) to use

How does in linux the scsi generic (sg) driver choose low-level driver(sd or sr) to use. I've found that the sg driver gets type of device from inquiry command. sdev->type = (inq_result[0] & 0x1f); After that "scsi_sysfs_add_sdev" function is…