Bug in new Dietpi release ? Bug in drive mount ?

My Logitech Media Server is reporting 0 files found in my music directory - a mounted NAS music folder.

I rebooted the Odroid XU4 that has LMS installed on it.

When I go into DietPi drive manager, it does not show the mounted NFS drive. If I “refresh”, it then does show up.

I recently updated DietPi to the latest version so I suppose this might be a bug in the new version ?

At least, the problem is the XU4 does not, in Drive Manager, detect the mounted drives before I “refresh”, and so Logitech Media Server doesn’t either, so it shows my music library as containing 0 songs.

Any feedback or help much appreciated. Thank you!

Hi,

not sure if this is a bug, probably a feature. I did some test and I figured out that the SMB share will be mounted (automatically) as soon as it will be used/accessed

The name of the mount point is “samba” and it is owned by root after the system booted up.

root@DietPi4:/mnt# ls -l
total 12
drwxrwxr-x 6 dietpi dietpi 4096 Jan 10 00:58 dietpi_userdata
drwxr-xr-x 2 root   root   4096 Jan  7 23:35 ftp_client
drwxr-xr-x 2 root   root   4096 Jan  7 23:35 nfs_client
drwxr-xr-x 2 root   root      0 Feb 14  2019 samba
root@DietPi4:/mnt#

As well it’s not showing up in the list

root@DietPi4:/mnt# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        29G  784M   28G   3% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           2.0G   17M  2.0G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           2.0G     0  2.0G   0% /tmp
tmpfs            10M  1.4M  8.7M  14% /DietPi
tmpfs            50M  8.0K   50M   1% /var/log
/dev/mmcblk0p1  253M   54M  199M  22% /boot

as soon as I’m going to access it, it become available

root@DietPi4:/mnt# cd samba
root@DietPi4:/mnt/samba# ls -l /mnt
total 12
drwxrwxr-x 6 dietpi dietpi 4096 Jan 10 00:58 dietpi_userdata
drwxr-xr-x 2 root   root   4096 Jan  7 23:35 ftp_client
drwxr-xr-x 2 root   root   4096 Jan  7 23:35 nfs_client
drwxrwx--- 2 dietpi dietpi    0 Jan  7 02:02 samba

User dietpi is now owning the “samba” directory and it’s appears on the overview

root@DietPi4:/mnt/samba# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/root              29G  784M   28G   3% /
devtmpfs              1.9G     0  1.9G   0% /dev
tmpfs                 2.0G     0  2.0G   0% /dev/shm
tmpfs                 2.0G   17M  2.0G   1% /run
tmpfs                 5.0M     0  5.0M   0% /run/lock
tmpfs                 2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs                 2.0G     0  2.0G   0% /tmp
tmpfs                  10M  1.4M  8.7M  14% /DietPi
tmpfs                  50M  8.0K   50M   1% /var/log
/dev/mmcblk0p1        253M   54M  199M  22% /boot
//192.168.0.10/Share  2.7T  530G  2.1T  20% /mnt/samba

Sorry for the late reply. My Linux knowledge is limited so I don’t really have the capacity to respond to your findings. Thanks for your work, however.

I still insist this is a bug. DietPi did not use to behave like this (Drive Manager used to show all drives including mounted ones without needing the refresh), and the current behaviour is breaking my Logitech Media Server.

To duplicate error:
Mount a NFS or Samba drive in Dietpi Drive Manager.
Specify this folder as the music file folder in Logitech Media Server.
Perform a LMS file scan.
You will have access to all your music files in LMS (under the “Music Folder” tab).

Reboot XU4 (or whatever machine you are using).

Go to your music folder in LMS interface.
It will be reported as empty.
Go to Dietpi Drive Manager. It will not show mounted NFS/Samba drive.
Click Refresh in Dietpi Drive Manager.
It will then show the mounted drive.
Go to LMS, the mounted drive will only appear there after you have done the DietPi Drive Manager refresh, you will have to perform a full media library rescan.

Hope someone familiar with changes done in most recent version of DietPi can add their comments. Thank you.

Hi,
do you use a static IP or DHCP on your device?

pls can you past the output from following command

cat /etc/fstab

pls hide/mask User/Password information

