Skip to content

Commit 2e7803b

Browse files
TheRootDaemonSpikeTheDragon40kManagor
authored
systemctl-mount-image: add page (#19765)
Co-authored-by: Adriano Inghingolo <68734231+SpikeTheDragon40k@users.noreply.github.com> Co-authored-by: Managor <42655600+Managor@users.noreply.github.com>
1 parent cf75b6d commit 2e7803b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# systemctl mount-image
2+
3+
> Mount an image file into a unit's mount namespace.
4+
> Only supported for the units that run within a mountspace ie, with `RootImage=`, `PrivateMounts=`, etc.
5+
> More information: <https://www.freedesktop.org/software/systemd/man/systemctl.html#%0A%20%20%20%20%20%20%20%20%20%20%20%20mount-image%0A%20%20%20%20%20%20%20%20%20%20%20%20UNIT%0A%20%20%20%20%20%20%20%20%20%20%20%20IMAGE%0A%20%20%20%20%20%20%20%20%20%20%20%20%5BPATH%0A%20%20%20%20%20%20%20%20%20%20%20%20%5BPARTITION_NAME:MOUNT_OPTIONS%5D%5D%0A%20%20%20%20%20%20%20%20%20%20>.
6+
7+
- Mount an image at a specific path inside the unit's mount namespace:
8+
9+
`systemctl mount-image {{unit}} /{{path/to/image}} /{{path/to/directory_inside_unit}}`
10+
11+
- Mount the image’s `root` partition with read-only and no-setuid options:
12+
13+
`systemctl mount-image {{unit}} /{{path/to/image}} /{{path/to/directory_inside_unit}} root:ro,nosuid`
14+
15+
- Create the destination directory before mounting:
16+
17+
`systemctl mount-image --mkdir {{unit}} /{{path/to/image}} /{{path/to/directory_inside_unit}}`
18+
19+
- Mount an image as read-only:
20+
21+
`systemctl mount-image --read-only {{unit}} /{{path/to/image}} /{{path/to/directory_inside_unit}}`

0 commit comments

Comments
 (0)