[rhel7] Different output for WWN between lsscsi and lsblk
Nicolas C.
rh at nryc.fr
Wed Dec 7 13:58:31 UTC 2022
Le 06/12/2022 à 17:51, Nicolas C. a écrit :
> Reply to myself: using "serial" instead of "wwn" in lsblk does the
> trick. I'm still unable to display a serial/wwn with a compiled lsblk
> but in the worst case I can use jc:
>
> lsblk -o +serial | jc --lsblk | jq .
Well, it turns out that this is not a good idea because "jc" does not
handle the hierarchy between partitions on disks.
>> Also, if I try to compile a newer version of lsblk to have the --json
>> option, the wwn is blank :
>>
>> [root at xxx ~]# /opt/util-linux-2.38.1/bin/lsblk --json -o +wwn
>> {
>> "blockdevices": [
>> {
>> "name": "sda",
>> "maj:min": "8:0",
>> "rm": false,
>> "size": "512M",
>> "ro": false,
>> "type": "disk",
>> "mountpoints": [
>> null
>> ],
>> "wwn": null,
Well, after digging around I finally have a "lsblk" with json and
wwn/serial support. I had to install the systemd-devel package to enable
udev capabilities during compiling.
[root at xxx ~]# /opt/util-linux-2.38.1/bin/lsblk -o +serial --json
{
"blockdevices": [
{
"name": "sda",
"maj:min": "8:0",
"rm": false,
"size": "512M",
"ro": false,
"type": "disk",
"mountpoints": [
null
],
"serial": "6000c295b23ff650e8af9c9cc76a46b7",
Cheers,
Nicolas
More information about the redhat-list
mailing list