Skip to content

A simple C application to get the information about mountpoints and free space with JSON output.

License

Notifications You must be signed in to change notification settings

GentooXativa/json-disk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-disk

A simple C application to get the information about mountpoints and free space with JSON output.

Usage

Usage: json_disk [-h] [-m]
        -h      Show this help
        -m      Use /etc/mtab instead of /etc/fstab

Example output

[
  {
    "mountpoint": "/",
    "free": 1092571136,
    "total": 20506800128,
    "type": "ext4",
    "fsname": "/dev/md2",
    "fsopts": "errors=remount-ro,relatime"
  },
  {
    "mountpoint": "/srv",
    "free": 304944160768,
    "total": 3916700098560,
    "type": "ext4",
    "fsname": "/dev/md3",
    "fsopts": "defaults,relatime"
  },
  {
    "mountpoint": "swap",
    "free": 304944160768,
    "total": 3916700098560,
    "type": "swap",
    "fsname": "/dev/sda4",
    "fsopts": "defaults"
  },
  {
    "mountpoint": "swap",
    "free": 304944160768,
    "total": 3916700098560,
    "type": "swap",
    "fsname": "/dev/sdb4",
    "fsopts": "defaults"
  },
  {
    "mountpoint": "swap",
    "free": 304944160768,
    "total": 3916700098560,
    "type": "swap",
    "fsname": "/dev/sdc4",
    "fsopts": "defaults"
  },
  {
    "mountpoint": "/dev/shm",
    "free": 8401739776,
    "total": 8401739776,
    "type": "tmpfs",
    "fsname": "tmpfs",
    "fsopts": "defaults"
  }
]

About

A simple C application to get the information about mountpoints and free space with JSON output.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published