MergerFS neat tricks

Trapexit’s MergerFS is awesome. He has some great documentation on the README, but I just wanted to share a couple of quick examples I use all the time. Let’s say you have a MergerFS pool mounted at /storage. You can view the current setup by using xattrs to view the pseudo .mergerfs file.

It will output something like this. Note that there are currently 5 disks shown under the srcmounts value.

All of these options above can be set in realtime without unmounting and re-mounting the mergerfs pool via the runtime options.

Removing Disks
The first example could be removing a couple of disks from the pool.

This modifies the pool in realtime (no need to unmount, or stop services like samba/plex). It just works. Afterwards, we are left with this. Note that disk04 and disk05 have been removed from the pool.

Adding Disks
Now, let’s show you an example to add a couple disks. Let’s say you got some nice shiny 8TB data disks that you’d like to add to your pool. You can get them all setup and mounted via /etc/fstab (including adding them to the mergerfs line there), but you don’t want to have to offline your pool right now because your kids are watching a movie in Plex. No problem, mergerfs pseudo file to the rescue!

The above will append disk04 and disk05 onto the end of the current srcmounts.

You can also do all sorts of other things like change the create mode, or the moveonenospc value, or even the minfreespace option all without remounting.

Zack

Zack

I love learning new things and trying out the latest technology.

You may also like...

11 Responses

  1. codgedodger says:

    Question – I have three drives (more on the way) and I’m trying out the snapRAID with MergerFS. I have disk1 and disk2 my data drive and disk3 parity. When I see how much space /storage (where it is merging it all) it shows the total some of ALL disks which is 18TB. It should only be 10TB with the parity factored in. Is this expected?

    • Zack Zack says:

      Hello, thanks for the comment. Can you provide a copy of your /erc/fstab? Your parity drive should not be included in the Mergerfs pool and it sounds like it is being included as result of your mount string.

  2. codgedodger says:

    This is my code in /etc/fstab I was curious about the snapRAID tutorial on the parity mounting disk. I can just remount it to /media/parity1 or something since I’ll eventually have two parity drives.

    • Zack Zack says:

      I would suggest you create separate mountpoints for your parity and data disks.

      and umount and remount your disks there.

      Update your /etc/fstab

      Mount everything back.

      Remember… If you are using SnapRAID, you will need to update your /etc/snapraid.conf to point to these new locations.

  3. codgedodger says:

    Amazing! Thank you! Works great now!

  4. oxzhor says:

    Hi,

    How is it possible to setup an ftp account? i try to create an account on /mnt/storage but this not work.

    Thanks for your feedback.

    • Zack Zack says:

      I would suggest using SFTP or SSH instead of FTP. Both are FAR more secure than FTP. That being said, I don’t use FTP on my mergerFS pool, but SFTP should work fine (I use SSH all the time without issue).

      • oxzhor says:

        I totally agree with you that it is less secure but the problem is, i have some devices that not support sftp / ssh.
        So that is why i needed some ftp connections.

        • oxzhor says:

          I created an ftp account with vsftpd and set the path to /mnt/storage but i cannot ftp files or created any folder.

          • Zack Zack says:

            Do you have a copy of the directions you followed? Also, what errors do you see in the logs? This is likely either a permissions issue or a misconfiguration. Have you tried setting up an FTP path not on the mergerFS pool to see if that works?

Leave a Reply