# Connect your media server

## Share the mount

infinidysk mounts the library inside its own container. With `/mnt:/mnt:rshared` in its [compose file](https://www.infinidysk.com/v2/install/docker/#compose-file), the mount also shows on the host. Every container that reads it (Sonarr, Radarr, Plex, Jellyfin) binds the same parent directory with `:rslave`:

```yaml
services:
  plex:
    volumes:
      - /mnt:/mnt:rslave
    depends_on:
      infinidysk:
        condition: service_healthy
```

`depends_on` is optional. It starts the media server only after the mount is up; see [Health check](https://www.infinidysk.com/v2/install/docker/#wait-for-the-mount).

Use the same path in every container. Library symlinks point to absolute paths under the mount (`/mnt/infinidysk/.ids/…` by default), so a container that sees the mount somewhere else cannot follow them.

Check from the media server container:

```sh
docker compose exec plex ls /mnt/infinidysk   # expect .ids, completed-symlinks, content, nzbs
```

## Plex

A Plex scan that runs while infinidysk is down cannot read the symlinks and moves those items to the trash. With **Empty trash automatically after every scan** on, Plex deletes them and adds them again as new items, losing watch state, collections and playlists.

- Turn off **Empty trash automatically after every scan**. The next scan then restores the items with their metadata.
- Avoid scheduled scans during planned downtime.

See [Restarts and crashes](https://www.infinidysk.com/v2/how-it-works/restarts/#plex-library-scans).

## STRM libraries

With the [STRM import strategy](https://www.infinidysk.com/v2/install/import-strategy/), the media server plays each file over HTTP from the URL in its `.strm` file and does not need the mount. It needs to reach the public URL instead; see [Reverse proxy](https://www.infinidysk.com/v2/operate/reverse-proxy/#public-url).