SG_GET_CONFIG(8)
π NAME π
okay bestie, the manual name is SG3_UTILS and this page is all about sg_get_config, which sends a SCSI GET CONFIGURATION command (MMC-4 +) πβ¨
π§ SYNOPSIS π§
sg_get_config [--brief] [--current] [--help] [--hex] [--inner-hex]
[--list] [--raw] [--readonly] [--rt=RT] [--starting=FC] [--verbose]
[--version] DEVICE
πΈ DESCRIPTION πΈ
okay so this one sends a SCSI GET CONFIGURATION command to DEVICE and then decodes the response for you π
The response tells you all about the device's features and profiles π₯ The devices this is usually for are CD, DVD, HD-DVD and BD players, and they may (but not necessarily) have media in them πΏ They might be connected over ATAPI, USB or IEEE 1394, and in those cases they only count as "SCSI" devices because they speak the "Multi-Media command" set (MMC) π¦ MMC is a specialised SCSI command set, and you can find its definition at https://www.t10.org π«Ά
This utility is based on the MMC-4 and later draft standards π For more on specific feature parameters and profiles, check section 5 on "Features and Profile for Multi_Media devices" β¨ The manufacturer's product manual might be useful too, lowkey π
ngl the output can get huge because modern DVD and BD writers support loads of features and profiles π Here's how to cut it down:
- If you use
--brief, you only get the feature names and the feature parameters don't get decoded π - If only one feature is interesting to you, try this combo: "
--rt=2 --starting=FC" π - Want only the features that match the media in the drive (aka "current")? Use the "
--rt=1" option π
π OPTIONS π
Arguments to long options are mandatory for short options as well, so don't forget them π
-b,--briefβ shows the feature names but skips decoding their parameters π When paired with--list, it shows the known feature names but not the known profile names.-c,--currentβ outputs the features marked as current π This is the same as'--rt=1'.-h,--helpβ prints the usage message and then exits π-H,--hexβ outputs the response in hex, no decoding π₯-i,--inner-hexβ decodes down to the feature name level, then outputs each feature's data in hex β¨-l,--listβ lists every known feature and profile name, and ignores the device name if you gave one π§ You get the feature names and profiles (followed by their hex values) that this utility knows about. If you also add--brief, you only get the feature names.-q,--readonlyβ opensDEVICEread-only instead of the default read-write π«Ά The Linux sg driver needs read-write access for the SCSI GET CONFIGURATION command, but other access methods might need read-only.-r,--rt=RTβRTis the field with that name in the GET CONFIGURATION cdb π Valid values are 0, 1, 2, or 3 . What the command does also depends on the--starting=FCoption, and the default is 0.- With
RT0, you get all features whether or not they're current, as long as their feature code is greater than or equal toFCgiven to--starting=. - With
RT1, you get all current features whose feature code is greater than or equal toFC. - With
RT2, you get the feature whose feature code is equal toFC, if there is one. - With
RT3, the response is reserved, so you'll probably get an "illegal field in cdb" error π
- With
To make the RT values easier to remember:
0 : all features, current on not
1 : only current features
2 : only feature whose code is FC
3 : reserved
-R,--rawβ outputs the response in binary to stdout π¦ Heads up: the short form is-R, not-r, unlike most other utilities in this package that use-rfor this action π-s,--starting=FCβFCis the feature code value πΈ This option works closely with--rt=RT.FCcan be in the range 0 to 65535 (0xffff) inclusive, and its default is 0. A value prefixed with "0x" (or a trailing 'h') is read as hexadecimal β¨-v,--verboseβ cranks up the verbosity, aka the debug output π₯-V,--versionβ prints the version string and then exits π
π¦ NOTES π¦
okay this part is a history lesson but it's actually important π There are multiple versions of the MMC (draft) standards: MMC [1997], MMC-2 [2000], MMC-3 [2002], MMC-4 and MMC-5 π The first three are now ANSI INCITS standards, and the year they became standards is shown in brackets. The draft right before standardisation is at https://www.t10.org β¨
The initial MMC standard had no GET CONFIGURATION command, so the info came from the "CD capabilities and mechanical status mode page" (mode page 0x2a) π That got renamed to the "MM capabilities and mechanical status mode page" and was made obsolete in MMC-4 and MMC-5 π₯Ί The GET CONFIGURATION command arrived in MMC-2 and replaced that mode page π«Ά New stuff like support for "BD" (blue ray) media types can only be found with GET CONFIGURATION, so older CD players might not support it π If that's the case, check the "MM capabilities ..." mode page with sdparm(8), sginfo(8) or sg_modes(8) π
In the 2.4 series of Linux kernels, DEVICE must be a SCSI generic (sg) device π In the 2.6 series, block devices can be specified too. For example, "sg_get_config /dev/hdc" works on 2.6 series kernels as long as /dev/hdc is an ATAPI device β¨ Also in the 2.6 series, external DVD writers attached via USB can be queried with something like "sg_get_config /dev/scd1" π§
π EXIT STATUS π
The exit status of sg_get_config is 0 when it succeeds π
Otherwise, see the sg3_utils(8) man page π₯
π«Ά AUTHORS π«Ά
Written by Douglas Gilbert π
π REPORTING BUGS π
Report bugs to <dgilbert at interlog dot com> π
π COPYRIGHT π
Copyright Β© 2004-2012 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 π
sginfo(8), sg_modes(8), sg_inq(8), sg_prevent(8), sg_start(8) [all in sg3_utils], sdparm(8) β¨
okay bestie that's the whole page, it's from sg3_utils-1.35, December 2012, and it's the SG_GET_CONFIG(8) page ππ§β¨
π¦ 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