SG_REP_DENSITY(8)

πŸ“¦
version 1.49 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 β€” FN is a file whose contents are treated as ASCII hexadecimal ✨ if you also give DEVICE, it gets ignored and you'll get a warning, but the tool keeps going and decodes the file FN πŸ₯Ί check the "HEX, BINARY AND JSON FORMATS" section in the sg3_utils manpage for more deets πŸ“– and if you add --raw too, then FN is treated as binary instead πŸ€–
  • -m, --maxlen=LEN β€” LEN is the (maximum) response length in bytes 🌸 it goes into the cdb's "allocation length" field πŸ’… if you don't give it, or LEN is zero, the default is 8192 ✨ the biggest LEN you 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 of FN get read as binary rather than hex πŸ’œ
  • -R, --readonly β€” opens the DEVICE read-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 Β© 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