Alfred's New Ramblings

Adding more storage to Immich server

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 the arr stack media.

The Debian server is a VM running Docker is on proxmox. 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.

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 as it needs to be passed through by proxmox. 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

In fstab add the following

UUID=xxxx-xxxx /mnt/passport ext4 defaults,nofail 0 2

The storage is now ready for use.

Tagged on: , ,



Leave a Reply

Your email address will not be published. Required fields are marked *