{"id":26860403,"url":"https://github.com/jackeichen/pydiskcmd","last_synced_at":"2026-05-20T05:18:26.011Z","repository":{"id":156966472,"uuid":"539279675","full_name":"jackeichen/pydiskcmd","owner":"jackeichen","description":"A pure python tool to send raw commands to sata/sas/nvme disk","archived":false,"fork":false,"pushed_at":"2025-04-29T10:43:13.000Z","size":857,"stargazers_count":17,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-06T18:06:54.382Z","etag":null,"topics":["cross-platform","disk-command","nvme","python3","sata","scsi","vroc"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackeichen.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-21T02:57:11.000Z","updated_at":"2025-04-29T10:43:17.000Z","dependencies_parsed_at":"2024-05-11T07:34:20.882Z","dependency_job_id":"0e2eddce-b504-4fca-82be-92f732f03ad6","html_url":"https://github.com/jackeichen/pydiskcmd","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackeichen%2Fpydiskcmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackeichen%2Fpydiskcmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackeichen%2Fpydiskcmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackeichen%2Fpydiskcmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackeichen","download_url":"https://codeload.github.com/jackeichen/pydiskcmd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252741371,"owners_count":21797027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-platform","disk-command","nvme","python3","sata","scsi","vroc"],"created_at":"2025-03-31T01:33:49.655Z","updated_at":"2026-05-20T05:18:26.002Z","avatar_url":"https://github.com/jackeichen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: 2022 The pydiskcmd Authors\n\nSPDX-License-Identifier: LGPL-2.1-or-later\n--\u003e\n\nImportant\n=========\npydiskcmd remove pydiskhealthd in version 0.3.0, it may become a separate project \nin the future. For the reason: Need more effort to maintain a mixed-function project, \nand pydiskhealthd need more dependencies.\n\nIf you still want to use it, keep your tool version less than 0.3.0.\n\nBe careful to update from 0.3.6 to 0.3.7, low level component changed!\nOnly debug request is allowed for 0.3.7. The work will focus on 0.4.0.\n\n\npydiskcmd\n=========\n\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/jackeichen/pydiskcmd)\n\npydiskcmd is a disk command tool for python3. It can send command to SATA/SAS/NVMe \ndisk, as also as monitor the disk health.\n\nIn Linux, there is some tools to handle disk, like hdparm,smartctl,nvme-cli \nand etc. But I still hope to develop a tool to cover all the sata,sas,nvme disks.\nIt should be easily installed and should be able to send raw commands to target \ndisks, provide a high-level API to build raw command with different protocal. \nBesides, it could monitor the health of the disks, especially take full advantage \nof NVMe(which offer a better monitoring mechanism). \n\nWhile in Windows, rarely find out an open source user level disk tool. I hope it \nis convenient to handle a disk in windows as if it is in Linux.\n\nThis project is more of a code collection, it was born and grow in the open source \nprojects from github.\n\nWhy pydiskcmd\n-------------\nThe pydiskcmd is easily installed. In most case, all you need is the python environment. \nBenefit from python (a cross-platform and high-level programming language) and OS level \nioctl support, installing pydiskcmd Does Not need to configure the compiling environment\n(like C/C++ code). The long-term work in the development is to reduce the sofware dependency, \nto make installation as simple as possible.\n\nThe pydiskcmdlib provides a flexible and friendly middle-level API, as well as some low-level \ncomponents to use. With the help of it, user could build their own raw command, send it to \ndevice and get the result. To archive this goal, more detailed documentation may be considered \nin the future. Whether you hope to test your storage device in protocal test or want to develop \na disk utility tool, pydiskcmdlib will be a good choice.\n\npydiskcmdcli(pynvme/pysata/pyscsi included) is different with hdparm,sdparm and etc. The above \ntools is more like a command utility for a certain purpose, the pydiskcmdcli provides raw-command \nfrom spec without union. For example, the user cannot directly set the write-caching by the client \ntool, the equivalent command will be set-feature or mode-select.\n\nDisadvantages\n-------------\nCompared to the compiled language, python code may take up more time and memory to run, and need \nmore size in packaged program(i.e. program packaged by pyinstaller). Most of the time is consumed \nby loading the code in first use.\n\n| Test item             | Used Time(milliseconds) | Description                   |\n|-----------------------|-------------------------| ----------------------------- |\n| Load pydiskcmdlib     | 35.99839                | Only load module pydiskcmdlib |\n| Load pydiskcmdcli     | 36.59582                | Only load module pydiskcmdcli |\n| NVMe.id_ctrl()        | 0.138521                | run NVMe.id_ctrl() after pydiskcmdlib loaded |\n| pynvme id-ctrl        | 69                      | run pynvme id-ctl \u003cdevice\u003e, include print data |\n\nThe test uses CentOS Stream 9 with python 3.9, and get the average value in 5 times.\n\n\nLicense\n=======\npydiskcmd is distributed under LGPLv2.1.\nPlease see the LICENSE file for the full license text.\n\n\nGetting the sources\n===================\nThe module(source) is hosted at https://github.com/jackeichen/pydiskcmd\n\nYou can use git to checkout the latest version of the source code using:\n\n    $ git clone git@github.com:jackeichen/pydiskcmd.git\n\nIt is also available as a downloadable zip archive from:\n\n    https://github.com/jackeichen/pydiskcmd/archive/master.zip\n\n\nSupport List\n============\n\nOS Support\n---------\n\n| OS                    | arc | SCSI | ATA | NVME |\n|-----------------------|-----|------|-----|------|\n| CentOS/RHEL 7.6       | x64 | Y    | Y   | Y    |\n| CentOS/RHEL 8.4       | x64 | Y    | Y   | Y    |\n| RHEL 9.1              | x64 | Y    | Y   | Y    |\n| SUSE 15 SP5           | x64 | Y    | Y   | Y    |\n| Ubuntu 22.04          | x64 | Y    | Y   | Y    |\n| Debian 10             | x64 | Y    | Y   | Y    |\n| Fedora Workstation 40 | x64 | Y    | Y   | Y    |\n| Windows 10 Pro        | x64 | Y    | Y   | Y    |\n| Windows 11            | x64 | Y    | Y   | Y    |\n| Windows Server 2019   | x64 | Y    | Y   | Y    |\n| Windows Server 2022   | x64 | Y    | Y   | Y    |\n\nY: support, N: Non-support, D: Developing, T: Under Testing\n\nNote:\n\n    * Only some of the commands are tested, Do Not guarantee all the other commands work;\n    * This tool should work in Linux\u0026Windows, but may be incompatible in OS other than this Support List;\n    * Windows only support some of the get-feature/get-log/idenfity commands;\n    * Support Direct-Connection/HBA Mode/JBOD Mode, RAID Mode is not supported.\n\nRAID/HBA Support\n----------------\nOnly HBA Card and RAID JBOD mode under test. Limited support RAID Mode.\n\nThe configuration should matrixed support with smartie. See raid_support_matrix_with_smartie.txt for \ndetails.\n\n| RAID/HBA Adapter   | OS under test| SCSI Supported | ATA Supported |\n|--------------------|--------------|----------------|---------------|\n| Broadcom RAID 9440 | CentOS 8.4   | Yes            | Yes           |\n| Broadcom RAID 9560 | CentOS 8.4   | Yes            | Yes           |\n| Broadcom HBA  9500 | CentOS 8.4   | Yes            | Yes           |\n| ThinkSystem   930  | CentOS 8.4   | Yes            | Yes           |\n| ThinkSystem   940  | CentOS 8.4   | Yes            | Yes           |\n| ThinkSystem   4350 | CentOS 8.4   | Yes            | Yes           |\n| ThinkSystem   5350 | CentOS 8.4   | Yes            | Yes           |\n\nBroadcom RAID\n-------------\nThe bellow command is avaliable in ThinkSystem 940, as well as Broadcom RAID 9440 and 9560.\n\n  * SCSI inquiry\n  * SATA identify\u0026smart_read_data\n\nMore commands is on the way.\n\nNote:\n\n    * Only some log page and identify is tested, which command support denpends on the card driver;\n    * May need update driver if error occurs;\n\nFeature support\n---------------\n\n| Feature            | OS under test       | NVMe Supported | ATA Supported |\n|--------------------|---------------------|----------------|---------------|\n| [Intel VROC]       | Windows Server 2019 | T              | N             |\n| [Intel RST]        | Windows 10          | D              | T             |\n\nY: support, N: Non-support, D: Developing, T: Under Testing\n\n\nBuilding and installing\n=======================\n\nSofware Requirements:\n\n    * python3(Required)\n\nPython3 Module Requirements:\n\n    * cython-sgio(Only for Linux, Optional but Strongly Recommend, need latest version from [cython-sgio] if used)\n\nOnline build and install from the repository:\n\n    $ git clone git@github.com:jackeichen/pydiskcmd.git\n    $ pip install .\n\nAfter your installation, you can use command to enable or update Linux Bash \nCompletion for command pynvme\u0026pysata\u0026pyscsi(Only for Linux):\n\n    $ pynvme cli-autocmd\n\nYou can uninstall it by run:\n\n    $ pip uninstall pydiskcmd\n\nNo pip\n------\nIf you are in the environment that pip Not Installed, you can install by run:\n\n    $ cd pydiskcmd\n    $ python3 setup.py install\n\nAnd you could manually create smart drivedb in Linux by:\n\n    $ mkdir /etc/pydiskcmd\n    $ cp src/pydiskcmdcli/drivedb/smart_drivedb.json /etc/pydiskcmd/\n\n\nDocuments\n=========\n\nNo time to fix up the docs right now, you may ask DeepWiki to find something useful.\n\n\nUsage\n=====\nThree executable programs should be added to environment variables after installation.\n\npynvme\n------\nIt is a program similar to nvme-cli, with some limitted commands inside. Use bellow\ncommand to get help:\n\n    $ pynvme help\n\n```\npynvme-0.3.7\nusage: pynvme \u003ccommand\u003e [\u003cdevice\u003e] [\u003cargs\u003e]\n\nThe '\u003cdevice\u003e' may be either an NVMe character device (ex: /dev/nvme0) or an\nnvme block device (ex: /dev/nvme0n1) in Linux, while PhysicalDrive\u003cX\u003e in Windows.\n\nThe following are all implemented sub-commands:\n  list                  List all NVMe devices and namespaces on machine\n  list-subsys           List nvme subsystems\n  list-ns               Send NVMe Identify List, display structure\n  list-ctrl             Send NVMe Identify Controller List, display structure\n  id-ctrl               Send NVMe Identify Controller\n  id-ns                 Send NVMe Identify Namespace, display structure\n  id-uuid               Send NVMe Identify UUID List, display structure\n  create-ns             Creates a namespace with the provided parameters\n  delete-ns             Deletes a namespace from the controller\n  attach-ns             Attaches a namespace to requested controller(s)\n  detach-ns             Detaches a namespace from requested controller(s)\n  get-log               Generic NVMe get log, returns log in raw format\n  smart-log             Retrieve SMART Log, show it\n  error-log             Retrieve Error Log, show it\n  commands-se-log       Retrieve Commands Supported and Effects Log, and show it\n  mi-commands-se-log    Retrieve NVMe-MI Commands Supported and Effects Log, and show it\n  fw-log                Retrieve FW Log, show it\n  sanitize-log          Retrieve Sanitize Log, show it\n  self-test-log         Retrieve the SELF-TEST Log, show it\n  telemetry-log         Retrieve the Telemetry Log, show it\n  persistent-event-log  Get persistent event log from device\n  reset                 Resets the controller\n  subsystem-reset       Resets the subsystem\n  fw-download           Download new firmware\n  fw-commit             Verify and commit firmware to a specific slot\n  get-feature           Get feature and show the resulting value\n  set-feature           Set a feature and show the resulting value\n  format                Format namespace with new block format\n  sanitize              Submit a sanitize command\n  device-self-test      Perform the necessary tests to observe the performance\n  pcie                  Get device PCIe status, show it(Obseleted, see plugin pci)\n  show-regs             Shows the controller registers or properties. Requires character device\n  admin-passthru        Submit an arbitrary admin command, return results\n  io-passthru           Submit an arbitrary IO command, return results\n  flush                 Submit a flush command, return results\n  read                  Submit a read command, return results\n  verify                Submit a verify command, return results\n  write                 Submit a write command, return results\n  write-zeroes          Submit a write zeroes command, return results\n  write-uncor           Submit a write uncorrectable command, return results\n  compare               Submit a Compare command, return results\n  dsm                   Submit a Data Set Management command, return results\n  get-lba-status        Submit a Get LBA Status command, return results\n  version               Shows the program version\n  help                  Display this help\n\nSee 'pynvme help \u003ccommand\u003e' or 'pynvme \u003ccommand\u003e --help' for more information on a sub-command\n\nThe following are all installed plugin extensions:\n  ocp                   OCP cloud SSD extensions\n  vroc                  Windows NVMe VROC support\n  pci                   Linux PCIe SSD extensions\n  mi                    NVMe-MI extensions\n\nThe following are pynvme cli management interface:\n  cli-info              Shows pynvme information\n  cli-autocmd           Enable or Update the command completion\n\nSee 'pynvme \u003cplugin\u003e help' for more information on a plugin\n```\n\npysata\n------\nIt is a sata command tool, to send ATA command to SATA Disk, with some limitted \ncommands inside. Use bellow command to get help:\n\n    $ pysata help\n\n```\npysata-0.3.7\nusage: pysata \u003ccommand\u003e [\u003cdevice\u003e] [\u003cargs\u003e]\n\nThe '\u003cdevice\u003e' is usually a character device (ex: /dev/sdb or physicaldrive1).\n\nThe following are all implemented sub-commands:\n  list                        List all SATA devices on machine\n  check-PowerMode             Check Disk Power Mode\n  accessible-MaxAddress       Send Accessible Max Address command\n  identify                    Get identify information\n  self-test                   Start a disk self test\n  set-feature                 Send set feature to device\n  trusted-receive             Send trusted receive to device\n  smart                       Get smart information\n  smart-return-status         Get the reliability status of the device\n  read-log                    Get the GPL Log and show it\n  write-log                   Send write log command\n  smart-read-log              Get the smart Log and show it\n  sanitize                    Send sanitize command\n  standby                     Send standby command\n  read                        Send a read command to disk\n  read-sectors                Send a read sector(s) command to disk\n  read-verify-sector          Send read verify sector(s) command\n  write                       Send a write command to disk\n  write-uncorrectable         Send a write uncorrectable command to disk\n  flush                       Send a flush command to disk\n  trim                        Send a trim command to disk\n  download-fw                 Download firmware to target disk\n  version                     Shows the program version\n  help                        Display this help\n\nThe following are all installed plugin extensions:\n  megaraid                    MegaRAID Linux extensions\n  rst                         Intel RAID RST Windows extensions\n\nThe following are pysata cli management interface:\n  cli-info                    Shows pysata information\n  cli-autocmd                 Enable or Update the command completion\n\nSee 'pysata help \u003ccommand\u003e' or 'pysata \u003ccommand\u003e --help' for more information on a sub-command\n```\n\npyscsi\n------\nIt is a scsi command tool, to send scsi command to SAS Disk, with some limitted \ncommands inside. Use bellow command to get help:\n\n    $ pyscsi help\n\n```\npyscsi 0.3.7\nusage: pyscsi \u003csub-command\u003e [\u003cdevice\u003e] [\u003cargs\u003e]\n\nThe '\u003cdevice\u003e' is usually a character device (ex: /dev/sdb or physicaldrive1).\n\nThe following are all implemented sub-commands:\n  list                        List all SCSI devices on machine\n  inq                         Send scsi inquiry command\n  getlbastatus                Get LBA Status from target SCSI device\n  readcap                     Read capacity from target SCSI device\n  luns                        Send Report Luns commandc to target SCSI device\n  mode-sense                  Send Mode Sense command to target SCSI device\n  log-sense                   Send Log Sense command to target SCSI device\n  cdb-passthru                Submit an arbitrary SCSI command, return results\n  se-protocol-in              Submit SECURITY PROTOCOL IN command, return results\n  smart-simulate              Retrieve different logs, return simulate smart\n  sync                        Synchronize cache to non-volatile cache, as known as flush\n  read                        Send a read command to disk\n  write                       Send a write command to disk\n  version                     Shows the program version\n  help                        Display this help\n\nThe following are all installed plugin extensions:\n  parse-cmd                   Parse the CDB and sense code\n  lenovo                      Lenovo disk plugin(for Private Release)\n  csmi                        Common Storage Management Interface (CSMI) plugin\n  megaraid                    MegaRAID extensions\n\nThe following are pyscsi cli management interface:\n  cli-info                   Shows pyscsi information\n  cli-autocmd                Enable or Update the command completion\n\nSee 'pyscsi help \u003ccommand\u003e' or 'pyscsi \u003ccommand\u003e --help' for more information on a sub-command\n```\n\n\nAdvanced Usage\n==============\nYou can find some examples about how to use this tool in the dir of pydiskcmd/examples/.\n\nBuild Your Own Command \n----------------------\nExample to build and run your own NVMe command in Linux.\n\n```\n### nvme format command\n## \u003cNVMeCommand\u003e is the wrapper of raw command data structure, you can find it in pydiskcmdlib/pynvme/nvme_command,\n#  \u003cbuild_command\u003e is the methmod to build cdw data structure\n##\nfrom pydiskcmdlib.pynvme.nvme_command import NVMeCommand,build_int_by_bitmap\nfrom pydiskcmdlib.pynvme.linux_nvme_command import IOCTLRequest\n## for running your own command in device, and get the result.\nfrom pydiskcmdlib.utils import init_device\n\nCmdOPCode = 0x80 # nvme format command OP code, see nvme spec\n\nclass Format(NVMeCommand):\n    _req_id = IOCTLRequest.NVME_IOCTL_ADMIN_CMD.value  # define yourself request ID, admin or nvme command\n\n    def __init__(self, \n                 lbaf,            # the lbaf to format, see nvme spec\n                 mset=0,          # the mset to format, see nvme spec\n                 pi=0,            # the pi to format, see nvme spec\n                 pil=1,           # the pil to format, see nvme spec\n                 ses=0,           # the ses to format, see nvme spec\n                 nsid=0xFFFFFFFF, # the nsid to format, see nvme spec\n                 timeout=600000): # timeout(millisecond) in IOCTL request\n        ## build command cdw10\n        #  this is a key-value dict input:\n        #    key: the name of value\n        #    value: (the bit-map of value, Byte offset in DWord, value to set)\n        ##\n        cdw10 = build_int_by_bitmap({\"lbaf\": (0x0F, 0, lbaf), # the location of lbaf in cdw10, see nvme spec\n                                     \"mset\": (0x10, 0 ,mset), # the location of mset in cdw10, see nvme spec\n                                     \"pi\": (0xE0, 0, pi),     # the location of pi in cdw10, see nvme spec\n                                     \"pil\": (0x01, 1, pil),   # the location of pil in cdw10, see nvme spec\n                                     \"ses\": (0x0E, 1, ses)})  # the location of ses in cdw10, see nvme spec\n        ##\n        super(Format, self).__init__()\n        # build command\n        self.build_command(opcode=CmdOPCode,\n                           nsid=nsid,\n                           cdw10=cdw10,\n                           timeout_ms=timeout)\n\ncmd = Format(0, nsid=1) ## format namespace 1 to lbaf 0\nwith init_device('/dev/nvme1', open_t='nvme') as d: ## open a nvme device: /dev/nvme1\n    d.execute(cmd)\n## Get the command result-\u003e \nprint (cmd.cq_cmd_spec) # Command Specific Status Values, see nvme spec\nSC,SCT = cmd.check_return_status() # Get Command Status Code and Status Code Type\nprint (\"Command Status Code=%d, Status Code Type=%d\" % (SC,SCT))\n```\n\nExample to build and run your own SATA command in Linux Or Windows.\n\n```\n### Send an Identify command to SATA Disk\n## pydiskcmdlib send SATA command by scsi passthrough12 or passthrough16 command\n## This will import a suitable SCSIDevice depends on your OS,\n#  The SCSIDevice help to send the command to device and get the result from the device\nfrom pydiskcmdlib.utils import init_device\n## ATACommand16 is the wrapper of ATA command, it help to build your own command\n#  You can read ACS-3 about the ATA command set, and\n#  read SAT-5 to make out how to translate from ATA command to SCSI passthrough command\nfrom pydiskcmdlib.pysata.ata_command import ATACommand16\n\n\nclass Identify16(ATACommand16): \n    def __init__(self):\n        ##\n        # count is not used by idedntify in ATA command set,\n        # so use it in ATAPassthrouh16, for setting transfer length\n        ##\n        ATACommand16.__init__(self,\n                              0,         # fetures field\n                              1,         # count field\n                              0,         # lba field\n                              0,         # device field\n                              0xec,      # command field\n                              0x04,      # protocal field\n                              2,         # t_length field\n                              1)         # t_dir field \n\ncmd = Identify16()\nwith init_device(\"/dev/sdb\", open_t='scsi') as d:\n    d.execute(cmd, en_raw_sense=True)\n## Get the Result\n# Handle the Command execute sense data\n#  SAT-5 to make out ata_return_descriptor\nata_return_descriptor = cmd.ata_status_return_descriptor\nprint (\"Command return Status:\", ata_return_descriptor.get(\"status\"))\n# Get the datain, that read from device \nprint (\"Identify data read from device is:\")\nprint (cmd.datain)\n```\n\nExample to build and run your own SCSI command in Linux Or Windows. It is a little different from\nNVMe Or SATA, the methmod is from the project python-scsi.\n\n```\nfrom pyscsi.pyscsi.scsi_command import SCSICommand\nfrom pyscsi.pyscsi.scsi_enum_command import mmc, sbc, smc, spc, ssc\nfrom pydiskcmdlib.utils import init_device\n\nclass Read16(SCSICommand):\n    ## You need define the _cdb_bits to build cdb\n\n    _cdb_bits = {\n        \"opcode\": [0xFF, 0],\n        \"rdprotect\": [0xE0, 1],\n        \"dpo\": [0x10, 1],\n        \"fua\": [0x08, 1],\n        \"rarc\": [0x04, 1],\n        \"lba\": [0xFFFFFFFFFFFFFFFF, 2],\n        \"group\": [0x1F, 14],\n        \"tl\": [0xFFFFFFFF, 10],\n    }\n\n    def __init__(\n        self, lba, tl, rdprotect=0, dpo=0, fua=0, rarc=0, group=0\n    ):\n        \"\"\"\n        initialize a new instance\n\n        :param lba: Logical Block Address\n        :param tl: transfer length\n        :param rdprotect=0:\n        :param dpo=0:\n        :param fua=0:\n        :param rarc=0:\n        :param group=0:\n        \"\"\"\n        ##\n        # This command is sbc command-\u003eREAD_16, usually get by inquiry command, and\n        # and the device is 512 byte logical format.\n        ##\n        opcode = sbc.READ_16\n        blocksize= 512\n        ## Build command\n        SCSICommand.__init__(self, opcode, 0, blocksize * tl)\n\n        self.cdb = self.build_cdb(\n            opcode=self.opcode.value,\n            lba=lba,\n            tl=tl,\n            rdprotect=rdprotect,\n            dpo=dpo,\n            fua=fua,\n            rarc=rarc,\n            group=group,\n        )\n## send command: 4k read from LBA 0 to LBA 7\ncmd = Read16(0, 8)\n## Execute Command\nwith init_device(\"/dev/sdb\", open_t='scsi') as d:\n    d.execute(cmd)\n## Get the result\nprint (cmd.datain)\n```\n\n\nAcknowledgements\n================\nReally appreciate the project python-scsi in github.\n\n* Python-scsi: https://github.com/python-scsi/python-scsi\n\npcicrawler is a CLI tool to display/filter/export information about PCI or \nPCI Express devices and their topology.\n\n* pcicrawler: https://github.com/facebook/pcicrawler\n\nsmartie is a pure-python library for getting basic disk information such as \nmodel, serial number, disk health, temperature, etc...\n\n* smartie: https://github.com/TkTech/smartie\n\nCommunicate with NVMe SSD using Windows' inbox device driver\n\n* nvmetool-win: https://github.com/ken-yossy/nvmetool-win\n\nNVMe management command line interface.\n\n* nvme-cli: https://github.com/linux-nvme/nvme-cli\n\npyPCIe provides a quick way to read/write registers in PCIe Base Address Register (BAR) regions.\n\n* pyPCIe: https://github.com/heikoengel/pyPCIe\n\nA python/construct wrapper for sgio to replace cython-sgio\n\n* https://github.com/goodes/python-sgio\n\nA tool to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting \nTechnology System (SMART) built into most modern ATA/SATA, SCSI/SAS and NVMe disks\n\n* https://github.com/smartmontools/smartmontools\n\n\nReference Documents\n===================\n* https://community.intel.com/cipcp26785/attachments/cipcp26785/devcloud/9717/1/743971_Intel_VROC_IOCTLs_UG_Rev1p0.pdf\n\n\nSupport\n=======\nIf any support or ideas, open an issue, or contact author by email: Eric-1128@outlook.com\n\n\n[Intel VROC]: https://graidtech.com/vroc\n[Intel RST]: https://www.intel.com/content/www/us/en/support/products/55005/technologies/intel-rapid-storage-technology-intel-rst.html\n[cython-sgio]: https://github.com/python-scsi/cython-sgio\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackeichen%2Fpydiskcmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackeichen%2Fpydiskcmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackeichen%2Fpydiskcmd/lists"}