Skip to content

Instantly share code, notes, and snippets.

@tdewin
Last active November 24, 2022 09:25
Show Gist options
  • Select an option

  • Save tdewin/db4dd0bb28c13ea49b3fa193dad0a5ad to your computer and use it in GitHub Desktop.

Select an option

Save tdewin/db4dd0bb28c13ea49b3fa193dad0a5ad to your computer and use it in GitHub Desktop.
# Generic
lsblk -f --json | jq '.blockdevices[] | select((.fstype == null) and (.children == null)) | {name:.name,available:.fsavail}'
# Looking for VMware disks
lsblk -O -J | jq '.blockdevices[] | select(.vendor == "VMware " and (.children == null)) | {name:.path,size:.size}'
# I feel lucky
TGTDISK=$(lsblk -O -J | jq -r '.blockdevices[] | select(.vendor == "VMware " and (.children == null)) | .path')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment