You are not logged in.

#1 2020-01-04 11:39:28

Archlinuxomane
Member
Registered: 2012-05-18
Posts: 19

[Solved] systemd-automount of cifs in fstab - wrong permissions

Hi there,

I want to automatically mount a smb-folder upon boot using systemd-automount in my fstab but I can't get it to have the proper permissions - it's always owned by root, and I can't change that. I want it to be owned by my user (uid=1000,gid=1000). When the mount is not active, the target folder is owned by my user. When manually mounting the folder using "sudo mount folder", the mounted folder is owned by my user.

This is my first time using systemd for mounting.

this is my fstab entry:

//server/folder   /home/user/folder   cifs   auto,nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10,uid=1000,gid=1000,credentials=/home/user/.config/sambacreds   0   0

Last edited by Archlinuxomane (2020-01-04 22:30:10)

Offline

#2 2020-01-04 15:56:33

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,808

Re: [Solved] systemd-automount of cifs in fstab - wrong permissions

Are you married to that solution?  Creating a unit file is a better solution in my experience.
https://wiki.archlinux.org/index.php/Sa … stemd_unit


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2020-01-04 20:22:05

seth
Member
Registered: 2012-09-03
Posts: 51,970

Re: [Solved] systemd-automount of cifs in fstab - wrong permissions

auto,…,x-systemd.automount

Not sure what's the idea behind that but try
=>

noauto,…,x-systemd.automount

to have systemd mount the share on access.

Last edited by seth (2020-01-04 20:22:20)

Online

#4 2020-01-04 22:29:23

Archlinuxomane
Member
Registered: 2012-05-18
Posts: 19

Re: [Solved] systemd-automount of cifs in fstab - wrong permissions

Not sure why, but using a unit file gives the correct permissions. Thanks!

Offline

Board footer

Powered by FluxBB