Thank you for the reply. Here is the output from the command as requested. This is with Drive Manager having been “refreshed” and LMS currently running a new scan on the mounted samba drive. I’ve tried changing from a NFS to a Samba mount to see if it makes any difference to my music folder turning up empty in LMS. I also turned off all HDD hibernation etc. on my Synology NAS, where the music folder is.

I use a manually set static IP on all my devices, set through the DHCP server in my Asus router running Merlin firmware.

Thank you for your help.


root@DietPi:~# cat /etc/fstab

Please use “dietpi-drive_manager” to setup mounts

#----------------------------------------------------------------

NETWORK

#----------------------------------------------------------------
//192.168.1.200/music /mnt/samba cifs username=,password=************,ioc harset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=3.0,_netdev, nofail,noauto,x-systemd.automount

#----------------------------------------------------------------

TMPFS

#----------------------------------------------------------------
tmpfs /tmp tmpfs defaults,size=1023M,noatime,nodev,nosuid,mode=1777 0 0
tmpfs /DietPi tmpfs defaults,size=10m,noatime,nodev,nosuid,mode=1777 0 0
tmpfs /var/log tmpfs defaults,size=50m,noatime,nodev,nosuid,mode=1777 0 0

#----------------------------------------------------------------

MISC: ecryptfs, vboxsf (VirtualBox shared folder), bind mounts

#----------------------------------------------------------------


#----------------------------------------------------------------

SWAPFILE

#----------------------------------------------------------------
/var/swap none swap sw 0 0

#----------------------------------------------------------------

PHYSICAL DRIVES

#----------------------------------------------------------------
UUID=3032ee2a-4efc-40b6-9c1f-2839a840144d / ext4 noatime,lazytime,rw 0 1
UUID=F720-0C94 /boot vfat noatime,lazytime,rw 0 2

Hi,
your mount is done with the x-systemd.automount option. This is set by DriveManager and it works by mounting the drive at first access. Means, after reboot, the mount is not there. It just get available as soon as you access the drive.

For testing purposes, you could reboot you system. Using df command you will see, no drive mounted. As soon as you access /mnt/samba the drive should become available.

pls do following for testing:

reboot             <----- reboots your system
df -h              <----- check what is mounted
cd /mnt/samba      <----- access the share
df -h              <----- check again if the share is available
ls -l              <----- show content of the share

Problem seems to have solved itself - the current scan was “stopped unexpectedly” a few hours ago. I updated to latest LMS version as per the instructions. Rebooted the XU4. Re-entering LMS it could now find the samba drive, without needing to go into Dietpi Drive Manager and “refresh”, and I restarted a new LMS library scan. Hopefully it sticks this time. Thanks for your help :slight_smile:

(Logitech Media Server Version: 7.9.2 - 1578996832 @ Tue Jan 14 12:16:57 CET 2020)

Yes that’s how it should work. As soon as LMS is trying to access the share, it will be mounted.

Do you think Synology NAS hdd/system hibernation features could prevent this ? I’d like to keep these hibernation features on since, let’s face it, 99.99% of the time you’re not using your NAS, but I’ve turned all these off now to prevent the “0 files” in Music Folder in LMS problem.

I did a simple cron job that would touch a file on the drive every minute to keep the drive awake

well if you would create such a cron job, it would basically mean to deactivate Synology hibernate function.

Isn’t it possible to disable hibernate in Synology directly? E.g. for local drives one could simply disable idle timeout via dietpi-drive_manager (hdparm / /etc/hdparm.conf), instead of having an idle timeout enabled but then making it ineffective via cronjob/systemd timer or such…

Yes you can disable hibernate function in DSM directly. But echable would like to keep the hibernate option active to same power as the NAS is not used all the time.

Question is, what happen if the Synology is going into Hibernate mode. Will DietPi loose the connection? Will the connection be reestablished once used?

I will do a test over night and mount my Synology CIFS(SMB) Share to my RPi3B+. Let’s see how it looks like tomorrow.

So my RPi was running whole night with a mounted share from my Synology. I have seen that my Synology disk was going to hibernate without issues. The share was still mounted on the RPi. It did not get lost. Access was still possible this morning. I did not find any issues in journalctl regarding the mount.

Bottome line. A mounted Synology Share is not preventing the Hibernate Mode as well as it stays connected/accessible on DietPi.