MergerFS Pooling of drives in Endless

Hi, I want to pool a number of hard drives together, i have achieved this using mergerFS before, is there a way to achieve this with Endless? I can do everything else in containers that i want to do but i am not sure this would work for mergerfs? Please advise, i really want to stick with endless if possible but need this pooling ability. Thank you

I just tried the static binary provided by the project and it works as the necessary prerequisites are in Endless OS. But you have to manually work everything out.

The steps involved are:

  1. Download the binary from the projects release page
  2. Put everything into /usr/local
  3. Configure the whole thing (e.g. create the filesystem on the disks, create the desired mountpoints, …)

One thing to keep an eye on is the fact that entries provided in /etc/fstab are not evaluated automatically during boot on Endless OS, so you have to provide some other way to mount the filesystem (like a autostart desktop file which runs mount -a …)

Thank you very much, will give it a go and report back, much appreciated! :slight_smile:

Hi, just got back round to this, so little time these days. I have the binary located in /usr/local but is that enough? Do i not need to install or anything? Put everything in statement has me confused.

Normally i would:
‘apt install mergerfs fuse’
mkdir the master folder and folders for each disk disk1, disk2 etc
mount each drive for example ‘mount /dev/sdb1 /mnt/disk1’

then i would modify /etc/fstab with contents something like:
/dev/disk/by-id/usb-Seagate_Expansion_Desk_NA4N1EC8-0:0-part1 /mnt/disk1 ext4 defaults 0 0
/dev/disk/by-id/usb-Seagate_Expansion_Desk_NA4KE352-0:0-part1 /mnt/disk2 ext4 defaults 0 0

/mnt/disk* /mnt/storage fuse.mergerfs direct_io,defaults,allow_other,minfreespace=50G,fsname=mergerfs 0 0’

These are instructions i figured out a while back for my old debian system. If its straight forward enough for you, please could you guide me on implementing this in endless? Thank you so much for your help

Essentially, you need to perform the same steps, but using other methodology, as /etc/fstab is not evaluated.

The first step is to create a shell script, which performs all necessary steps like creating the mountpoints for the individual disks and mounting the filesystems. Put the following into ~/mount.sh

#!/bin/bash
if [ ! -d /mnt/disk1 ]; then mkdir /mnt/disk1; fi
if [ ! -d /mnt/disk2 ]; then mkdir /mnt/disk2; fi
if [ ! -d /mnt/storage ]; then mkdir /mnt/storage; fi
mount -t ext4 /dev/disk/by-id/usb-Seagate_Expansion_Desk_NA4N1EC8-0:0-part1 /mnt/disk1 
mount -t ext4 /dev/disk/by-id/usb-Seagate_Expansion_Desk_NA4KE352-0:0-part1 /mnt/disk2
mergerfs /mnt/disk1:/mnt/disk2 /mnt/storage

Make the file containting the above script executable by:

chmod +x ~/mount.sh

And execute it:

sudo ~/mount.sh

If this works as expected, please let me know, we will then proceed further in tweaking the system to run this script with the needed privileges during startup.

That makes a lot of sense to me, thank you. I get a mergerfs command does not exist issue. but then all i have is the .deb sitting in /usr/local. I tried installing it but i get this:

administrator@computer:/usr/local$ sudo dpkg -I mergerfs_2.33.5.debian-bullseye_amd64.deb
dpkg: error: unable to access the dpkg database directory /var/lib/dpkg: Read-only file system

What command should i use here? or should this be working? Thank you

Ah, i see, you are stuck before even installing it. Use these commands to download and put the necessary files into the correct locations:

wget -O - https://github.com/trapexit/mergerfs/releases/download/2.33.5/mergerfs-static-linux_amd64.tar.gz | gzip -dc | tar -xvf - -C ~/mergerfs
sudo mkdir /usr/local/bin
sudo cp ~/mergerfs/usr/local/bin/mergerfs /usr/local/bin/

Then, proceed with the steps from my previous post.

1 Like

Brilliant! Works a treat, now for having this run on boot without user login? is it possible? Here is what my mount.sh looks like and I believe this needs running as sudo/root at boot?

#!/bin/bash
if [ ! -d /mnt/disk1 ]; then mkdir /mnt/disk1; fi
if [ ! -d /mnt/disk2 ]; then mkdir /mnt/disk2; fi
if [ ! -d /mnt/disk3 ]; then mkdir /mnt/disk3; fi
if [ ! -d /mnt/storage ]; then mkdir /mnt/storage; fi

mount -t ext4 /dev/disk/by-id/ata-ST3000DM001-1E6166_W1F4KMRG-part1 /mnt/disk1 

mount -t ext4 /dev/disk/by-id/ata-ST4000DM000-1F2168_Z3020BWE-part1 /mnt/disk2

mount -t ext4 /dev/disk/by-id/usb-Seagate_Expansion_HDD_00000000NAC60QN9-0:0-part1 /mnt/disk3

mergerfs -o direct_io,defaults,allow_other,minfreespace=5G,fsname=mergerfs /mnt/disk1:/mnt/disk2:/mnt/disk3 /mnt/storage

Thank you again for the help on this.

For the description below, i assume that you have saved your script as ~/mount.sh and that your username is ‘user’. Please adopt the names according to your environment.

  1. Create new file with the following content:
[Desktop Entry]
Type=Application
Name=Mount MergerFS
Exec=/sysroot/home/user/mount.sh
Terminal=true
  1. Save this file as ~/.config/autostart/mergerfs.desktop
  2. Execute the following commands:
chmod +x ~/.config/autostart/mergerfs.desktop
gio set ~/.config/autistart/mergerfs.desktop metadata::trusted yes

Now after every reboot, the script is executed.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.