scsi

Linux: writes are split into 512K chunks

為{幸葍}努か 提交于 2021-02-04 05:50:27
问题 I have a user-space application that generates big SCSI writes (details below). However, when I'm looking at the SCSI commands that reach the SCSI target (i.e. the storage, connected by the FC) something is splitting these writes into 512K chunks. The application basically does 1M-sized direct writes directly into the device: fd = open("/dev/sdab", ..|O_DIRECT); write(fd, ..., 1024 * 1024); This code causes two SCSI WRITEs to be sent, 512K each. However, if I issue a direct SCSI command,

Linux: writes are split into 512K chunks

与世无争的帅哥 提交于 2021-02-04 05:50:20
问题 I have a user-space application that generates big SCSI writes (details below). However, when I'm looking at the SCSI commands that reach the SCSI target (i.e. the storage, connected by the FC) something is splitting these writes into 512K chunks. The application basically does 1M-sized direct writes directly into the device: fd = open("/dev/sdab", ..|O_DIRECT); write(fd, ..., 1024 * 1024); This code causes two SCSI WRITEs to be sent, 512K each. However, if I issue a direct SCSI command,

issuing hard drive commands with java

醉酒当歌 提交于 2019-12-31 04:06:11
问题 Does anyone know of a way to issue commands to a hard drive within Java? Does Java even support this kind of hardware interaction? For example, if I have a SCSI hard drive that I would like to inquiry, is there a pre-existing Java method to do this, or would I have to write my own? http://en.wikipedia.org/wiki/SCSI has some general information on SCSI commands in case you aren't familiar. 回答1: Java doesn't support talking directly to hardware like that. However, you can use JNI to call a C/C+

Get vendor name of SCSI

人盡茶涼 提交于 2019-12-24 22:31:53
问题 How can I get the vendor name of SCSI device on linux & c? 回答1: You can use libudev to find SCSI devices and read the vendor attribute (untested): struct udev *context = udev_new(); struct udev_enumerate *enumerator = udev_enumerate_new(context); udev_enumerate_add_match_subsystem(enumerator, "scsi"); udev_enumerate_scan_devices(enumerator); struct udev_list_entry *scsi_devices = udev_enumerate_get_list_entry(enumerator); struct udev_list_entry *current = 0; udev_list_entry_foreach(current,

How can I simulate a failed disk during testing?

℡╲_俬逩灬. 提交于 2019-12-17 17:42:24
问题 In a Linux VM (Vmware workstation or similar), how can I simulate a failure on a previously working disc? I have a situation happening in production where a disc fails (probably a controller, cable or firmware problem). Obviously this is not predictable or reproducible, I want to test my monitoring to ensure that it alerts correctly. I'd ideally like to be able to simulate a situation where it fails writes but succeeds reads, as well as a complete failure, i.e. the scsi interface reports

iSCSI data transport packet overhead

被刻印的时光 ゝ 提交于 2019-12-13 03:37:46
问题 This question is admittedly overlapping with iSCSI Packet Header but I hope for a more specific answer than provided for that one for my more specific question. Question: How much overhead is introduced by iSCSI and SCSI in the transfer of the data to read or write? I understand that this is done in the Data-In and Data-Out transport packets and I understand there is overhead from TCP/IP and Ethernet, but what additional overhead is needed by iSCSI/SCSI? I recognize that SCSI Protocol Data

SCSI Read (10) and Write (10) with the SCSI Generic Interface

↘锁芯ラ 提交于 2019-12-12 08:48:40
问题 I try to issue a scsi read(10) and write(10) to a SSD. I use this example code as a reference/basic code. This is my scsi read: #define READ_REPLY_LEN 32 #define READ_CMDLEN 10 void scsi_read() { unsigned char Readbuffer[ SCSI_OFF + READ_REPLY_LEN ]; unsigned char cmdblk [ READ_CMDLEN ] = { 0x28, /* command */ 0, /* lun/reserved */ 0, /* lba */ 0, /* lba */ 0, /* lba */ 0, /* lba */ 0, /* reserved */ 0, /* transfer length */ READ_REPLY_LEN, /* transfer length */ 0 };/* reserved/flag/link */

How to read bytes from a device using c/c++ in windows

拜拜、爱过 提交于 2019-12-10 11:58:56
问题 So here's the background: I've got this SCSI device with media that has raw data on it (for simplicity let's say it contains abc123). This device is on a Windows machine. I'd like to use C/C++ to initalize the device, open it, send the SCSI read command to the device, and ultimately "read" the bytes. I've searched for similar topics, but I keep getting Linux/Unix guides, or Visual C++ (which I do not have access to). Does anyone know a good way to start this? Maybe some sample code or maybe

SCSI Read (10) and Write (10) with the SCSI Generic Interface

放肆的年华 提交于 2019-12-04 06:05:23
I try to issue a scsi read(10) and write(10) to a SSD. I use this example code as a reference/basic code. This is my scsi read: #define READ_REPLY_LEN 32 #define READ_CMDLEN 10 void scsi_read() { unsigned char Readbuffer[ SCSI_OFF + READ_REPLY_LEN ]; unsigned char cmdblk [ READ_CMDLEN ] = { 0x28, /* command */ 0, /* lun/reserved */ 0, /* lba */ 0, /* lba */ 0, /* lba */ 0, /* lba */ 0, /* reserved */ 0, /* transfer length */ READ_REPLY_LEN, /* transfer length */ 0 };/* reserved/flag/link */ memset(Readbuffer,0,sizeof(Readbuffer)); memcpy( cmd + SCSI_OFF, cmdblk, sizeof(cmdblk) ); /* * +-------

iSCSI Packet Header

戏子无情 提交于 2019-12-01 08:03:02
问题 Does iSCSI introduce any layers (other than the TCP-headers themselves) on top of the SCSI packet? Are there any reference manuals for iSCSI other than the RFC itself? I need this information for controlling a RF-receiver over a Paralan iSCSI-to-SCSI-converter. 回答1: Yes there are a number of functions that iSCSI must implement (to name the least, authentication and authorization) on top of standard SCSI functions. The iSCSI PDU format is outlined in Chapter 10 of RFC 3720 - iSCSI In terms