In today's mini-guide we stay in the storage field, talking about mergefs. This open-source tool logically joins multiple paths together. It does not strip any data and operates on the filesystem level.
MergerFS, what it is and how it works
mergerfs is a filesystem unifier. Its purpose is to simplify the archiving and management of files, through numerous storage devices. That is, it allows you to merge multiple directories, which will appear to the end-user as a single location. The resulting directory will contain all the files and subdirectories of the initial ones but will be mounted in a single place on the filesystem. This will make it easier to access and manage content. In case the software should stop working, just mount the hard disks on another machine to be able to access your data again.
The previous screenshot explains exactly what we're going to do. Given two volumes A and B, we create volume C, result of the previous ones. In the latter namesake, folders will contain the sum of the contents. Unique directories and files will continue to remain so. To install this tool we can go to the official Github page. In addition to the source code, the software is distributed in rpm or deb format. There are also versions compiled for the ARM architecture.
To follow the merger between two filesystems, as in the example shown in the previous screenshot, the instruction to be executed is as follows:
sudo mergerfs -o defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true,minfreespace=1M /disk1:/disk2 /merged
- allow_other: allows users other than the merger to view the filesystem;
- use_ino: causes mergerfs to provide file / directory inodes;
- category.create = mfs distributes files across all drives based on available space;
- moveonenospc = true if writing fails, a scan will be performed to find the drive with the most free space.
For a complete overview of all the available options, I refer you to the official page of the open-source project.
0 Comments