SG_LUNS(8) SG3_UTILS SG_LUNS(8) (NAME) sg_luns - SCSI REPORT LUNS LUN (SYNOPSIS) sg_luns [--decode] [--help] [--hex] [--inhex=FN] [--inner-hex] [--json[=JO]] [--js-file=JFN] [--linux] [--lu_cong] [--maxlen=LEN] [--quiet] [--raw] [--readonly] [--select=SR] [--sinq_inraw=RFN] [--verbose] [--version] DEVICE sg_luns --test=ALUN [--decode] [--hex] [--inner-hex] [--lu_cong] [--verbose] (DESCRIPTION) << >> SCSI REPORT LUNS DEVICE . LUN (<< LUN>>) I_T DEVICE . LUN REPORT LUNS . SCSI SPC-3 SPC-4 . SPC-6 . --test=ALUN ( << >>) ALUN SCSI ( SAM) ( SAM-6 .) . << >> << >> (device mode) << >> (test mode) . (OPTIONS) . -d, --decode LUN LUN SAM-3 SAM-4 SAM-5 . [ ] ALUN . ALUN T10 ( ) . ALUN T10 - ( C101-0000-0000-0000). -h, --help . -H, --hex [ ] SCSI ( data-out) REPORT LUNS ASCII . --decode . ( '-HH') sg3_utils(8) . --inner-hex '-HH' . ( ) sg_luns --inhex=FN . [ ] ALUN . ASCII ( ) . --inhex=FN . ( <<#>> ) . --inhex=FN . -i, --inhex=FN FN ( <<->> stdin) ASCII REPORT LUNS . . <> sg3_utils . --raw FN . -I, --inner-hex --decode . . '-HH' . -j[=JO], --json[=JO] JSON . <<=>> <<=>> . sg3_utils_json <> JO . -J, --js-file=JFN JSON JFN . . JSON (stdout) . --json[=JO] . JO --json[=JO] . -l, --linux . T10 LUN ( ) LUN . --hex ( -HH) LUN . -L, --lu_cong --decode . LUN LU_CONG INQUIRY LU (set) . LUN LU_CONG INQUIRY LU (clear) . --decode INQUIRY DEVICE LU_CONG LUN . [ ] ALUN LU_CONG INQUIRY ALUN LUN (conglomerate LUN) . ( ) ALUN LU_CONG . -m, --maxlen=LEN LEN () <> cdb . ( LEN ) . LEN . -q, --quiet ASCII LUN . --quiet LUN . -r, --raw SCSI ( data-out) ( stdout). -R, --readonly DEVICE ( O_RDONLY ). - . -s, --select=SR SR SELECT REPORT SCSI REPORT LUNS . 0 . <<0x>> <> . REPORT LUNS SPC ( SPC-4 . ). I_T DEVICE SR SPC-4 : 0 : LUN (well known) 1 : 2 : LUN I_T 0x10 : LUN 0x11 : LUN LUN ( SPC-4 ) 0x12 : DEVICE LU LUN LUN SR 0x10 0x11 DEVICE LUN 0 REPORT LUNS. 0xf8 0xff ( ) (vendor specific) . 0 255 (0xff) SR . -Q, --sinq_inraw=RFN RFN INQUIRY DEVICE FN . INQUIRY sysfs . /sys/class/scsi_device//device/inquiry . . LU_CONG INQUIRY . --raw . DEVICE . -t, --test=ALUN ALUN ASCII hex 'L' ( ). ( ) (pad) ( --test=0122003a T10 LUN : 01 22 00 3a 00 00 00 00 ). ALUN '0x' '0X' ( --test=0x0122003a ). ALUN '-' ( c101-0000-0000-0000) . ALUN . 'L' ( '0x' ) LUN << >> (word flipped) LUN T10 . LUN --decode . ALUN 'L' LUN <> . LUN . --decode . -v, --verbose ( ). -V, --version . (NOTES) SCSI REPORT LUNS (LU) . ( ) INQUIRY ( LU_CONG) REPORT LUNS LUN 0 ( bus_id=0 target/lun=0 ) LUN REPORT LUNS ( 0xc101000000000000). SAM-5 LUN . --hex (leading zeros) . . : ( ) (bus ID) target/LUN ( bus_id=0x02, target=0x3a). (EXAMPLES) LU SCSI . lsscsi . LUN (LU) . ( << I_T>>: "6:0:0") LUN : 1 49409. 49409 T10 LUN 0xc101000000000000 LUN REPORT LUNS . # lsscsi -g [6:0:0:1] disk Linux scsi_debug 0004 /dev/sdb /dev/sg1 [6:0:0:2] disk Linux scsi_debug 0004 /dev/sdc /dev/sg2 [6:0:0:49409]wlun Linux scsi_debug 0004 - /dev/sg3 REPORT LUNS ( SR 0x0 0x1 0x2) . /dev/sg1 : # sg_luns /dev/sg1 Lun list length = 16 which implies 2 lun entries Report luns [select_report=0x0]: 0001000000000000 0002000000000000 --quiet : # sg_luns -q /dev/sg1 0001000000000000 0002000000000000 LUN : # sg_luns -d -q /dev/sg1 0001000000000000 Peripheral device addressing: lun=1 0002000000000000 Peripheral device addressing: lun=2 --select=1 LUN : # sg_luns -q -s 1 /dev/sg1 c101000000000000 LUN ( I_T ): # sg_luns -q -s 2 /dev/sg1 0001000000000000 0002000000000000 c101000000000000 # sg_luns -q -s 2 -d /dev/sg1 0001000000000000 Peripheral device addressing: lun=1 0002000000000000 Peripheral device addressing: lun=1 c101000000000000 REPORT LUNS well known logical unit --linux . T10 LUN . # sg_luns -q -s 2 -l /dev/sg1 0001000000000000 [1] 0002000000000000 [2] c101000000000000 [49409] --test= LUN ( REPORT LUNS ): # sg_luns --test=0002000000000000 Decoded LUN: Peripheral device addressing: lun=2 # sg_luns --test="c1 01" Decoded LUN: REPORT LUNS well known logical unit # sg_luns -t 0x023a004b -H Decoded LUN: Peripheral device addressing: bus_id=0x02, target=0x3a >>Second level addressing: Peripheral device addressing: lun=0x4b LUN 49409 T10 : # sg_luns --test=L49409 64 bit LUN in T10 preferred (hex) format: c1 01 00 00 00 00 00 00 Decoded LUN: REPORT LUNS well known logical unit T10 LUN : # sg_luns -t c101L Linux 'word flipped' integer LUN representation: 49409 Decoded LUN: REPORT LUNS well known logical unit (EXIT STATUS) sg_luns 0 . sg3_utils(8) . (AUTHORS) Douglas Gilbert. (REPORTING BUGS) . (COPYRIGHT) (C) 2004-2023 Douglas Gilbert BSD-2-Clause . . (SEE ALSO) sg_inq(8),sg3_utils(8) sg3_utils-1.48 June 2023 SG_LUNS(8)