Directory - dir
¶
The directory storage driver is a basic backend that stores its data in a standard file and directory structure. This driver is quick to set up and allows inspecting the files directly on the disk, which can be convenient for testing. However, LXD operations are not optimized for this driver.
dir
driver in LXD¶
The dir
driver in LXD is fully functional and provides the same set of features as other drivers.
However, it is much slower than all the other drivers because it must unpack images and do instant copies of instances, snapshots and images.
Unless specified differently during creation (with the source
configuration option), the data is stored in the /var/snap/lxd/common/lxd/storage-pools/
(for snap installations) or /var/lib/lxd/storage-pools/
directory.
Quotas¶
The dir
driver supports storage quotas when running on either ext4 or XFS with project quotas enabled at the file system level.
Configuration options¶
The following configuration options are available for storage pools that use the dir
driver and for storage volumes in these pools.
Storage pool configuration¶
Key |
Type |
Default |
Description |
---|---|---|---|
|
string |
|
The upper limit to be placed on the socket I/O when |
|
bool |
|
Whether to use compression while migrating storage pools |
|
string |
- |
Path to an existing directory |
Tip
In addition to these configurations, you can also set default values for the storage volume configurations. See Configure default values for storage volumes.
Storage volume configuration¶
Key |
Type |
Condition |
Default |
Description |
---|---|---|---|---|
|
bool |
custom volume |
same as |
Enable ID shifting overlay (allows attach by multiple isolated instances) |
|
bool |
custom volume |
same as |
Disable ID mapping for the volume |
|
string |
appropriate driver |
same as |
Size/quota of the storage volume |
|
string |
custom volume |
same as |
Controls when snapshots are to be deleted (expects an expression like |
|
string |
custom volume |
same as |
Pongo2 template string that represents the snapshot name (used for scheduled snapshots and unnamed snapshots) [^*] |
|
string |
custom volume |
same as |
Cron expression ( |