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

Fix for parsing Disk.fromLsblk on older Linux #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

filipsky
Copy link

@filipsky filipsky commented Apr 8, 2024

lsblk in Ubuntu 18.04 (in WSL) returns all data as strings.

changed parsing of bool and int properties to work on this format, too

{
  "blockdevices": [
    {
      "name": "/dev/sda",
      "kname": "/dev/sda",
      "maj:min": "8:0",
      "fstype": null,
      "mountpoint": null,
      "label": null,
      "uuid": null,
      "parttype": null,
      "partlabel": null,
      "partuuid": null,
      "partflags": null,
      "ra": "128",
      "ro": "1",
      "rm": "0",
      "hotplug": "0",
      "model": "Virtual Disk    ",
      "serial": null,
      "size": "407379968",
      "state": "running",
      "owner": "root",
      "group": "root",
      "mode": "brw-------",
      "alignment": "0",
      "min-io": "512",
      "opt-io": "0",
      "phy-sec": "512",
      "log-sec": "512",
      "rota": "1",
      "sched": "none",
      "rq-size": "950",
      "type": "disk",
      "disc-aln": "0",
      "disc-gran": "2097152",
      "disc-max": "4294966784",
      "disc-zero": "0",
      "wsame": "0",
      "wwn": null,
      "rand": "1",
      "pkname": null,
      "hctl": "0:0:0:0",
      "tran": null,
      "subsystems": "block:scsi:vmbus:acpi",
      "rev": "1.0 ",
      "vendor": "Msft    ",
      "zoned": "none"
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant