I have a network drive with a brtfs filesystem (Synology NAS) that I have configured to automount via the fstab. If I want to transfer files to it from EndeavourOS (ext4), I have to open the drive’s folder as administrator and enter my root password, which isn’t a big deal. I usually transfer large files onto it that take an hour or more to complete. During any of these file transfers, I will get prompted to enter the root password every five minutes or so until the operation is complete. If I’m not present at my computer, the file transfer will just pause until I come back and enter my password. I’ve tried to search the web and forums for a solution but I haven’t found anything at all. Do I just have to live with this or is there anything I can do?
Noob here so no idea if these are suitable for you or even valid:
You can set up sudo to not require a password for specific commands, and you can build a specific command to move all contents of a specific folder to another specific folder. Sudoers, visudo, and NOPASSWD are keywords for your research.
Alternatively you can change the timeout period for sudo via “timestamp_timeout”, but apparently it maxes out at 99min. You could set it to 99min before you start your file transfer and then change it back when it’s done.
The first DS223j is the actual network drive that needs mounting, the second one is the directory in EndeavourOS that the drive will automatically mount in
smb://YOUR-SYNO/DS223j in your file browser (Dolphin, Thunar, etc)
cifs-utils (see below)
You should at least use the _netdev mount option to ensure the system waits for the network to be available before attempting to mount the share, as well as uid & gid so that the mounted files have the correct ownership.
“I have to open the drive’s folder as administrator and enter my root password”? That’s not been necessary in my experience with Synologys, perhaps a permission issue, are you mounting the Syno share in your local userhome (~/DS223j) or somewhere outside it that your don’t explicitly have permissions/ownership (/DS223j)?
cifs-utils may be installed in your EnOS (if not, yay cifs-utils), try mounting your share using this, first create the DS223j folder in your user home, replace the SYNO values with the relevant values, then paste into your terminal & hit enter:
sudo mount -t cifs -o username=SYNO_USERNAME,uid=SYNO_USERNAME,gid=SYNO_USERNAME //YOUR-SYNO/DS223j ~/DS223j/
The uid & gid options ensure that the mounted files have the correct ownership.
Also, using smb:// protocol in the address bar of your file browser should allow for access & storing credentials (temporarily or permanently), here’s a screenshot from Thunar:
The latter 2 methods both have the significant advantage of not storing your Syno credentials in plain text, which is pretty dope if you’re a credential or user of one.
//smb share ip/folder i want to automount /folder in endeavouros with same name as the folder on the network drive
I have other entries for other drives as well and they all work perfectly fine. I just discovered that the mountpoint is owned by root. But if I go into the NAS directly instead of through the mountpoint folder then that is not the case.
Since you asked, I checked the mountpoint for my drive and it was indeed owned by root. It has always showed the actual drive (not root owned) and the mountpoint for it in network locations, so I thought maybe I don’t even need the fstab entry. I uncommented the entry in the fstab and rebooted and the drive is still available in my file manager without having to log back into it.
When I made the fstab entry initially, I had just accessed that drive from endeavouros for the first time so I didn’t consider that maybe it would just automatically be there after a reboot after providing credentials the first time. After all, I did have to create mountpoints for the other physical drives in my computer. Anyways, accessing the drive directly lets me do any file operations without needing to enter root password at all.