Re: [rhel7] Different output for WWN between lsscsi and lsblk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list




[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux