Disks Plugin
The DISKS
plugin was first released in MariaDB 10.3.6, MariaDB 10.2.14 and MariaDB 10.1.32.
The DISKS
plugin creates the DISKS
table in the INFORMATION_SCHEMA
database. This table shows metadata about disks on the system.
Before MariaDB 10.4.7, MariaDB 10.3.17, MariaDB 10.2.26 and MariaDB 10.1.41, this plugin did not check user privileges. When it is enabled, any user can query the INFORMATION_SCHEMA.DISKS
table and see all the information it provides.
Since MariaDB 10.4.7, MariaDB 10.3.17, MariaDB 10.2.26 and MariaDB 10.1.41, it requires the FILE privilege.
The plugin only works on Linux.
Installing the Plugin
Although the plugin's shared library is distributed with MariaDB by default, the plugin is not actually installed by MariaDB by default. There are two methods that can be used to install the plugin with MariaDB.
The first method can be used to install the plugin without restarting the server. You can install the plugin dynamically by executing INSTALL SONAME
or INSTALL PLUGIN
. For example:
INSTALL SONAME 'disks';
The second method can be used to tell the server to load the plugin when it starts up. The plugin can be installed this way by providing the --plugin-load
or the --plugin-load-add
options. This can be specified as a command-line argument to mysqld
or it can be specified in a relevant server option group in an option file. For example:
[mariadb] ... plugin_load_add = disks
Uninstalling the Plugin
You can uninstall the plugin dynamically by executing UNINSTALL SONAME
or UNINSTALL PLUGIN
. For example:
UNINSTALL SONAME 'disks';
If you installed the plugin by providing the --plugin-load
or the --plugin-load-add
options in a relevant server option group in an option file, then those options should be removed to prevent the plugin from being loaded the next time the server is restarted.
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 | +-----------+-------+----------+---------+-----------+
Versions
Version | Status | Introduced |
---|---|---|
1.1 | Stable | MariaDB 10.4.7, MariaDB 10.3.17, MariaDB 10.2.26, MariaDB 10.1.41 |
1.0 | Beta | MariaDB 10.3.6, MariaDB 10.2.14, MariaDB 10.1.32 |
Options
disks
-
Description: Controls how the server should treat the plugin when the server starts up.
- Valid values are:
-
OFF
- Disables the plugin without removing it from themysql.plugins
table. -
ON
- Enables the plugin. If the plugin cannot be initialized, then the server will still continue starting up, but the plugin will be disabled. -
FORCE
- Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. -
FORCE_PLUS_PERMANENT
- Enables the plugin. If the plugin cannot be initialized, then the server will fail to start with an error. In addition, the plugin cannot be uninstalled withUNINSTALL SONAME
orUNINSTALL PLUGIN
while the server is running.
-
- See Plugin Overview: Configuring Plugin Activation at Server Startup for more information.
- Valid values are:
-
Commandline:
--disks=value
-
Data Type:
enumerated
-
Default Value:
ON
-
Valid Values:
OFF
,ON
,FORCE
,FORCE_PLUS_PERMANENT
© 2021 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/disks-plugin/