In my previous post, I mentioned the Immich server internal disk’s space is filling up faster than expected. I have decided to add a USB drive, an old 1TB WD My Passport, to hold the photos and other stuff.
Immich is running as a Docker container. The Debian server is a Proxmox VM providing the Docker service. In Linux, all SATA and SCSI drive are sdx
All (S)ATA and SCSI disks are called /dev/sda, /dev/sdb and so on.
IDE are named as hdx
/dev/hda is IDE primary main (equivalent to c: in Windows)
/dev/hdb is IDE primary subordinate (equivalent to d: and so on)
I thought the plugged in USB drive is sda2, when it is actually a partition within the main 80GB drive. Duh!
alfred@docker-server:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 80G 0 disk
sda1 8:1 0 75.9G 0 part /
sda2 8:2 0 1K 0 part
sr0 11:0 1 3.7G 0 rom
The USB drive did not show at in the Debian server VM as it needs to be mounted in Proxmox and passed through. SSH to the hypervisor:
lsusb
Search for the USB drive. Mine was
1058:259f Western Digital My Passport Ultra
Pass it through
qm set 100 -usb0 host=1058:259f
qm config 100
Inside the VM, the USB drive should be visible as /dev/sdb1
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 80G 0 disk
├─sda1 8:1 0 75.9G 0 part /
└─sda2 8:2 0 1K 0 part
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part
sr0 11:0 1 3.7G 0 rom
Unmount the drive, format as ext4, mount the drive and change the owner.
sudo umount /dev/sdb1
sudo wipefs -a /dev/sdb1
sudo mkfs.ext4 /dev/sdb1 -L MyPassport
sudo mkdir -p /mnt/passport
sudo mount /dev/sdb1 /mnt/passport
sudo chown -R alfred:alfred /mnt/passport
Ensure the disk is mounted on restart, check for the disk UUID
sudo blkid /dev/sdb1
To ensure this survives a restart, in fstab add the following
UUID=xxxx-xxxx /mnt/passport ext4 defaults,nofail 0 2
The storage is now ready for use! Copy the existing on disk Immich library to the new external USB storage using rsync
rsync -avh --progress /mnt/immich-library/ /mnt/passport/immich-library/
Shutdown Immich servers to use the new storage via Docker Compose.
docker compose down
Change Immich upload directory from
- /mnt/immich-library:/usr/src/app/upload
to the new external USB drive
- /mnt/passport/media/immich:/usr/src/app/upload
Start up Immich and verify
docker compose up -d
docker logs -f immich-server

Pingback: New Immich server - Alfred’s New Ramblings