Issues mounting SMB share via systemd mount. Contains a symlink?

Not sure if immutable specific, user error or lack of knowledge.. I have not yet created the automount, as I am trying first verify systemd mounts. When I test cifs, mounts and is writable as expected, so smbcred and addresses are being loaded correctly -
sudo mount -t cifs //192.xxx.xx.xxx/media /home/xxxx/xxxx/media -o rw,uid=1000,gid=1000,credentials=/home/xxxx/.sambacreds
sudo mount -t cifs //192.xxx.xx.xxx/media /home/xxxx/xxxx/media -o rw,uid=1000,gid=1000,credentials=/home/xxxx/.sambacreds
I have the following in sytstemd/system/home-xxxx-xxxx-media.mount
Description=Mount SMB share
# We require network connection before proceeding.
Requires=network-online.target
After=network-online.target systemd-resolved.service
Wants=network-online.target systemd-resolved.service

[Mount]
# "What" is what will be mounted. ie our NAS SMB share
# PUT YOUR SMB IP ADDRESS! (the // is important, don't change it)
What=//192.xxx.xx.xxx/media
# "Where" is where it will be mounted in the filesystem
Where=/home/xxxx/xxxx/media/
Type=cifs
# Let the mounted filesystem be read/write-able
# Let the mounted filesystem be owned by the 'deck' user/group
# Use the specified credential file for the connection
Options=rw,uid=1000,gid=1000,nofail,credentials=/home/xxxx/.sambacreds
# Lets quit trying after 30 seconds
TimeoutSec=30

[Install]
WantedBy=multi-user.target
Description=Mount SMB share
# We require network connection before proceeding.
Requires=network-online.target
After=network-online.target systemd-resolved.service
Wants=network-online.target systemd-resolved.service

[Mount]
# "What" is what will be mounted. ie our NAS SMB share
# PUT YOUR SMB IP ADDRESS! (the // is important, don't change it)
What=//192.xxx.xx.xxx/media
# "Where" is where it will be mounted in the filesystem
Where=/home/xxxx/xxxx/media/
Type=cifs
# Let the mounted filesystem be read/write-able
# Let the mounted filesystem be owned by the 'deck' user/group
# Use the specified credential file for the connection
Options=rw,uid=1000,gid=1000,nofail,credentials=/home/xxxx/.sambacreds
# Lets quit trying after 30 seconds
TimeoutSec=30

[Install]
WantedBy=multi-user.target
The result:
systemctl status home-xxxx-xxxx-media.mount
× home-xxxx-xxxx-media.mount - Mount SMB share
Loaded: loaded (/etc/systemd/system/home-xxxx-xxxx-media.mount; enabled; preset: disabled)
Active: failed (Result: resources)
Invocation: e67758bxxxxxxxxxxxxxx764a6a5e0
Where: /home/xxxx/xxxx/media
What: //192.xxx.xx.xxx/media

Feb 02 13:29:02 bazzite systemd[1]: home-xxxx-xxxx-media.mount: Mount path /home/xxxx/xxxx/media is not canonical (contains a symlink).
Feb 02 13:29:02 bazzite systemd[1]: home-xxxx-xxxx-media.mount: Failed with result 'resources'.
Feb 02 13:29:02 bazzite systemd[1]: Failed to mount home-xxxx-xxxx-media.mount - Mount SMB share.
systemctl status home-xxxx-xxxx-media.mount
× home-xxxx-xxxx-media.mount - Mount SMB share
Loaded: loaded (/etc/systemd/system/home-xxxx-xxxx-media.mount; enabled; preset: disabled)
Active: failed (Result: resources)
Invocation: e67758bxxxxxxxxxxxxxx764a6a5e0
Where: /home/xxxx/xxxx/media
What: //192.xxx.xx.xxx/media

Feb 02 13:29:02 bazzite systemd[1]: home-xxxx-xxxx-media.mount: Mount path /home/xxxx/xxxx/media is not canonical (contains a symlink).
Feb 02 13:29:02 bazzite systemd[1]: home-xxxx-xxxx-media.mount: Failed with result 'resources'.
Feb 02 13:29:02 bazzite systemd[1]: Failed to mount home-xxxx-xxxx-media.mount - Mount SMB share.
Out of brain power...
5 Replies
uba2615
uba2615OP4d ago
I noticed the following -
sudo systemctl enable --now home-xxxx-xxxx-media.mount
Created symlink '/etc/systemd/system/multi-user.target.wants/home-xxxx-xxxx-media.mount' → '/etc/systemd/system/home-xxxx-xxxx-media.mount'.
sudo systemctl enable --now home-xxxx-xxxx-media.mount
Created symlink '/etc/systemd/system/multi-user.target.wants/home-xxxx-xxxx-media.mount' → '/etc/systemd/system/home-xxxx-xxxx-media.mount'.
ls -l /home/xxxx/xxxx
total 0
drwxr-xr-x. 1 xxxx xxxx 0 Feb 2 12:34 media
ls -l /home/xxxx/xxxx
total 0
drwxr-xr-x. 1 xxxx xxxx 0 Feb 2 12:34 media
HikariKnight
HikariKnight4d ago
use the canonical path /var/home instead of /home this is a fedora atomic thing as /home is symlinked to /var/home
uba2615
uba2615OP4d ago
palming my head!
HikariKnight
HikariKnight4d ago
this is because / is read only while /var is not so to avoid making a complex solution they just make a symlink that goes to a writable location
uba2615
uba2615OP4d ago
Perfect solution, missed it right infront of me

Did you find this page helpful?