{
  "slug": "scsi-write-same",
  "term": "SCSI WRITE SAME",
  "aliases": [
    "WRITE SAME (10)",
    "WRITE SAME (16)",
    "WRITE SAME (32)"
  ],
  "definition": "SCSI WRITE SAME applies a repeated logical-block pattern to a contiguous LBA range and can request unmapping when supported.",
  "note": "The host normally supplies one block rather than the complete repeated payload; zero-fill is only one possible use. LBPWS and LBPWS10 advertise variant-specific UNMAP support. [sg-write-same]\n\nUNMAP=1 does not prove reclamation: The cited reference's Table 252 permits writing when deallocation or anchoring is not performed. For WRITE SAME(16), NDOB=1 omits data-out; LBPRZ=010b selects the provisioning initialization pattern, not necessarily zeros. Protection-information rules also apply. [scsi-write-same-reference]\n\nA zero block count may select the remaining device range; WSNZ can forbid it. This is a destructive operation, not a capability probe. [sg-write-same]\n\nNDOB controls data-out, not the block count. At the pinned implementation, omitting NUM leaves one block even with NDOB enabled. A manual example placed under whole-device zeroing omits NUM; its placement does not change that default. [sg-write-same-source] [sg-write-same]",
  "status": "shipping",
  "advantages": [
    {
      "text": "Repeated-block initialization can avoid transferring the complete range from the host.",
      "citationIds": [
        "sg-write-same"
      ]
    }
  ],
  "limitations": [
    {
      "text": "Command variant, provisioning flags and device limits must be interpreted together.",
      "citationIds": [
        "sg-write-same",
        "scsi-write-same-reference"
      ]
    }
  ],
  "related": [
    "scsi-unmap",
    "scsi-lbprz",
    "logical-block-provisioning-status",
    "nvme-write-zeroes",
    "data-sanitization"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "sg-write-same",
      "title": "sg3_utils sg_write_same manual, pinned author commit 1929463554c5: description, NDOB, NUM and UNMAP",
      "url": "https://raw.githubusercontent.com/doug-gilbert/sg3_utils/1929463554c5dc749c5a89bcefb2c88a08d45575/doc/sg_write_same.8",
      "accessed": "2026-11-09"
    },
    {
      "id": "scsi-write-same-reference",
      "title": "Seagate SCSI Commands Reference Rev. M (June 2022), sections 3.77-3.79 and Table 252",
      "url": "https://knowledge.seagate.com/files/staticfiles/support/docs/manual/Interface%20manuals/100293068m.pdf",
      "accessed": "2026-11-09"
    },
    {
      "id": "sg-write-same-source",
      "title": "sg3_utils pinned source: DEF_WS_NUMBLOCKS, main option parsing and do_write_same encoding",
      "url": "https://raw.githubusercontent.com/doug-gilbert/sg3_utils/1929463554c5dc749c5a89bcefb2c88a08d45575/src/sg_write_same.c",
      "accessed": "2026-11-09"
    }
  ],
  "updated": "2026-11-09",
  "provenance": [
    "Version-scoped source synthesis; no device command or hardware experiment performed."
  ]
}
