Skip to content

Move your media or Docker data to another disk

How-toDeployrr v6.0+CurrentHost systemDockerMedia

Your disk is full, or you added a bigger one. This page shows how to move your media and downloads, or Docker’s own storage, to the new disk. Your apps keep working because the paths inside the apps do not change.

Three places can fill a disk. Each one moves in a different way.

Data Where it is How to move it
Media and downloads (also books, photos, Immich and Nextcloud files) The folders you set in System > Folders Move your media and downloads. For Immich and Nextcloud, also read Move the Immich or Nextcloud folder.
Docker’s images, containers and volumes /var/lib/docker by default Move Docker’s storage. This is a standard Docker setting, not a Deployrr menu.
The Deployrr Docker folder (appdata, .env, compose files, secrets) The path you chose in Prerequisites Do not move it. See the note below.

Check which disk is full first:

Terminal window
df -h

Look for a line at or near 100% in the Use% column. Then see how big each part is. Replace YOUR_FOLDER with the folder you want to measure:

Terminal window
sudo du -sh YOUR_FOLDER
  • You have a new disk that is already formatted and visible to Linux. This page does not format disks.
  • You made a backup of your Docker folder. Tools > Backups needs a Pro license and stops all your apps while it runs. At the end it asks whether to restart the Docker stack. If you answer no, start your apps later with Tools > Stack Manager > Up. A backup holds only the Docker folder. It does not hold your media or Docker’s images.
  • The new disk has more free space than the data you move.
  • For Stack Manager, you have a Basic, Plus or Pro license and all Prerequisites steps are done. To set a folder in System > Folders you need the same. See Licenses.
  • If your media is on a NAS, you do not need a local disk. Mount the share with SMB or NFS Mount or Rclone, then go to Move your media and downloads.

A disk you mount by hand is gone after a reboot. Add it to /etc/fstab, the file Linux reads at boot. This example uses a disk with an ext4 filesystem. Replace the values in capitals where the steps say so.

  1. Find your disk and its UUID:

    Terminal window
    lsblk -f

    Look for the new disk and its partition, such as sdb1. Copy the long UUID value next to it.

  2. Make the mount folder. This example uses /mnt/data. Use any path you like:

    Terminal window
    sudo mkdir -p /mnt/data
  3. Copy the file as a backup:

    Terminal window
    sudo cp /etc/fstab /etc/fstab.before-newdisk
  4. Open the file:

    Terminal window
    sudo nano /etc/fstab
  5. Add this line at the end. Replace YOUR_UUID with the UUID from step 1. Change ext4 if your disk uses another filesystem:

    UUID=YOUR_UUID /mnt/data ext4 defaults,nofail 0 2
  6. Save the file.

  7. Test it:

    Terminal window
    sudo mount -a

    No output means the file is fine. If you see an error, fix the line it names. Or put your copy back:

    Terminal window
    sudo cp /etc/fstab.before-newdisk /etc/fstab
  8. Check that the disk is mounted:

    Terminal window
    findmnt /mnt/data
  9. Make your Linux user the owner of the mount folder. Replace YOUR_USER with your Linux username. Skip this step if you only move Docker’s storage:

    Terminal window
    sudo chown YOUR_USER:YOUR_USER /mnt/data

The nofail option lets the server boot even if the disk is missing. If you later see an empty folder where your data should be, check that the disk is mounted. See Media app shows an empty library.

To understand how a permanent mount entry works, read UDMS part 07: Make a mount permanent with fstab (manual setup). It covers a network share, not a local disk, so use the steps on this page for your disk.

Moving changes where the files live on your server. It does not change the paths inside your apps. Media Folder 1 is still /data/media1 and the Downloads Folder is still /data/downloads for your apps. You do not need to change any library or root folder inside Plex, Jellyfin, Sonarr or Radarr.

  1. Go to Tools > Stack Manager > Stop Container.

  2. At “Select an app to stop:”, type the number next to all and press Enter. Look for “All containers stopped”.

  3. Copy your files. Replace OLD_FOLDER with your current folder and NEW_FOLDER with the folder on the new disk. Keep the / at the end of both paths:

    Terminal window
    sudo rsync -aHAX --info=progress2 OLD_FOLDER/ NEW_FOLDER/

    A big library takes a long time. If the copy stops, run the same command again. It carries on where it left off. If rsync is not found, install it with your package manager, such as sudo apt install rsync on Debian or Ubuntu.

  4. Check the copy. This dry run lists differences and changes nothing. It prints nothing when both folders match:

    Terminal window
    sudo rsync -aHAXn --itemize-changes OLD_FOLDER/ NEW_FOLDER/
  5. Compare the sizes:

    Terminal window
    sudo du -sh OLD_FOLDER NEW_FOLDER
  6. In Deployrr, go to System > Folders.

  7. Select the folder you moved, such as Media Folder 1 or Downloads Folder.

  8. Pick the new folder in the directory browser, choose Select, then Confirm. See Set a folder for each prompt. To see the folder prompts, watch Deployrr 5 walkthrough: Setup Folders at 21:36 (shows Deployrr v5; menus and steps differ in v6).

  9. Repeat steps 7 and 8 for every folder you moved.

  10. Go to Tools > Stack Manager > Recreate.

  11. At “Select an app to recreate:”, type the number of one app that uses the folder, or the number next to all. Wait for “APP recreated” or “All containers recreated”.

Check that it worked (see Check it worked). Keep the old copy until you are sure.

Do not delete the old copy until your apps have run for a few days with the new folder. To make sure nothing still uses it, rename it first. Replace OLD_FOLDER with your old folder:

