How do you use multiple HDDs in Nextcloud?

yes I have recently extended the cloud storage with a extra harddisk.

it is very simple to extend the cloud storage space although I do not use raid.

say you have the NC data stored on /cloud and it is running full.
sudo apt install mhddfs
make a new directory /cloud1
make a new directory /cloud2
set the permissions user group to www-data:www-data

change your fstab to have the following
mount your new harddisk to /cloud2
change the /cloud mountpoint to /cloud1
and add some thing like
#mhddfs
mhddfs#/cloud1/,/cloud2/ /cloud fuse allow_other,logfile=/var/log/mhddfs.log 0 0

my /etc/fstab is like this

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdc1 during installation
UUID=3906263b-190b-462a-9968-9977ff29f13a /               ext4    errors=remount-ro 0       1
# /home was on /dev/sdc3 during installation
UUID=bf9638ab-2991-49d0-aa30-cb4c3c80190b /home           ext4    defaults        0       2
# swap was on /dev/sdc5 during installation
UUID=ca0860b5-f5ae-4d27-9302-2d30f85a47df none            swap    sw              0       0

# /cloud was on /dev/sdc4 during installation
# Changed the line below to /cloud1
UUID=aca04ccb-b3d7-41a5-9f2b-fb4931042f0c /cloud1          ext4    defaults        0       2
# manually added the lines below 
# /cloud2 is created on /dev/sdd1 after installation
UUID=0523a47c-8a21-44e1-9111-47fd371e6414 /cloud2	ext4	defaults	0	2
#mhddfs
mhddfs#/cloud1/,/cloud2/ /cloud		fuse	  allow_other,nonempty,logfile=/var/log/mhddfs.log 0 0

save it
sudo unmount /cloud
sudo mount -a

this should result in one directory /cloud with the contents of /cloud1 and /cloud2
you can then easily add more disk by creating a cloud3 directory and add it to your fstab.

mhddfs#/cloud1/,/cloud2/,/cloud3/ /cloud fuse defaults,allow_other,nonempty 0 0

Have NC data directory set to /cloud

hope this was any help.

edit:
as i use this only for myself this is my output of df -h
Bestandssysteem Grootte Gebruikt Besch Geb% Aangekoppeld op
/cloud1/;/cloud2/ 284G 11G 259G 4% /cloud
/dev/sdd1 184G 60M 174G 1% /cloud2
/dev/sdc4 101G 11G 85G 12% /cloud1

but there are examples out there over 18Tb

2 Likes