As I discussed in my last post I did not have a well setup up location for my files to be stored. Sense then I have picked up a external Hard drive and a Raspberry Pi4 4GB to serve this purpose. In this I will be using ZFS mostly as I have been wanting to play around with ZFS on linux so this seemed like a good opportunity. For most people using Ext4 would be fine.
ZFS really wants you to be using a 64Bit Kernel. But while I attempted this on Arch, manjaro, ubuntu, and rasbian. I was not able to get any working. That with them all being in various stages of pre-stable drew me to building this on a 32bit Kernel. Once there is a stable 64bit kernel to move to I plan to do so. But I have also not experienced any issues with this setup despite the warnings. As always backups are highly recommended.
To get started add
deb http://deb.debian.org/debian buster contrib to your /etc/apt/sources.list file and uncomment the deb-src line
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi deb http://deb.debian.org/debian buster contrib
You will then need to add the pgp key for this source as well.
gpg --keyserver pgpkeys.mit.edu --recv-key 04EE7237B7D453EC gpg -a --export 04EE7237B7D453EC | sudo apt-key add
sudo apt update
Now lets add some build tools that you will need
sudo apt -y install build-essential fakeroot devscripts autogen libelf-dev debian-keyring busybox initramfs-tools raspberrypi-kernel-headers
Now we will build in zfs-dkmas and spl-dkms
sudo apt -y build-dep zfs-dkms spl-dkms
Now for the main event, installing zfs. This will take quite a while. You will need to accept the building under 32 bit.
sudo apt install -y zfsutils-linux
Lastly you can reboot or add the kernel module.
sudo modprobe zfs
Now at last you will be able to create your zpool.
sudo zpool create -f nextcloud /dev/sda
Before moving on you can verify that it was created and working.
pi@raspberrypi:~ $ zpool list NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT nextcloud 1.81T 444K 1.81T - 0% 0% 1.00x ONLINE - pi@raspberrypi:~ $
Now its time to move my nextcloud install over to the new host, for the most part you can follow my previous post on setting up Nextcloud.
For that set up we will need to move over the data storage and the /var/www/html folders. As the Database was already on a different host we only need to point the new PI to point to the Database host.
Be sure to end up with www-data owning both the data dir and /var/www/html
I did need to re-authenticate the clients back to Nextcloud. But otherwise everything worked.
The Raspberry pie for is a much better device for Nextcloud with USB3 and the additional RAM. Monitoring the usage I am limited by the CPU. But I can live with that for now.