The DISKS plugin allows the disk space situation to be monitored by adding an Information Schema DISKS table which can then be queried.

It was added in MariaDB 10.3.6, MariaDB 10.2.14 and MariaDB 10.1.32.

Installation

Installing the plugin can be performed with the INSTALL PLUGIN or INSTALL SONAME statement, for example.

INSTALL SONAME 'disks';

Description

The table contains the following columns:

ColumnDescription
DISKName of the disk itself.
PATHMount point of the disk.
TOTALTotal space in KiB.
USEDUsed amount of space in KiB.
AVAILABLEAmount of space in KiB available to non-root users.

Note that as the amount of space available to root (OS user) may be more that what is available to non-root users, 'available' + 'used' may be less than 'total'.

All paths to which a particular disk has been mounted are reported. The rationale is that someone might want to take different action e.g. depending on which disk is relevant for a particular path. This leads to the same disk being reported multiple times.

This plugin does not check user privileges. When it is enabled, any user can query the INFORMATION_SCHEMA.DISKS table and see all the information it provides.

As of the first version, the plugin only works on Linux.

Example

SELECT * FROM information_schema.DISKS;

+-----------+-------+----------+---------+-----------+
| Disk      | Path  | Total    | Used    | Available |
+-----------+-------+----------+---------+-----------+
| /dev/vda1 | /     | 26203116 | 2178424 |  24024692 |
| /dev/vda1 | /boot | 26203116 | 2178424 |  24024692 |
| /dev/vda1 | /etc  | 26203116 | 2178424 |  24024692 |
+-----------+-------+----------+---------+-----------+

See Also

Comments

Comments loading...