Skip to content

Commit 859fdf0

Browse files
author
Patrick M
committed
fix: file path
1 parent ba7693f commit 859fdf0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

_posts/2025-07-07-systemd-remounting-service-.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags: [ "lxc", "systemd", "high availablity", "setup" ]
88

99
![Tiny workers remounting hard drives in computers](/assets/img/systemd-remounting-service/header.png)
1010

11-
In `systemd`, you can create an remount unit to ensure share stay mounted. This would work perfectly, except, LXC does not support this `systemd` unit. So instead I created a service that runs a script, and a timer to trigger it. Like a cron, but still using `systemd`.
11+
In systemd, you can create an remount unit to ensure share stay mounted. This would work perfectly, except, LXC does not support this systemd unit. So instead I created a service that runs a script, and a timer to trigger it. Like a cron, but still using systemd.
1212

1313
It works by adding a file named `unmounted` to the mount folder anchor. When the share is unmounted, this file will be visible. We can test for the file and remount when it's found.
1414

@@ -48,6 +48,7 @@ WantedBy=timers.target
4848
Now we can create the service unit to the same directory.
4949

5050
```bash
51+
cd /etc/systemd/system
5152
nano remount-share.service
5253
```
5354

@@ -67,9 +68,9 @@ ExecStart=/root/remount-share.sh
6768
We can add the script to the root home directory. I like to put it here because system should be able to access it, and it exists alongside the credentials file.
6869

6970
```bash
70-
touch /home/root/remount-share.sh
71-
chmod +x /home/root/remount-share.sh
72-
nano /home/root/remount-share.sh
71+
touch /root/remount-share.sh
72+
chmod +x /root/remount-share.sh
73+
nano /root/remount-share.sh
7374
```
7475

7576
```bash

0 commit comments

Comments
 (0)