Backstory
Having watched a million YouTubes and succumbed to Amazon Prime Day, I have purchased an inexpensive “Chinese” minicomputer and a Terramaster 4 bay Nas enclosure with the intention of building a NAS and setting up Immich. Before anyone asks, I live in Ireland and UGreen NAS are insanely expensive to import!
I successfully installed ZimaOS and Immich and it all looks good. But Immich and the photos are stored on the minicomputer’s hard drive which is 500G. I want to provide more storage for ZimaOS , and have an external drive for my photos.
So in simple linux terms I need to mount my disks to ZimaOS and then configure an external drive in Immich - easier said then done - possibly!
So, my best advice is to open up Notepad or a similar app and cut and paste this entry into it and then edit the relevant commands with your drive names etc.
If using Apple Notes don’t make the mistake that I made and overlook the fact that it capitalises the first word on some lines.
I’ll assume that you have ZimaOS installed and working.
First you’ll need open up a terminal and get to the zimaos command line interface (CLI) . In later versions of limas you need to download an terminal emulator app called ttydBridge
You’ll also need your limas username and password.
*Ok, once you have a CLI session going and have logged on follow these steps…..
Identify the disks
*** you need to identify the disk(s) that you want to mount.*
*** In my case there are 4 disks called sdb, sdc, scd and sce*
Depending on you own set up disk sda is probably the one in the computer and you may also have something called NVME which is a solid state drive. For more information google the lsblk command.
*** There is a really good and simple explanation of the concept of mounting mentioned in one the posts on this thread. I really suggest that you read it a couple of times and then its starts to make sense.
*** the -f extension on the command shows the UUID of the disk. This will become important later so its good idea to cut and paste these results to your notepad.
lsblk -f
BAY 4
sdb ext4 1.0 d5477ded-ee98-4173-a51a-b8ee7f7d7ca9 1.7T 0% /var/lib/casaos_data/.media/sdb-ata-ST2000VN003-3CW1
/DATA/.media/sdb-ata-ST2000VN003-3CW1
/media/sdb-ata-ST2000VN003-3CW1
BAY 3
sdc ext4 1.0 6a1451c3-8ac4-49a9-b4af-8d66cfe28e7c 1.7T 0% /var/lib/casaos_data/.media/sdc-ata-ST2000VN003-3CW1
/DATA/.media/sdc-ata-ST2000VN003-3CW1
/media/sdc-ata-ST2000VN003-3CW1
BAY 2
sdd ext4 1.0 c299022e-7f32-4f44-9200-a44e3e0d54b0 1.7T 0% /var/lib/casaos_data/.media/sdd-ata-ST2000DM001-1CH1
/DATA/.media/sdd-ata-ST2000DM001-1CH1
/media/sdd-ata-ST2000DM001-1CH1
BAY1
sde ext4 1.0 85c2bbcd-90ae-4a04-9f48-636f59cad658 1.7T 0% /var/lib/casaos_data/.media/sde-ata-ST2000DM001-1CH1
/DATA/.media/sde-ata-ST2000DM001-1CH1
/media/sde-ata-ST2000DM001-1CH1
Unmount the drives
*** So having confimed the existence of the drives, you will see that by default they are already mounted to the system. We need to break this and start again.*
sudo umount /dev/sdb
sudo umount /dev/sdc
sudo umount /dev/sdd
sudo umount /dev/sde
Make the new mount points
*** As you may have discovered, in ZimaOS there is no /mnt/ to put your mount points as per the usual conventions. Instead it is necessary to create them in /DATA/*
*** I am going to create a mount point for each HDD in my NAS enclosure, so my naming convention will be /ENCLOSURE/Bay1 and so on.*
*** Its important that when specifying the new directory you also include /DATA/*
*** Note also that directory names are case sensitive*
mkdir /DATA/Enclosure/Bay1
mkdir /DATA/Enclosure/Bay2
mkdir /DATA/Enclosure/Bay3
mkdir /DATA/Enclosure/Bay4
Mount the drives to the new mountpoints
sudo mount /dev/sdb /DATA/Enclosure/Bay1
sudo mount /dev/sdc /DATA/Enclosure/Bay2
sudo mount /dev/sdd /DATA/Enclosure/Bay3
sudo mount /dev/sde /DATA/Enclosure/Bay4
Make the changes persistent
*** Unless you make these mount mounts persistent it’s possible that the next time the system is powered on, the physical drives names may change so what was sdb may now be sdb rendering references to them in mount mappings incorrect.*
*** To address this we need to configure a unique identifier of each physical drive to the emphasized textmount point. This is where the UUID comes in.*
** you need to edit the /etc/fstab file with the following
sudo nano /etc/fstab
Cut and paste the following into the file.
This maps four hard drives to the OS and makes the mapping persistent
UUID=85c2bbcd-90ae-4a04-9f48-636f59cad658 /DATA/Enclosure/Bay4 ext4 defaults,nofail,x-systemd.automount 0 0
UUID=c299022e-7f32-4f44-9200-a44e3e0d54b0 /DATA/Enclosure/Bay3 ext4 defaults,nofail,x-systemd.automount 0 0
UUID= d5477ded-ee98-4173-a51a-b8ee7f7d7ca9 /DATA/Enclosure/Bay2 ext4 defaults,nofail,x-systemd.automount 0 0
UUID= 6a1451c3-8ac4-49a9-b4af-8d66cfe28e7c /DATA/Enclosure/Bay1 ext4 defaults,nofail,x-systemd.automount 0 0
CTRL O
CTRL X
*** Now you need to reload the /etc/fstab configuration and make it active*
sudo systemctl daemon-reload
sudo mount -a
To Verify that the change has taken effect
df -h | grep media
*** This may not show all the drives so it’s best to reboot the system. This seems to kick it all into life.*
*** To reboot the system*
sudo reboot
*** but personally I find power cycling more effective… read on…*
*When you now open up the Zima Dashboard and look inside Storage, you should see the four drives. If you don’t see them, don’t panic! *
*** Open up Files and you should see your new directory structure. This is good news. Try opening each folder within the structure to make sure it’s ok. Then return to storage and you may find that the display has refreshed and the drives are now displayed, along with the correct total volume of disk space.
*** If they are still not there, go back to the command line and run lsblk to make sure everything is mounted correctly. If it is then try power cycling everything and that should do it.
** Congratulations you have now mapped your external drives into ZimaOS
** Next - creating the external drive in Immich.