+[[storage_directory]]
Directory Backend
-----------------
-include::attributes.txt[]
+ifdef::wiki[]
+:pve-toplevel:
+:title: Storage: Directory
+endif::wiki[]
Storage pool type: `dir`
content type like virtual disk images, containers, templates, ISO images
or backup files.
-NOTE: You can mount additional storages via standard linux '/etc/fstab',
+NOTE: You can mount additional storages via standard linux `/etc/fstab`,
and then define a directory storage for that mount point. This way you
can use any file system supported by Linux.
[width="100%",cols="d,m",options="header"]
|===========================================================
|Content type |Subdir
-|VM images |images/<VMID>/
-|ISO images |template/iso/
-|Container templates |template/cache
-|Backup files |dump/
+|VM images |`images/<VMID>/`
+|ISO images |`template/iso/`
+|Container templates |`template/cache/`
+|Backup files |`dump/`
+|Snippets |`snippets/`
|===========================================================
+
Configuration
~~~~~~~~~~~~~
-This backend supports all common storage properties, and adds an
-additional property called `path` to specify the directory. This
-needs to be an absolute file system path.
+This backend supports all common storage properties, and adds two
+additional properties. The `path` property is used to specify the
+directory. This needs to be an absolute file system path.
+
+The optional `content-dirs` property allows for the default layout
+to be changed. It consists of a comma-separated list of identifiers
+in the following format:
-.Configuration Example ('/etc/pve/storage.cfg')
+ vtype=path
+
+Where `vtype` is one of the allowed content types for the storage, and
+`path` is a path relative to the mountpoint of the storage.
+
+.Configuration Example (`/etc/pve/storage.cfg`)
----
dir: backup
path /mnt/backup
content backup
- maxfiles 7
+ prune-backups keep-last=7
+ max-protected-backups 3
+ content-dirs backup=custom/backup/dir
----
-Above configuration defines a storage pool called `backup`. That pool
-can be used to store up to 7 backups (`maxfiles 7`) per VM. The real
-path for the backup files is '/mnt/backup/dump/...'.
-
+The above configuration defines a storage pool called `backup`. That pool can be
+used to store up to 7 regular backups (`keep-last=7`) and 3 protected backups
+per VM. The real path for the backup files is `/mnt/backup/custom/backup/dir/...`.
File naming conventions
~~~~~~~~~~~~~~~~~~~~~~~
`<NAME>`::
-This can be an arbitrary name (`ascii`) without white spaces. The
+This can be an arbitrary name (`ascii`) without white space. The
backend uses `disk-[N]` as default, where `[N]` is replaced by an
integer to make the name unique.
`<FORMAT>`::
-Species the image format (`raw|qcow2|vmdk`).
+Specifies the image format (`raw|qcow2|vmdk`).
When you create a VM template, all VM images are renamed to indicate
-that they are now read-only, and can be uses as a base image for clones:
+that they are now read-only, and can be used as a base image for clones:
base-<VMID>-<NAME>.<FORMAT>
backend changes the access mode to `0444`, and sets the immutable flag
(`chattr +i`) if the storage supports that.
+
Storage Features
~~~~~~~~~~~~~~~~
.Storage features for backend `dir`
[width="100%",cols="m,m,3*d",options="header"]
|==============================================================================
-|Content types |Image formats |Shared |Snapshots |Clones
-|images rootdir vztempl iso backup |raw qcow2 vmdk subvol |no |qcow2 |qcow2
+|Content types |Image formats |Shared |Snapshots |Clones
+|images rootdir vztmpl iso backup snippets |raw qcow2 vmdk subvol |no |qcow2 |qcow2
|==============================================================================