nixos/filesystems: add overlayfs docs
This commit is contained in:
parent
1c1cfa073a
commit
1407ec7420
@ -39,4 +39,5 @@ and non-critical by adding `options = [ "nofail" ];`.
|
||||
```{=include=} sections
|
||||
luks-file-systems.section.md
|
||||
sshfs-file-systems.section.md
|
||||
overlayfs.section.md
|
||||
```
|
||||
|
27
nixos/doc/manual/configuration/overlayfs.section.md
Normal file
27
nixos/doc/manual/configuration/overlayfs.section.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Overlayfs {#sec-overlayfs}
|
||||
|
||||
NixOS offers a convenient abstraction to create both read-only as well writable
|
||||
overlays.
|
||||
|
||||
```nix
|
||||
fileSystems = {
|
||||
"/writable-overlay" = {
|
||||
overlay = {
|
||||
lowerdir = [ writableOverlayLowerdir ];
|
||||
upperdir = "/.rw-writable-overlay/upper";
|
||||
workdir = "/.rw-writable-overlay/work";
|
||||
};
|
||||
# Mount the writable overlay in the initrd.
|
||||
neededForBoot = true;
|
||||
};
|
||||
"/readonly-overlay".overlay.lowerdir = [
|
||||
writableOverlayLowerdir
|
||||
writableOverlayLowerdir2
|
||||
];
|
||||
};
|
||||
```
|
||||
|
||||
If `upperdir` and `workdir` are not null, they will be created before the
|
||||
overlay is mounted.
|
||||
|
||||
To mount an overlay as read-only, you need to provide at least two `lowerdir`s.
|
Loading…
Reference in New Issue
Block a user