[prev in list] [next in list] [prev in thread] [next in thread] 

List:       redhat-list
Subject:    Re: [rhel7] Different output for WWN between lsscsi and lsblk
From:       "Nicolas C." <rh () nryc ! fr>
Date:       2022-12-07 13:58:31
Message-ID: 7851243c-12f9-b431-b826-d02f01d570b4 () nryc ! fr
[Download RAW message or body]

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@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@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

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic