2017-01-03 12:29:14 +01:00
---
layout: "ignition"
page_title: "Ignition: ignition_filesystem"
2017-03-06 13:23:04 +01:00
sidebar_current: "docs-ignition-datasource-filesystem"
2017-01-03 12:29:14 +01:00
description: |-
Describes the desired state of a system’ s filesystem.
---
# ignition\_filesystem
2017-03-06 13:23:04 +01:00
Describes the desired state of a the system’ s filesystems to be configured and/or used with the _ignition\_file_ resource.
2017-01-03 12:29:14 +01:00
## Example Usage
2017-04-17 12:17:54 +02:00
```hcl
2017-03-06 13:23:04 +01:00
data "ignition_filesystem" "foo" {
2017-01-03 12:29:14 +01:00
name = "root"
mount {
device = "/dev/disk/by-label/ROOT"
format = "xfs"
2017-03-23 10:02:54 +01:00
create = true
2017-01-03 12:29:14 +01:00
options = ["-L", "ROOT"]
}
}
```
## Argument Reference
The following arguments are supported:
* `name` - (Optional) The identifier for the filesystem, internal to Ignition. This is only required if the filesystem needs to be referenced in the a _ignition\_files_ resource.
* `mount` - (Optional) Contains the set of mount and formatting options for the filesystem. A non-null entry indicates that the filesystem should be mounted before it is used by Ignition.
* `path` - (Optional) The mount-point of the filesystem. A non-null entry indicates that the filesystem has already been mounted by the system at the specified path. This is really only useful for _/sysroot_ .
The `mount` block supports:
2017-03-23 10:02:54 +01:00
2017-01-03 12:29:14 +01:00
* `device` - (Required) The absolute path to the device. Devices are typically referenced by the _/dev/disk/by-*_ symlinks.
* `format` - (Required) The filesystem format (ext4, btrfs, or xfs).
2017-03-23 10:02:54 +01:00
* `create` - (Optional) Indicates if the filesystem shall be created.
* `force` - (Optional) Whether or not the create operation shall overwrite an existing filesystem. Only allowed if the filesystem is being created.
2017-01-03 12:29:14 +01:00
2017-03-23 10:02:54 +01:00
* `options` - (Optional) Any additional options to be passed to the format-specific mkfs utility. Only allowed if the filesystem is being created
2017-01-03 12:29:14 +01:00
## Attributes Reference
The following attributes are exported:
* `id` - ID used to reference this resource in _ignition_config_.