2018-01-25 14:29:31 +00:00
|
|
|
---
|
|
|
|
title: About the filesystem Resource
|
2018-02-16 00:28:15 +00:00
|
|
|
platform: linux
|
2018-01-25 14:29:31 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# filesystem
|
|
|
|
|
2018-02-07 13:27:48 +00:00
|
|
|
Use the `filesystem` InSpec resource to audit filesystem disk space usage.
|
|
|
|
|
2018-01-25 14:29:31 +00:00
|
|
|
<br>
|
|
|
|
|
|
|
|
## Syntax
|
|
|
|
|
|
|
|
A `filesystem` resource block declares tests for disk space in a partion:
|
|
|
|
|
|
|
|
describe filesystem('/') do
|
|
|
|
its('size') { should be >= 32000 }
|
|
|
|
end
|
|
|
|
|
|
|
|
where
|
|
|
|
|
2018-02-07 13:27:48 +00:00
|
|
|
* `filesystem('/')` states that the resource will look at the root (/) partition.
|
|
|
|
* `size` is measured in megabytes (MB).
|
2018-01-25 14:29:31 +00:00
|
|
|
|
|
|
|
<br>
|
|
|
|
|
2018-02-07 13:27:48 +00:00
|
|
|
## Resource Property Examples
|
2018-01-25 14:29:31 +00:00
|
|
|
|
|
|
|
The following examples show how to use this InSpec audit resource.
|
|
|
|
|
|
|
|
### Test if the root partition is greater thank 32000 MB
|
|
|
|
|
|
|
|
describe filesystem('/') do
|
|
|
|
its('size') { should be >= 32000 }
|
|
|
|
end
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
## Matchers
|
|
|
|
|
|
|
|
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|