Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: change blkid for lsblk #443

subzero79 opened this issue Sep 10, 2019 · 0 comments


Copy link

commented Sep 10, 2019

Description of issue/question

lsblk reports much more information about block devices than blkid, it has an option also to report in json which would make it easier to parse, in terminal the output looks good as a tree

sr0 11:0 1 551M 0 rom
vda 254:0 0 6G 0 disk
├─vda1 254:1 0 5G 0 part /
├─vda2 254:2 0 1K 0 part
└─vda5 254:5 0 1022M 0 part [SWAP]
vdb 254:16 0 1G 0 disk
└─vdb1 254:17 0 1023M 0 part /srv/dev-disk-by-label-test
vdc 254:32 0 1G 0 disk
└─vdc-crypt 252:0 0 1008M 0 crypt /srv/dev-disk-by-label-crypttest
vdd 254:48 0 1G 0 disk
└─vdd-crypt 252:1 0 1008M 0 crypt /srv/dev-disk-by-label-vdd
vde 254:64 0 1G 0 disk
└─vde1 254:65 0 1023M 0 part
vdf 254:80 0 103M 0 disk
└─vdf1 254:81 0 102M 0 part
vdg 254:96 0 1G 0 disk

Notice the mount point reports if the associated dev mapper under is encrypted. It would be good to have an extra column in the fs section to report if the block device associated with the mount point is encrypted

Now as json some columns only

root@omv5-dev:/dev/disk/by-label# lsblk -l -a -J -o uuid,type,name,mountpoint,fstype,path,maj:min,mountpoint
   "blockdevices": [
      {"uuid":"2019-08-16-07-08-11-00", "type":"rom", "name":"sr0", "mountpoint":null, "fstype":"iso9660", "path":"/dev/sr0", "maj:min":"11:0", "mountpoint":null},
      {"uuid":"c2c4ec20-87c3-4ef7-9366-788d2b12a06f", "type":"crypt", "name":"vdc-crypt", "mountpoint":"/srv/dev-disk-by-label-crypttest", "fstype":"ext4", "path":"/dev/mapper/vdc-crypt", "maj:min":"252:0", "mountpoint":"/srv/dev-disk-by-label-crypttest"},
      {"uuid":"fe3d2436-651f-4994-be83-66b8ea7b245e", "type":"crypt", "name":"vdd-crypt", "mountpoint":"/srv/dev-disk-by-label-vdd", "fstype":"ext4", "path":"/dev/mapper/vdd-crypt", "maj:min":"252:1", "mountpoint":"/srv/dev-disk-by-label-vdd"},
      {"uuid":null, "type":"disk", "name":"vda", "mountpoint":null, "fstype":null, "path":"/dev/vda", "maj:min":"254:0", "mountpoint":null},
      {"uuid":"50ababff-a22c-4adb-9f79-d90c72285d13", "type":"part", "name":"vda1", "mountpoint":"/", "fstype":"ext4", "path":"/dev/vda1", "maj:min":"254:1", "mountpoint":"/"},
      {"uuid":null, "type":"part", "name":"vda2", "mountpoint":null, "fstype":null, "path":"/dev/vda2", "maj:min":"254:2", "mountpoint":null},
      {"uuid":"88a0e3da-4d24-4a2c-8d6f-2a9f797fb33b", "type":"part", "name":"vda5", "mountpoint":"[SWAP]", "fstype":"swap", "path":"/dev/vda5", "maj:min":"254:5", "mountpoint":"[SWAP]"},
      {"uuid":null, "type":"disk", "name":"vdb", "mountpoint":null, "fstype":null, "path":"/dev/vdb", "maj:min":"254:16", "mountpoint":null},
      {"uuid":"3875f515-58d3-4b5c-bcf4-146472a5d7b0", "type":"part", "name":"vdb1", "mountpoint":"/srv/dev-disk-by-label-test", "fstype":"ext4", "path":"/dev/vdb1", "maj:min":"254:17", "mountpoint":"/srv/dev-disk-by-label-test"},
      {"uuid":"1b09da3e-5db6-4dde-9466-422057c28de4", "type":"disk", "name":"vdc", "mountpoint":null, "fstype":"crypto_LUKS", "path":"/dev/vdc", "maj:min":"254:32", "mountpoint":null},
      {"uuid":"ada57cad-239d-43da-aee8-6d35c0c88c6c", "type":"disk", "name":"vdd", "mountpoint":null, "fstype":"crypto_LUKS", "path":"/dev/vdd", "maj:min":"254:48", "mountpoint":null},
      {"uuid":null, "type":"disk", "name":"vde", "mountpoint":null, "fstype":null, "path":"/dev/vde", "maj:min":"254:64", "mountpoint":null},
      {"uuid":"133b8c13-abef-4f65-9e4e-47ab25af46e9", "type":"part", "name":"vde1", "mountpoint":null, "fstype":"ext4", "path":"/dev/vde1", "maj:min":"254:65", "mountpoint":null},
      {"uuid":null, "type":"disk", "name":"vdf", "mountpoint":null, "fstype":null, "path":"/dev/vdf", "maj:min":"254:80", "mountpoint":null},
      {"uuid":"6f5cb6b4-5749-4845-9a39-dcc0ccd9c5e7", "type":"part", "name":"vdf1", "mountpoint":null, "fstype":"ext4", "path":"/dev/vdf1", "maj:min":"254:81", "mountpoint":null},
      {"uuid":"2c0a2db2-f14a-45e0-a0c2-1278581cecfd", "type":"disk", "name":"vdg", "mountpoint":null, "fstype":"crypto_LUKS", "path":"/dev/vdg", "maj:min":"254:96", "mountpoint":null}

Steps to reproduce issue

Versions report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.