# How do I scan music on a USB drive?

**URL:** <https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663>\
**Category:** Misc\
**Created:** [July 13, 2018, 12:24pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663 "2018-07-13T12:24:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_1uke](https://avatars.discourse-cdn.com/v4/letter/_/a9adbd/32.png) [@\_1uke](https://discourse.mopidy.com/u/_1uke)\
**Post date:** [July 13, 2018, 12:24pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/1 "2018-07-13T12:24:48Z")

</div>

Hello,

I have recently installed Mopidy and IRIS front end on my Raspberry Pi 2b.

Can some one help me by telling me how to scan the music that is on my USB drive so that it shows up in IRIS.

Thanks in advance! 🙂

---

<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:** [July 13, 2018, 1:07pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/2 "2018-07-13T13:07:06Z")

</div>

1. Mount the USB drive.
2. Set the Local extension’s `media_dir` [setting](https://docs.mopidy.com/en/latest/ext/local/#confval-local/media_dir) in your mopidy.conf to the path you mounted the drive at in #1.
3. Run `sudo mopidyctl local scan` (or `mopidy local scan`).

---

<div class="post-metadata">

**Author:** ![\_1uke](https://avatars.discourse-cdn.com/v4/letter/_/a9adbd/32.png) [@\_1uke](https://discourse.mopidy.com/u/_1uke)\
**Post date:** [July 13, 2018, 2:20pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/3 "2018-07-13T14:20:07Z")

</div>

Hi @kingosticks

I just ran `df -h`

and i can see my usb has the following values

File system: /dev/sda1

Mounted on: /media/pi/F54D-CFFB

- Do i update media\_dir = $XDG\_MUSIC\_DIR to one of those values above?

- Which value should I use?

**Thank you for your help**

---

<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:** [July 13, 2018, 2:48pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/4 "2018-07-13T14:48:04Z")

</div>

Since it is mounted at /media/pi/F54D-CFFB you update `media_dir = /media/pi/F54D-CFFB`.

---

<div class="post-metadata">

**Author:** ![\_1uke](https://avatars.discourse-cdn.com/v4/letter/_/a9adbd/32.png) [@\_1uke](https://discourse.mopidy.com/u/_1uke)\
**Post date:** [July 13, 2018, 3:48pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/5 "2018-07-13T15:48:46Z")

</div>

Hello @kingosticks

Here is an update for you.

My config file with the [local] part updated now [looks like this](https://i.imgur.com/eugtxD0.jpg)

Here is the output from [Mopidy local scan](https://i.imgur.com/CcjD2AL.jpg)

Don’t know if it’s worth mentioning but when I was doing the last part of the IRIS install [I got this message](https://i.imgur.com/S7Srhz6.png)

- Can you advise me on what to do next. I’m not seeing any media pulled in to IRIS yet.

**Thank you**

---

<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:** [July 13, 2018, 4:09pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/6 "2018-07-13T16:09:54Z")

</div>

Your pi user must have read access to the USB drive.

The output of the scan should look more like this:

```auto
INFO Starting Mopidy 2.1.0-111-g65014ad4
INFO Loading config from builtin defaults
INFO Loading config from /home/nick/.config/mopidy/mopidy.conf
INFO Loading config from command line options
INFO Enabled extensions: mpd, http, file, stream, m3u, softwaremixer, musicbox_webclient, local
INFO Disabled extensions: none
INFO Found 0 files in media_dir.
INFO Checking 0 tracks from library.
INFO Removing 0 missing tracks.
INFO Found 0 tracks which need to be updated.
INFO Scanning...
INFO Scanned 0 of 0 files in 0s.
INFO Done scanning.

```

Yours looks like it hasn’t even started scanning yet. I don’t know why it would be stuck, try running with the -v option i.e. `mopidy -v local scan`.

---

<div class="post-metadata">

**Author:** ![\_1uke](https://avatars.discourse-cdn.com/v4/letter/_/a9adbd/32.png) [@\_1uke](https://discourse.mopidy.com/u/_1uke)\
**Post date:** [July 13, 2018, 4:41pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/7 "2018-07-13T16:41:43Z")

</div>

Thank you for your help with this @kingosticks

So here is the new out put from running [mopidy -v local scan](https://i.imgur.com/WNuXx1s.png)

Yet still [nothing showing in IRIS yet](https://i.imgur.com/BX9uIJV.png)

- Any thoughts on what to do next?

---

<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:** [July 13, 2018, 5:02pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/8 "2018-07-13T17:02:23Z")

</div>

Provide the entire log output (not a picture) from Mopidy firstly when running `mopidy local scan` (this obviously got a log further than the first image you posted, any explanation why that is?) and then also when starting Mopidy normally afterwards.

---

<div class="post-metadata">

**Author:** ![\_1uke](https://avatars.discourse-cdn.com/v4/letter/_/a9adbd/32.png) [@\_1uke](https://discourse.mopidy.com/u/_1uke)\
**Post date:** [July 13, 2018, 5:29pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/9 "2018-07-13T17:29:15Z")

</div>

Thanks @kingosticks

One quick question before running the scans.

Should the music be in the root folder of the USB?

My current set up is - USB Stick/Music/Artist-Name/Album-Name

Also on the usb is things like USB Sitck/Photos/Month/

Etc.

---

<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:** [July 13, 2018, 5:56pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/10 "2018-07-13T17:56:32Z")

</div>

It will start at the folder you configured and scan everything in and below that folder. Sounds like you’ll have it trying to scan a load of photos too; which should be fine, it’s just a waste of time. You would be better off setting the media\_dir to /media/pi/F54D-CFFB/Music (or whatever the exact path is).

---

<div class="post-metadata">

**Author:** ![Steve\_Lambert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/steve_lambert/32/1149_2.png) [@Steve\_Lambert](https://discourse.mopidy.com/u/Steve_Lambert)\
**Post date:** [July 13, 2018, 7:20pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/11 "2018-07-13T19:20:01Z")

</div>

I’ve just set up from scratch - if using Iris you need to go Browse then the music should be in ‘Local Media’, after scanning I also restarted Mopidy before the files appeared.  
As kingosticks recommended it will be much quicker to point directly at the Music.

---

<div class="post-metadata">

**Author:** ![\_1uke](https://avatars.discourse-cdn.com/v4/letter/_/a9adbd/32.png) [@\_1uke](https://discourse.mopidy.com/u/_1uke)\
**Post date:** [July 13, 2018, 7:21pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/12 "2018-07-13T19:21:15Z")

</div>

Hi @kingosticks

I have updated the [local] to the exact path of the folder that contains the music.

Here is what I get when [mopidy isn’t running and I execute mopidy local scan](https://defuse.ca/b/bIlGu0ed)

And here is what I get when [mopidy isn’t running and I execute mopidy -v local scan](https://defuse.ca/b/hBdx63GX)

Please let me know what to do next

**And thank you for your continued help with this!**

---

<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:** [July 13, 2018, 8:00pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/13 "2018-07-13T20:00:50Z")

</div>

The second log isn’t what I asked for. Either way looks like mopidy has found your tracks so this is something to do with iris. I suggest you follow what @Steve_Lambert said regarding how to view your local files in iris.

---

<div class="post-metadata">

**Author:** ![\_1uke](https://avatars.discourse-cdn.com/v4/letter/_/a9adbd/32.png) [@\_1uke](https://discourse.mopidy.com/u/_1uke)\
**Post date:** [July 13, 2018, 9:33pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/14 "2018-07-13T21:33:22Z")

</div>

Thank you for all your help today @kingosticks. It’s really appreciated!

@Steve_Lambert

I’ve pointed my [local] directly to the folder with the music in it.

And when I go to [_Browse_ I do see my audio](https://i.imgur.com/81gihgw.png) and it plays

- I was expecting to appear in _Artists_ and in _Albums_ and display the cover art. Is there any way to make this happened?

**Thank you for helping me with this**

---

<div class="post-metadata">

**Author:** ![Steve\_Lambert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/steve_lambert/32/1149_2.png) [@Steve\_Lambert](https://discourse.mopidy.com/u/Steve_Lambert)\
**Post date:** [July 14, 2018, 7:15am UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/15 "2018-07-14T07:15:39Z")

</div>

When playing I see the album art. I think the artwork needs to be in the same folder as the music you are playing. I have 5 albums on the usb stick and each one is in a separate folder with the relevant artwork.

> [@\_1uke](#):
>
> I was expecting to appear in _Artists_ and in _Albums_ and display the cover art. Is there any way to make this happened?

I don’t know - I usually only use Mopidy for playing Spotify tracks, your queries have made me look at other forms of playing music. Have a look at the Settings page in Iris, there is an option there for Artist library URI that might be useful, probably best to ask the question on the [Iris Github page](https://github.com/jaedb/Iris/issues)

---

<div class="post-metadata">

**Author:** ![\_1uke](https://avatars.discourse-cdn.com/v4/letter/_/a9adbd/32.png) [@\_1uke](https://discourse.mopidy.com/u/_1uke)\
**Post date:** [July 14, 2018, 8:05am UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/16 "2018-07-14T08:05:12Z")

</div>

@Steve_Lambert

A brief reply as typing from my phone.

My album artwork is embedded in to the mp3s.

Are you saying that I need to have a .jpeg of the art work inside each folder?

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Steve\_Lambert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/steve_lambert/32/1149_2.png) [@Steve\_Lambert](https://discourse.mopidy.com/u/Steve_Lambert)\
**Post date:** [July 14, 2018, 4:27pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/17 "2018-07-14T16:27:51Z")

</div>

> [@\_1uke](#):
>
> Are you saying that I need to have a .jpeg of the art work inside each folder?

No, when I checked again it’s all a bit haphazard, some tracks show artwork, some on the same album don’t. Some will show in the web UI Musicbox Webclient but not in Iris. I retagged a lot with musicbrainz but not sure if that made any difference.  
As mentioned previous post I usually only use Spotify so can’t really offer any more advice on how to get the album art showing.

---

<div class="post-metadata">

**Author:** ![\_1uke](https://avatars.discourse-cdn.com/v4/letter/_/a9adbd/32.png) [@\_1uke](https://discourse.mopidy.com/u/_1uke)\
**Post date:** [July 14, 2018, 10:13pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/18 "2018-07-14T22:13:16Z")

</div>

Thanks for the reply @Steve_Lambert,

I also tagged my music with MusicBrainz Pickard.

Sounds like I might need to start a new thread to get others to weigh in on this issue.

Thank you for all your help (and to you @kingosticks) at least I have the critical part working and I can access my music via the web interface. Thank you again for all your help. Greatly appreciated 🙂

---

<div class="post-metadata">

**Author:** ![johnnyeightpence](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/johnnyeightpence/32/2358_2.png) [@johnnyeightpence](https://discourse.mopidy.com/u/johnnyeightpence)\
**Post date:** [January 8, 2023, 7:36pm UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/19 "2023-01-08T19:36:26Z")

</div>

Hi. I am also struggling with the music on my usb drive and need clarification, if someone would be so kind.  
Situation is that in the browser (…/mobile/index.html#/library) there is two folders shown:  
Media and Local Media  
The files on the USB drive are only shown in Media and there is no Album, Artist etc. from the USB drive mentioned in Local Media.  
How can I achieve that?

Thanks for the support!

---

<div class="post-metadata">

**Author:** ![Geert](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/geert/32/252_2.png) [@Geert](https://discourse.mopidy.com/u/Geert)\
**Post date:** [January 9, 2023, 10:49am UTC](https://discourse.mopidy.com/t/how-do-i-scan-music-on-a-usb-drive/2663/20 "2023-01-09T10:49:28Z")

</div>

You need to set the media\_dir configuration parameter for the local extension (see [GitHub - mopidy/mopidy-local: Mopidy extension for playing music from your local music archive](https://github.com/mopidy/mopidy-local#configuration)) and then perform a scan. (The output of the scan command will show you if the files on USB got picked up). If you’re on Linux and you have music files locally on the PC as well as on an USB drive you can use a symlink to include the USB drive.
