I've just moved over to Linux (Ubunutu 18.04) from Windows.
I have a WDNAS which I have mounted and works fine here.
mkdir mnt/NAS
sudo nano /etc/fstab
//192.168.1.17/wd_nas mnt/wdnas cifs credentials=/home/ubuntu/login.cred,uid=1000,gid=1000 0 0
Running sudo mount -a
mounts as expected and I can see the share fine. It also appears in the gui Nautilus file manager.
The issue is, after a reboot the mount appears to have gone. It doesn't appear in file manager. It only works when run sudo mount -a
.
df -h
shows it mounted. //192.168.1.17/wd_nas 3T 1.2T 1.5T 30% /mnt/wd_nas
cat /var/log/syslog/ |grep wd_nas
Mar 6 20:51:22 ubuntu systemd[1]: Mounting /mnt/wd_nas
Mar 6 20:51:22 ubuntu systemd[1]: Mounted /mnt/wd_nas
If I run ls -la /mnt/wd_nas
I can see the files I have placed there as test but if I navigate via the gui (nautilus file manager) I can't see anything?
So my first assumption was permissions but I checked and confirmed. Directories and all subs are chown to user with rw access. Googling frantically for days, I've tried almost everything I could find. Even topics relating the network not booting before fstab is being run, so adding _netdev and even configuring systemd. I've even tried to create a bash script to sleep for 20s and run mount -a via cron at reboot. Nothing! Although it doesn't at all appear to be related.
Now I'm here. Would you be able to help?
I've figure it out after a painful week.
fstab was creating the mount point at
/mnt
which i believe is the root dir. So that is whydf -h
was showing it mounted, as it was, just elsewhere.Was -
//192.168.1.17/wd_nas mnt/wdnas
Now -
//192.168.1.17/wd_nas /home/user/mnt/wdnas
Found this definition here in this forum..
"Using the /mnt directory should only work if the drive is a local volume rather than a network share or removable device."
Apologies, i'm new to Linux.
On my UBUNTU 18.04 server and for my Synology NAS i have create 2 files script :
after install
The first:
the second :
all are OK for a backup.shell script for test use