RE: [IDEA] allow sshfs mount remote storage - Phil35 - 01-23-2023
(01-21-2023, 05:24 PM)TheOldPresbyope Wrote: (01-21-2023, 03:59 PM)Phil35 Wrote: Hi Kent,
Ok
Tested.
1/ remote directory mounted via sshfs on /mnt/SDCARD/SSHFS.
Musics are there, files and directories are there ...
If you don't show details, I can only make guesses. What was the exact command you entered to mount the directory and how did you determine things "are there"? My first guess is that you have incorrect permissions on directories and/or files.
Quote:update library sees nothing more
I have click on "clear library tag cache" "regenerate thumbnail"
I may read on the webpage "View Status" the scan is running ok in /mnt/SDCARD/SSHFS/........
I may read a correct result with moodeutl -t
Code: 20230121 164828 mpdindex: Done: indexed 1 artists, 1 albums, 1 songs
20230121 164828 worker: Job update_library done
20230121 164839 thumb-gen: Done: 1333 folders scanned, 0 thumbs created, 1333 already in cache
However nothing better the webpage still shows only "Stereo Test"
This snippet of output from moodeutl reinforces my guess since there appears that only one album and track are found in this scan---e.g., the Stereo Test---and that your thumbnail cache already contained 1333 thumbs with no new ones added.
Quote:2/ umount /mnt/SDCARD/SSHFS
copying some music files localy in /mnt/SDCARD/SSHFS, update library and music is there
Good the webpage shows now two entries "SSHFS" and "Stereo Test" , entering SSHFS, music is there and can be played.
...
fyi: I found a problem but nothing to deal with moode, got these errors messages, problem with around 20 files themselfves
Code: 20230121 164413 thumb-gen: Scanning: NAS, SDCARD
20230121 164424 thumb-gen: Error: File does not contain ID3v2 tag:
This last tells you that MPD can't find metadata to index in these files (I suppose they are MP3 files). That's a problem for Album and Tag views but these files should still show up in the Folder view, just not nicely tagged.
ETA - oops - Obviously this error message relates not to MPD but to the thumbnail generator script which, among other things, checks for coverart which may be embedded in ID3v2 metadata. Still not a problem for the Folder view.
You can use mpc from the command line to explore the MPD database and status.
- Try mpc help to see what the commands are.
- mpc stats is a start
Candidly, I'm running out of time to spend on this. It's clear in tests I've run that sshfs is viable for remotely mounting music directories in moOde when configured properly. Now we're down into more mundane problems. For a start, see the MPD documentation, especially the subsection "I can’t see my music in the MPD database."
Good luck.
Regards,
Kent
Thank you Kent, for your time and advises, I appreciate a lot. I discover the mpc command, great!
Following your advise, I found the solution.
Now sshfs command works perfectly to mount remote directories from a NAS synology and from a remote directory on another rapsberry, to say with other words using sshfs command:
- mount a remote NAS directory to raspberry moode system: Ok
- mount a remote raspberry directory to raspberry moode system: Ok (so yes between two raspberry)
Problem is what you suspect: about rights.
Solution is to use -o allow_other with the sshfs command
How do I found?
modifying the line in /etc/passwd
from
mpd:x:114:29::/var/lib/mpd:/usr/sbin/nologin
to
mpd:x:114:29::/var/lib/mpd:/bin/bash
so I can connect as mpd user
Code: root@moode:/mnt# su - mpd
mpd@moode:~$ cd /mnt/SSHFS
-bash: cd: /mnt/SSHFS: Permission denied
mpd@moode:~$ cd /mnt
mpd@moode:/mnt$ ls -larlt
ls: cannot access 'SSHFS': Permission denied
total 16
d????????? ? ? ? ? ? SSHFS
drwxr-xr-x 18 root root 4096 Jun 30 2022 ..
drwxr-xr-x 4 mpd audio 4096 Jan 19 13:43 SDCARD
drwxr-xr-x 3 mpd audio 4096 Jan 21 16:56 NAS
drwxr-xr-x 5 root root 4096 Jan 22 11:24 .
using root no question mark and the display is correct
found the right command to use:
Code: sshfs -o allow_other user@ipaddress:music /mnt/SSHFS
the option allow_other solves the issue
Results:
first line: default when mounting remote NAS directory is done with moode
second line : the same with sshfs
third line: a remote directory on a another raspberry is mounted localy with sshfs
Code: df -H | grep music
//192.168.6.237/music 3.0T 2.1T 898G 70% /mnt/NAS/NAS
philippe@192.168.6.237:/music 3.0T 2.1T 898G 70% /mnt/SDCARD/SSHFS
phermes@192.168.6.17:music 126G 8.3G 113G 7% /mnt/SSHFS
So back to the intial post: feature request allow sshfs command to mount remote storage
moode is also now updated to the latest version: 8.2.5-1
Thanks again and have a good day
Phil
|