# Mopidy scan USB not successful

**URL:** <https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722>\
**Category:** Misc\
**Created:** [February 3, 2021, 12:29pm UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722 "2021-02-03T12:29:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uniquegch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/uniquegch/32/1937_2.png) [@Uniquegch](https://discourse.mopidy.com/u/Uniquegch)\
**Post date:** [February 3, 2021, 12:29pm UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722/1 "2021-02-03T12:29:07Z")

</div>

I have setup for me a new Raspi 3 with Debian Buster following that [article](https://magpi.raspberrypi.org/articles/make-a-raspberry-pi-audio-player-with-mopidy-music) .  
Everything works, but scanning music files on USB stick having problems.

Here is the result when running mopidy -v local scan

Found 0 files in file:// **/home/pi/Music**

The path file:///home/pi/Music is wrong.

it should be **/media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058**

Where do I enter the path in the correct way?  
I did enter it in the /etc/mopidy/mopidy.conf file adding [file] and [local].

Thanks

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [February 3, 2021, 1:14pm UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722/2 "2021-02-03T13:14:04Z")

</div>

Assuming you are running as a service (I have not read that article):  
[https://docs.mopidy.com/en/latest/running/service/](https://docs.mopidy.com/en/latest/running/service/)

```auto
sudo mopidyctl local scan

```

---

<div class="post-metadata">

**Author:** ![Uniquegch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/uniquegch/32/1937_2.png) [@Uniquegch](https://discourse.mopidy.com/u/Uniquegch)\
**Post date:** [February 3, 2021, 1:57pm UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722/3 "2021-02-03T13:57:34Z")

</div>

thanks for the quick reply.  
Yes I run it as a service.

What I have to know now is one thing.

I have a USB Stick with the following path /media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058  
user:group is pi:pi  
permissions 777

I have modified the entry in ~/.config/user-dirs.dirs **XDG\_MUSIC\_DIR="/media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058"**

My question:  
what do I have to enter in the /etc/mopidy/mopidy.conf under

[local]  
media\_dir = ??? ← I would put in /media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058

[file]  
enabled = true  
media\_dirs = ??? ← I would put in $XDG\_MUSIC\_DIR do I need |Music and ~/|Home

When I run sudo mopidyctl local scan I am getting an error Permissions denied 13 even that I changed the owner to mopidy.

sudo mopidyctl local scan  
Running “/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf local scan” as user mopidy  
INFO [MainThread] mopidy. **main** Starting Mopidy 3.1.1  
INFO [MainThread] mopidy.config Loading config from builtin defaults  
INFO [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy.conf  
INFO [MainThread] mopidy.config Loading config from file:///etc/mopidy/mopidy.conf  
INFO [MainThread] mopidy.config Loading config from command line options  
INFO [MainThread] mopidy. **main** Enabled extensions: http, stream, iris, file, mpd, musicbox\_webclient, local, somafm, softwaremixer, m3u  
INFO [MainThread] mopidy. **main** Disabled extensions: none  
INFO [MainThread] mopidy\_local.commands Finding files in file:///media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058 …  
INFO [MainThread] mopidy\_local.commands Found 0 files in file:///media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058  
WARNING [MainThread] mopidy\_local.commands Encountered 1 errors while finding files in file:///media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058  
WARNING [MainThread] mopidy\_local.commands Error for file:///media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058: (‘Permission denied’, 13)  
INFO [MainThread] mopidy\_local.commands Checking 0 tracks from library  
INFO [MainThread] mopidy\_local.commands Removing 0 missing tracks  
INFO [MainThread] mopidy\_local.commands Found 0 tracks which need to be updated  
INFO [MainThread] mopidy\_local.commands Scanning…  
INFO [MainThread] mopidy\_local.commands Scanned 0 of 0 files in 0.000s.  
INFO [MainThread] mopidy\_local.commands Done scanning  
INFO [MainThread] mopidy\_local.storage Cleaning up image directory

---

<div class="post-metadata">

**Author:** ![Uniquegch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/uniquegch/32/1937_2.png) [@Uniquegch](https://discourse.mopidy.com/u/Uniquegch)\
**Post date:** [February 3, 2021, 3:57pm UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722/4 "2021-02-03T15:57:51Z")

</div>

If I run “mopidy -v local scan”, it is scanning but when I work with Iris or musicbox\_webclient it does not show me any music. is the command used for mopidy-local or when running mopidy not as a service?

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [February 3, 2021, 4:44pm UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722/5 "2021-02-03T16:44:20Z")

</div>

> [@Uniquegch](#):
>
> user:group is pi:pi  
> permissions 777

Did you mount the drive with those permissions? Or did you randomly set those permissions on the mountpoint? Does the drive format support unix file permissions? Mopidy’ as a service run as the user `mopidy` and needs to be able to read the contents of the directory you have asked it to scan. I don’t want to debug how to correctly mount a drive in Linux, can you please make sure the `mopidy` user can access all the files, A really simple test of that would be:

```auto
sudo -su mopidy ls /media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058/

```

> I have modified the entry in ~/.config/user-dirs.dirs **XDG\_MUSIC\_DIR=“/media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058”**

OK, but this won’t help when running Mopidy as a service.

> [local]  
> media\_dir = /media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058

This looks fine.

> [file]  
> media\_dirs = ??? ← I would put in $XDG\_MUSIC\_DIR do I need |Music and ~/|Home

I wouldn’t. If I was already using the Local backend I wouldn’t also use the File backend for the same music. What benefit would that provide? If I did want to do that for some reason then I would set

```auto
media_dirs = /media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058

```

> [@Uniquegch](#):
>
> When I run sudo mopidyctl local scan I am getting an error Permissions denied 13 even that I changed the owner to mopidy.

You did? Where? Why? That error suggests the `mopidy` user does not have permission to read the files on your mounted drive. You need to fix that as already mentioned above.

> [@Uniquegch](#):
>
> If I run “mopidy -v local scan”

That command is for when you are **not** running Mopidy as a service. You could read about that here [Running in a terminal — Mopidy 3.4.2 documentation](https://docs.mopidy.com/en/latest/running/terminal/)

---

<div class="post-metadata">

**Author:** ![Uniquegch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/uniquegch/32/1937_2.png) [@Uniquegch](https://discourse.mopidy.com/u/Uniquegch)\
**Post date:** [February 3, 2021, 10:24pm UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722/6 "2021-02-03T22:24:47Z")

</div>

thanks for the long detailed reply. and basically it was the first simple test you send me, proofing that the permissions denied and with that the had to fail.

sudo -su mopidy ls /media/pi/cc92a1a1-8050-46a9-a53e-86407efe3058/

Running the test with pi instead of mopidy it was successful. changing the group memebership did not help. I did more research on mounting USB drives and manually mounted the usb drive, even that it was already mounted by the OS under media.  
now the test for mopidy was successful, I changed certain settings back I do not need and run successful the command sudo mopidyctl local scan.

Thank you very much for your time and help. I learned a lot today, but there is far still more to come.

this is now my /etc/mopidy/mopidy.conf

[http]  
hostname = 0.0.0.0

[audio]  
output = alsasink

[local]  
media\_dir = /mnt/Music

[scrobbler]  
enabled = true  
username = _a username_  
password = \*\*\*\*\*\*\*\*\*\*

---

<div class="post-metadata">

**Author:** ![Martin\_Klein](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/martin_klein/32/1700_2.png) [@Martin\_Klein](https://discourse.mopidy.com/u/Martin_Klein)\
**Post date:** [February 10, 2021, 3:04pm UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722/7 "2021-02-10T15:04:49Z")

</div>

I had the same problem in September last year and found the solution myself. Should be added to the mopidy documentation, Please find my post from Sept below:  
[Iris and Mopidy Mobile are empty when music is on USB drive](https://discourse.mopidy.com/t/iris-and-mopidy-mobile-are-empty-when-music-is-on-usb-drive/4280/4)  
Kind regards - Martin Klein

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [February 10, 2021, 4:00pm UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722/8 "2021-02-10T16:00:08Z")

</div>

If someone would please come up with a pull request to chnage the documentation I would appreciate that.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/system/32/1_2.png) [@system](https://discourse.mopidy.com/u/system)\
**Post date:** [August 12, 2021, 4:00am UTC](https://discourse.mopidy.com/t/mopidy-scan-usb-not-successful/4722/9 "2021-08-12T04:00:18Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
