SG_REFERRALS(8)

πŸ’… SG_REFERRALS πŸ’…

okay bestie, welcome to sg_referrals β€” a little icon from the sg3_utils collection (that's the manual fam, section 8, we're in the big-kid sysadmin pages now 🫢).


✨ NAME ✨

sg_referrals β€” the girl whose whole job is to send the SCSI REPORT REFERRALS command. that's it. that's the gig. πŸ’…


🌸 SYNOPSIS 🌸

sg_referrals [--help] [--hex] [--lba=LBA] [--maxlen=LEN] [--one-segment]
[--raw] [--readonly] [--verbose] [--version] DEVICE

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: you point sg_referrals at a DEVICE, it sends the SCSI REPORT REFERRALS command, and then it outputs the response back at you. slay. ✨

lowkey a little history moment: this command was introduced in (draft) SBC-3 revision 24, and any device that supports referrals should support this command. iykyk. πŸ’€

by default it decodes the response for all user data segment referral descriptors β€” like, every single one, no crumbs left. πŸ“ if you want less yapping, the --lba and --one-segment options are right there to trim the output down. main character energy: you decide how much screen time the response gets. πŸ‘‘


πŸŽ€ OPTIONS πŸŽ€

quick heads up bestie: arguments to long options are mandatory for short options too. no skipping, periodt.

  • -h, --help β€” prints the usage message, then dips out. bye. πŸ‘‹
  • -H, --hex β€” outputs the response to this command in ASCII hex, for when you wanna see the raw digits in all their glory.
  • -l, --lba=LBA β€” where LBA is the Logical Block Address (LBA) in the first user data segment that the DEVICE should report the referrals parameter data for. very specific, very intentional. πŸ’…
  • -m, --maxlen=LEN β€” where LEN is the (maximum) response length in bytes. it gets placed in the cdb's "allocation length" field. if you don't give it one, 256 is used. and 256 is literally enough space for the response header and user data segment descriptors β€” she's got room. 🫢
  • -s, --one-segment β€” reports the user data segment of the segment specified by the LBA parameter only. one segment. one moment. no plus-ones. πŸ™ˆ
  • -r, --raw β€” outputs the response in binary, straight to stdout. raw and unfiltered, we love that for her. πŸ”₯
  • -R, --readonly β€” opens the DEVICE read-only (e.g. in Unix with the O_RDONLY flag). the default is to open it read-write. so if you want zero writes happening, say it with your chest. ✨
  • -v, --verbose β€” increases the level of verbosity, i.e. debug output. any extra output caused by this option gets sent to stderr β€” keep your stdout clean, bestie. πŸ’œ
  • -V, --version β€” prints the version string and then exits. cute and brief. ⭐

πŸ’€ NOTES πŸ’€

for a discussion of referrals, see section 4.25 of sbc3r25.pdf at https://www.t10.org (or the corresponding section of a later draft). yes, actual homework. yes, it's giving research era. 🧚


🌈 EXIT STATUS 🌈

the exit status of sg_referrals is 0 when it's successful. ngl that's the dream. πŸŽ€

otherwise? see the sg3_utils(8) man page. she'll explain. πŸ’…


πŸ‘‘ AUTHORS πŸ‘‘

Written by Douglas Gilbert and Hannes Reinecke. icons, both of them. 🫢


πŸ’– REPORTING BUGS πŸ’–

report bugs to <dgilbert at interlog dot com>. be nice, be specific, include the details. πŸ’Œ


Copyright Β© 2009-2014 Douglas Gilbert and Hannes Reinecke

this software is distributed under a BSD-2-Clause license. there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. like, none. zero. nada. don't come for her if it breaks. 😭


⭐ SEE ALSO ⭐


and that's the page, bestie πŸ’…βœ¨ this whole thing is from sg3_utils-1.39, dated May 2014 β€” vintage, but make it iconic. πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from