Connecting net drive Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
tenoritiger
Posts: 9
Joined: Sat Mar 09, 2019 9:24 am

Connecting net drive

Post by tenoritiger »

Hello.
I've searched for an answer but didn't find any working solution.
Here's my problem:
Mounting net drive.png
I'm currently trying to play music from my network drive on DietPi with O!MPD. I've managed to add it to /mnt/ directory using PuTTY (the size is - 0 and maybe it's the main trouble). Now it looks like this:
(pic 1)
But in O!MPD can't see any of music files on my net drive. All the tracks in /dietpi-userdana/ folder are working perfect...
(pic 2)
MC is showing all my folders and files on this drive with no problem:
(pic 3)
I don't know how to make it work...
Could someone help me or point in right direction?
DietPi version - 6.21 running on Sparky SBC.

Thanks.
User avatar
MichaIng
Site Admin
Posts: 2281
Joined: Sat Nov 18, 2017 6:21 pm

Re: Connecting net drive

Post by MichaIng »

The mpd user requires permissions to that files.

Try:

Code: Select all

chown -R mpd:dietpi /mnt/XiaoMi-usb0
chmod -R 775 /mnt/XiaoMi-usb0
tenoritiger
Posts: 9
Joined: Sat Mar 09, 2019 9:24 am

Re: Connecting net drive

Post by tenoritiger »

Hello.
Thank You for reply.
With USB0 - cannot access.
With usb0 - it takes some time to think but in O!MPD still nothing (no luck even after reboot)... Am I doing something wrong?
User avatar
MichaIng
Site Admin
Posts: 2281
Joined: Sat Nov 18, 2017 6:21 pm

Re: Connecting net drive

Post by MichaIng »

Ah yep wrong capitalisation, I edited my post above.

Hmm which file system is XiaoMi-usb0?

Lets check actual permissions:
ls -al /mnt/XiaoMi-usb0/ | head
tenoritiger
Posts: 9
Joined: Sat Mar 09, 2019 9:24 am

Re: Connecting net drive

Post by tenoritiger »

USB-drive - NTFS
USB-drive is connected to my Xiaomi router. There's no trouble with mounting in my 2 other Linux systems (Volumio and TinyMPD/Fatboy)
mnt3.JPG
User avatar
MichaIng
Site Admin
Posts: 2281
Joined: Sat Nov 18, 2017 6:21 pm

Re: Connecting net drive

Post by MichaIng »

Okay NTFS allows permissions via some running service. Can you check htop if you see the "ntfs" related service running there?

But the permissions still look wrong:

Code: Select all

chown -R mpd:dietpi /mnt/XiaoMi-usb0
chmod -R 775 /mnt/XiaoMi-usb0
ls -Al /mnt/XiaoMi-usb0/ | head should then show lines like
drwxrwxr-x mpd dietpi ...
tenoritiger
Posts: 9
Joined: Sat Mar 09, 2019 9:24 am

Re: Connecting net drive

Post by tenoritiger »

Looks like this:
mnt4.JPG
Attachments
htop.JPG
User avatar
MichaIng
Site Admin
Posts: 2281
Joined: Sat Nov 18, 2017 6:21 pm

Re: Connecting net drive

Post by MichaIng »

Ah the NTFS permissions workaround is not in place. You didn't mount the drive via dietpi-drive_manager, did you?

Please do:
G_AGI ntfs-3g
And in your /etc/fstab add ,permissions to the mount options of the NTFS drive.

Then redo the chown/chmod commands.

At best also update to the v6.22 Beta that was just released: https://github.com/MichaIng/DietPi/issues/2632
It includes a fix for MPD and permissions, although that is not related to your issue. It (re)allows MPD to access not only to dietpi owned files but also to some audio related kernel/interfaces.
tenoritiger
Posts: 9
Joined: Sat Mar 09, 2019 9:24 am

Re: Connecting net drive

Post by tenoritiger »

Hm...
I've added drive with drive manager. I've used this:
fstab.JPG
d-manager.JPG
G_AGI ntfs-3g - done
/etc/fstab - Permission denied
I can access it with mc but I don't know what to do in this file. Is it correct file?
I'm just newbie in all this, sorry.
User avatar
MichaIng
Site Admin
Posts: 2281
Joined: Sat Nov 18, 2017 6:21 pm

Re: Connecting net drive

Post by MichaIng »

Ah sorry now I got it: It's a network drive. Sorry didn't understand correctly at first (lol even that the topic as "net drive"). Okay this is mounted correctly already then with user dietpi and 770 mode.

Okay please verify that MPD runs as group dietpi which allows access permissions:
grep -i 'group' /etc/mpd.conf
Or as said update to new Beta to assure that as well.

And then I am not sure if MPD itself has limited access to the music dir assigned in /etc/mpd.conf so O!MPD cannot access to outside of this.
In case you need to adjust /etc/mpd.conf to have:

Code: Select all

music_directory "/mnt"
playlist_directory "/mnt"
So all mounts are included. I am not sure if O!MPD GUI does such automatically when adding drives there. At least worth a try to verify this.
Post Reply