diff --git a/pages/linux/systemctl-bind.md b/pages/linux/systemctl-bind.md new file mode 100644 index 00000000000000..a98099b176e893 --- /dev/null +++ b/pages/linux/systemctl-bind.md @@ -0,0 +1,20 @@ +# systemctl bind + +> Ephemerally bind-mount a file or directory from the host into a unit's mount namespace. +> More information: . + +- Bind-mount a host path into the same location inside the unit: + +`systemctl bind {{unit}} /{{path/to/host_directory}}` + +- Bind-mount a host path into a different location inside the unit: + +`systemctl bind {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}}` + +- Bind-mount a path as read-only inside the unit: + +`systemctl bind --read-only {{unit}} /{{path/to/host_directory}}` + +- Create the destination path inside the unit before binding: + +`systemctl bind --mkdir {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}}`