SG_REP_DENSITY(8)
π SG_REP_DENSITY(8) π
Part of the sg3_utils crew, so you know it's serious π§
β¨ NAME β¨
okay so sg_rep_density is the tool that sends a SCSI REPORT DENSITY SUPPORT command πΌ it's giving tape drive energy, literally.
π SYNOPSIS π
sg_rep_density [--help] [--hex] [--inhex=FN] [--maxlen=LEN] [--media]
[--raw] [--readonly] [--typem] [--verbose] [--version] DEVICE
π¦ DESCRIPTION π¦
bestie, this one sends a SCSI REPORT DENSITY command to DEVICE and then prints whatever comes back π
it's tape drive specific, so don't expect it to vibe with your SSD π The command shows up in the SSC-5 draft standard, revision 6 (ssc5r06.pdf), and it was already around back in the SSC-2 standard (ANSI INCITS 380-2003) β¨
by default it asks the DEVICE (like a tape drive) for its density code descriptors and then decodes the answer π₯ if you throw in --typem, it goes for the medium type descriptors instead πΈ and with --media, it checks what the density codes or medium type descriptors are for the media sitting inside the DEVICE (like a tape cartridge) π«Ά
π OPTIONS π
Arguments to long options are mandatory for short options as well, so don't get lazy about it π
-h,--helpβ shows you the usage message, then bounces π-H,--hexβ dumps the response as hexadecimal to stdout π one use gives you the whole thing in ASCII hex with an address on each line, starting at 0 π§ two uses gives you hex with no leading address on each line π three uses gives you output you can save to a file and feed back into another run with--inhex=FNπ-i,--inhex=FNβFNis a file whose contents are treated as ASCII hexadecimal β¨ if you also giveDEVICE, it gets ignored and you'll get a warning, but the tool keeps going and decodes the fileFNπ₯Ί check the "HEX, BINARY AND JSON FORMATS" section in the sg3_utils manpage for more deets π and if you add--rawtoo, thenFNis treated as binary instead π€-m,--maxlen=LENβLENis the (maximum) response length in bytes πΈ it goes into the cdb's "allocation length" field π if you don't give it, orLENis zero, the default is 8192 β¨ the biggestLENyou can use is 65535 π«Ά-M,--mediaβ flips the MEDIA bit in the cdb, so the density codes (or medium types) that the tape cartridge in the drive supports get included in the response πΌ by default you get the codes the tape drive itself supports π heads up: if there's no "medium" (like a tape cartridge) in the drive, the SCSI command will fail with a "not ready" sense key π-r,--rawβ outputs the SCSI response (the data-out buffer) as binary to stdout π¦ unless you're using--inhex=FNπ when you pair it with--inhex=FN, the contents ofFNget read as binary rather than hex π-R,--readonlyβ opens theDEVICEread-only, like using the O_RDONLY flag on Unix π the default is read-write π-t,--typemβ flips the MEDIUM TYPE bit in the cdb, so you get the medium types supported by the tape drive (or tape cartridge) in the response π§ without it, you get density codes π-v,--verboseβ cranks up the verbosity so you get more debug output π₯-V,--versionβ prints the version string, then peaces out βοΈ
πΈ EXIT STATUS πΈ
when everything goes right, sg_rep_density exits with 0 β¨ if it doesn't, check the sg3_utils(8) man page for the full story π
π«Ά AUTHORS π«Ά
Written by Douglas Gilbert, the legend himself π
π REPORTING BUGS π
if something's broken, send the bug report to <dgilbert at interlog dot com> π
π COPYRIGHT π
Copyright Β© 2022-2023 Douglas Gilbert π This software is distributed under a BSD-2-Clause license. There is NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE π
π§ SEE ALSO π§
sg3_utils(sg3_utils) π
okay bestie, that's the whole tea β this page came from sg3_utils-1.48, dated June 2023, and it's still giving ππβ¨
π¦ where this page comes from
- alpine 3.24: sg3_utils-doc 1.48-r0 Β· BSD-2-Clause AND GPL-2.0-or-later
- arch rolling: sg3_utils 1.49-1 Β· GPL-2.0-or-later AND BSD-2-Clause
- centos-stream 10: sg3_utils 1.48-11.el10 Β· GPL-2.0-or-later AND BSD-2-Clause
- debian trixie: sg3-utils 1.48-3~deb13u1
- fedora 43: sg3_utils 1.48-10.fc43 Β· GPL-2.0-or-later AND BSD-2-Clause
- fedora 43: sg3_utils 1.48-6.fc43 Β· GPL-2.0-or-later AND BSD-2-Clause
- fedora 44: sg3_utils 1.48-10.fc44 Β· GPL-2.0-or-later AND BSD-2-Clause
- fedora 44: sg3_utils 1.48-8.fc44 Β· GPL-2.0-or-later AND BSD-2-Clause
- nixos 26.05: sg3_utils 1.48
- nixpkgs unstable: sg3_utils 1.49
- ubuntu questing: sg3-utils 1.48-2ubuntu1
- ubuntu resolute: sg3-utils 1.48-3ubuntu3
- ubuntu resolute: sg3-utils 1.48-3ubuntu3.2
- ubuntu stonking: sg3-utils 1.48-3ubuntu5
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms