anonymouse@lemmings.worldOPtoSelfhosted@lemmy.world•Server Configuration UpdateEnglish
1·
10 months agoI’ll look up the exact info when I get home and provide links if I can find them again.
The summary is that I had to add a line to /etc/fstab with the ip and folder route of the nas drive and folder, then the mount point in linux, the file system type for the mount, options that give login creds/group id + establish permissions I want to apply to the mount, and an option that keeps the drive from trying to mount until my network is connected.
Finally, for that last option to work, I had to enable a process that I forget the name of. I think it was in systemd, but I was able to initiate it from the command line.
Since I don’t know your level of expertise, I’ll go step by step. Forgive me if you already know how to do some of this.
In terminal, type “sudo nano /etc/fstab” (without quotes). This brings up a file where you can add the mount point so it mounts at boot and set options for the mount. Go to the end of the file and enter a line like the following, substituting your info in the appropriate places:
//[static ip for nas]/[top level folder on nas you want to mount] /[mount point in Linux] [file system type for mount] [mount options, nas login credentials, permissions] 0 0
Mine looks like this: //192.168.1.0/Media /mnt/Media cifs _netdev,user=anonymouse,password=*****,uid=1000,file_mode=0777,dir_mode=0777 0 0
The “_netdev” option is the one that delays the mount until after your network is up. The “file_mode” & “dir_mode” set the mount permissions. There is info out there showing how to insert a reference to a credentials file instead of placing them in fstab in plain text, but I didn’t bother since I have my computer and user profile pretty well locked down.
To get _netdev to work, I had to enter the following in terminal (without quotes): “sudo systemctl enable systemd-networkd-wait-online”.
I couldn’t find all the sites I visited while setting this up, but here are a few:
https://unix.stackexchange.com/questions/98707/how-do-i-mount-a-cifs-share-so-i-can-fully-control-the-mounted-volume-on-the-cli
https://unix.stackexchange.com/questions/429604/fstab-not-automatically-mounting-smb-storage?rq=1
https://help.ubuntu.com/community/Fstab#Options
Hope this helps!