Terminal window
sudo mv OLD_FOLDER OLD_FOLDER.old

If everything works after a few days, delete it. Check the path twice. This cannot be undone:

Terminal window
sudo rm -rf OLD_FOLDER.old

The Immich Folder holds every photo and video uploaded to Immich. The Nextcloud Folder holds the files in Nextcloud. Move them with the steps above. Keep these points in mind:

  • Their databases stay in the Docker folder, in appdata/immich-postgresql and appdata/nextcloud-mariadb. The database lists every file by its place inside the folder. So the new folder must hold the whole old folder with the same layout. Copy the folder you set in System > Folders, not a folder inside it.
  • Copy with sudo, as in step 3. Nextcloud’s files belong to the web server user inside the container (www-data), not to your Linux user. rsync -a keeps the owner. Do not run chown on the new Nextcloud folder. Copy into a folder on the new disk, such as /mnt/data/nextcloud, not into the mount folder itself.
  • At step 7, select Immich Folder or Nextcloud Folder. At step 11, recreate immich or nextcloud. Recreate is enough, because both apps always have their folder.

Check that the app sees its files. For Immich, you see folders such as library, thumbs and upload:

Terminal window
sudo docker exec immich ls /usr/src/app/upload

For Nextcloud, you see a folder for each Nextcloud user:

Terminal window
sudo docker exec nextcloud ls /var/www/html/data

If the app shows an error or does not start, the new path does not hold the old files:

  • Nextcloud says the data directory is invalid and asks for a file called .ocdata. Immich does not start, and its log names a .immich file. These are hidden files the apps put in their folders. rsync -a copies them, so a missing file means the copy or the path is wrong.
  • If Nextcloud says the data directory is readable by other users, run sudo chmod 0770 NEW_FOLDER.
  • To go back, set the folder to the old path in System > Folders and recreate the app again. Your old copy is still there.

Then remove the old copy as in Delete the old copy.

Docker keeps images, containers and volumes in /var/lib/docker. If that disk is full, you can point Docker at a folder on the new disk. This is a standard Docker setting called data-root. Deployrr has no menu for it.

Check how Docker stores images before you start:

Terminal window
sudo docker info --format '{{.Driver}}'

If it prints overlay2, your images and containers are in /var/lib/docker and the steps below move them. If it prints overlayfs, Docker uses the containerd image store. Then most of the image data is in /var/lib/containerd, which data-root does not move. Check its size with sudo du -sh /var/lib/containerd before you go on, because the steps below may free much less space than you expect.

  1. Make the folder on the new disk. This example uses /mnt/data/docker:

    Terminal window
    sudo mkdir -p /mnt/data/docker
  2. Stop Docker:

    Terminal window
    sudo systemctl stop docker docker.socket
  3. If /etc/docker/daemon.json exists, copy it. Skip this if the file does not exist:

    Terminal window
    sudo cp /etc/docker/daemon.json /etc/docker/daemon.json.bak
  4. Open the file:

    Terminal window
    sudo nano /etc/docker/daemon.json
  5. Add the data-root key. If the file is new, it holds only this:

    {
    "data-root": "/mnt/data/docker"
    }

    If the file already has keys, add data-root to them. Keep a comma between keys and keep the file valid JSON. For example, with the log limit from Free up disk space used by Docker:

    {
    "data-root": "/mnt/data/docker",
    "log-driver": "json-file",
    "log-opts": {
    "max-size": "10m",
    "max-file": "3"
    }
    }
  6. Save the file.

  7. Copy Docker’s data to the new folder. This can take a long time:

    Terminal window
    sudo rsync -aHAX --info=progress2 /var/lib/docker/ /mnt/data/docker/
  8. Start Docker:

    Terminal window
    sudo systemctl start docker
  9. Check the path Docker uses now:

    Terminal window
    sudo docker info --format '{{.DockerRootDir}}'

    It prints /mnt/data/docker. If it still prints /var/lib/docker, check daemon.json for typos.

  10. Go to Tools > Stack Manager > Up. Look for “Docker stack is up”. Many apps don’t start on their own when Docker starts, so this step brings them back.

If you installed cAdvisor or Node Exporter, their files still name /var/lib/docker, so they may show old or empty Docker data after the move.

If Docker does not start, put your copy of daemon.json back, or remove the data-root line, then start Docker again. Your old data is still in /var/lib/docker:

Terminal window
sudo cp /etc/docker/daemon.json.bak /etc/docker/daemon.json
sudo systemctl start docker

If you had no daemon.json before, delete the new file instead with sudo rm /etc/docker/daemon.json.

When your apps have run well for a few days, free the old space. Rename the old folder first to prove nothing uses it:

Terminal window
sudo mv /var/lib/docker /var/lib/docker.old

Check your apps again. Then delete it. This cannot be undone:

Terminal window
sudo rm -rf /var/lib/docker.old
  1. See the free space on both disks:

    Terminal window
    df -h
  2. For media, list the folder inside an app. Replace APP with the app’s name, such as jellyfin:

    Terminal window
    sudo docker exec APP ls /data/media1

    You see your media type folders, such as movies and tv.

  3. Open the app. Your library shows your titles. In Sonarr, Radarr or Lidarr, the root folder list shows a path under /data/media1.

  4. For Docker’s storage, list your containers:

    Terminal window
    sudo docker ps -a

    Your apps show as Up. With a license you can use Tools > Stack Manager > Containers Status instead.

  5. Reboot once. Then check that the disk is mounted:

    Terminal window
    findmnt /mnt/data

    Many apps, including Jellyfin, Sonarr and Radarr, are set not to start on boot. Go to Tools > Stack Manager > Up to start them, then check that they show as Up.