Skip to content

Instantly share code, notes, and snippets.

@ancorgs
Last active July 9, 2026 14:11
Show Gist options
  • Select an option

  • Save ancorgs/605dce3b9ed66bc66f59a05f97dacf2f to your computer and use it in GitHub Desktop.

Select an option

Save ancorgs/605dce3b9ed66bc66f59a05f97dacf2f to your computer and use it in GitHub Desktop.
{
"storage": {
"drives": [
{
"search": {
"condition": { "partitions": { "max": 0 } }
},
"alias": "noPartitionsA"
},
{
"search": {
"condition": { "partitions": false }
},
"alias": "noPartitionsB"
},
{
"search": {
"condition": { "partitions": { "min": 1 } }
},
"alias": "anyPartitionA"
},
{
"search": {
"condition": { "partitions": true }
},
"alias": "anyPartitionB"
},
{
"search": {
"condition": { "partitions": { "min": 2, "condition": { "size": { "less": "1GiB" } } } }
},
"alias": "with2SmallPartitions"
},
{
"search": {
"condition": { "partitions": { "max": 0, "condition": { "size": { "less": "1GiB" } } } }
},
"alias": "withoutSmallPartitions"
},
{
"search": {
"condition": { "filesystem": { "present": true } }
},
"alias": "formattedA"
},
{
"search": {
"condition": { "filesystem": true }
},
"alias": "formattedB"
},
{
"search": {
"condition": { "filesystem": { "present": false } }
},
"alias": "notFormattedA"
},
{
"search": {
"condition": { "filesystem": false }
},
"alias": "notFormattedB"
},
{
"search": {
"condition": { "filesystem": { "condition": { "type": ["xfs", "ext4"] } } }
},
"alias": "withLinuxFs"
},
{
"search": {
"condition": "and": [
{ "filesystem": { "present": true } },
{ "filesystem": { "present": false, "condition": { "type": ["xfs", "ext4"] } } }
]
},
"alias": "formattedButNotLinux"
},
{
"search": {
"condition": { "filesystem": { "present": false, "condition": { "type": ["xfs", "ext4"] } } }
},
"alias": "withoutLinuxFs"
},
{
"search": {
"condition": {
"and": [
{ "size": { "greater": "50 GiB" } },
{
"or": [
{ "partitions": true },
{ "filesystem": true }
]
}
]
},
"sort": { "size": "desc" },
"max": 1
},
"alias": "combined"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment