SCSI_READCAP(8)

πŸ“¦
version 1.49 Β· 3 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

✨ scsi_readcap (SCSI_READCAP(8)) ✨

okay so bestie, scsi_readcap is a bash shell script that runs the sg_readcap utility on every DEVICE you hand it πŸ’… 🫢 (it's the SCSI_READCAP(8) manual page, btw πŸŽ€)

🧚 NAME

scsi_readcap - do SCSI READ CAPACITY command on disks πŸ’–

πŸ“œ SYNOPSIS

scsi_readcap [--brief] [--help] [--long] [--verbose] DEVICE [DEVICE]*

🌸 DESCRIPTION

okay so this bash shell script calls the sg_readcap utility on each DEVICE you give it. It sends a SCSI READ CAPACITY command to each DEVICE, and it's giving main character energy πŸ‘‘βœ¨

the default move is sending the 10 byte cdb READ CAPACITY(10) command to each DEVICE. but if the response says the number of blocks is greater than or equal to 2**32 - 1, then the script sends READ CAPACITY(16) and outputs that response instead 😭πŸ”₯

πŸŽ€ OPTIONS

bestie, arguments to long options are mandatory for short options as well πŸ™ˆ

  • -b, --brief β€” shortens the output to two hexadecimal numbers, both prefixed by 0x πŸ“ The first is the number of blocks available and the second is the size of each block in bytes (like 0x12a19eb0 0x200). If an error pops up, you get 0x0 0x0 and the script keeps going if there are more DEVICEs πŸ’€
  • -h, --help β€” prints the usage message, then exits πŸ¦‹
  • -l, --long β€” the default is sending READ CAPACITY(10) (the 10 byte cdb variant). with this option, READ CAPACITY(16) gets sent instead, and it yields more info in its response πŸ’œ
  • -v, --verbose β€” increases the level of verbosity 🌈

πŸ¦‹ EXIT STATUS

the exit status is 0 when the script is successful 🫢 otherwise the exit status is whatever the last sg_readcap utility called gave back. see the sg3_utils(8) man page for the deets 🌸

πŸ’… AUTHORS

Written by D. Gilbert ✨

Copyright Β© 2009-2013 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

sg_readcap (sg3_utils) πŸŽ€


okay that's the whole tea, bestie 🫢 this is from sg3_utils-1.36, May 2013, SCSI_READCAP(8) πŸ’œβœ¨

πŸ“¦ where this page comes from