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
|
|
|
|
|
2018-03-20 12:43:30 +00:00
|
|
|
A `filesystem` resource block declares tests for disk space in a partition:
|
2018-01-25 14:29:31 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2018-04-06 21:10:13 +00:00
|
|
|
### Test if the root partition is greater than 32000 MB
|
2018-01-25 14:29:31 +00:00
|
|
|
|
|
|
|
describe filesystem('/') do
|
|
|
|
its('size') { should be >= 32000 }
|
|
|
|
end
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
|
|
## Matchers
|
|
|
|
|
2018-02-16 03:07:18 +00:00
|
|
|
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|