Some network drives don't survive a reboot

Creating a bug report/issue

I’ve entered a lot of network drive to mount in my install, but it seems most of them won’t survive a reboot. Using drive manager, only two of them get back. I can manually readd everything else, but they just won’t survive a reboot.

Required Information

  • DietPi version
  • Distro version | bullseye
  • Kernel version | Linux lab 5.10.0-16-amd64 #1 SMP Debian 5.10.127-1 (2022-06-30) x86_64 GNU/Linux
  • SBC model | Native PC (x86_64)
  • Power supply used | What came with the NUC
  • SD card used | SSD with the NUC

Additional Information (if applicable)

  • I’ve been having this on multiple version of DietPi, I was just too lazy to come and seek help before :sweat_smile:

Steps to reproduce

Add drives, reboot, see if they stick.

Expected behaviour

Drives should be automounting.

Actual behaviour

It seems that my first two entries can survive a reboot. But I’ve added a lot more via dietpi-drivemanager, and all of them are in the fstab file.

Drives are mounted as soon as a process is trying to access the. We don’t mounted them during boot already. Means they are mounted on-demand. Did you tried to access the share? As well you can check the /etc/fstab file after a reboot if the drives are still configured.

Did you tried to access the share?

I did. That’s actually how I found this behavior in the first place, after a powerloss, I went on and tried to cast some things from Plex on my TV, and it said that the file didn’t exist, so I went on and proceeded to add the corresponding network share and instantly, Plex could read the files. Maybe the Plex process on the server (which I’m accessing via a Chromecast) doesn’t trigger the mounting process ?

Did you tried to access the share? As well you can check the /etc/fstab file after a reboot if the drives are still configured

For good measure, I went on and rebooted. All of the network drives are present in /etc/fstab. Going into drivemanager, it shows only two of them. cd into one of the mount point in /mnt/ and trying to list files shows nothing. If I go to drive manager to re-add the same paths, then list the files in the folder they appear.

BUT. I think I might know why it is happening, you will probably be able to confirm this:

Going into drivemanager > network drive > NFS > entering the IP will give me me choices that I’m assuming comes from the NFS server, and it says that the two I see always “automounting” are already mounted.

The thing is: the drives that I don’t see mounting are subfolders of one of the share that is indeed on that list. Could it be then that they’re not getting mounted automatically because they’re just subfolders of a share that the NFS server gives? They are all in the form of, for example, 192.168.X.X:/volume1/video/Documentaries /mnt/nas_documentaries nfs nofail,noauto,x-systemd.automount.

I did some testing and indeed it seems to be an issue is with the sub folder. Looks like NFS don’t like this. I guess you would need to create on NFS server side direct exports for the folder you like to mount.

I guess setting up video without sub folder will work

192.168.X.X:/volume1/video/ /mnt/nas_video nfs nofail,noauto,x-systemd.automount

But there is no DietPi magic on this behaviour as we don’t have any influence in this., should be standard Linux. The only thing drive manager is doing, is to create the /etc/fstab

Maybe you could have a look as well

Not sure whether mounting NFS subfolders aside of their parents may cause issues, but I wonder whether you actually aim to mount them separately instead of accessing them just via their parents? A symbolic link would be less overhead if you want a shortcut.

EDIT: Ah, they’re no separate exports but you indeed try to mount a sub directory of a single export on the NFS server?

Ah, they’re no separate exports but you indeed try to mount a sub directory of a single export on the NFS server?

Basically yes. In the end, the NAS (Synology) has a video folder for everything video, and it is that folder that I opened up for sharing.

That being said, you are right, now that we kind of know that the subfolders are problematic in my case, I will just have to not try to mount them at all, and just mount the parent video folder. I’ll instruct Plex to go find the right folder by itself. Having different folder/share inside of it is just a weird artifact from an old setup that I copied for symplicity sake back then.

And yeah, we can consider this thread closes. Trying to mount only the parent folder which is sent by the NFS server, it works like a charm!

1 Like