User Tools

Site Tools


mergerfs:combine_multiple_hard_drives_into_a_single_mountpoint

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
mergerfs:combine_multiple_hard_drives_into_a_single_mountpoint [2025/04/25 09:23] – created petermergerfs:combine_multiple_hard_drives_into_a_single_mountpoint [2025/04/25 13:48] (current) peter
Line 1: Line 1:
 ====== MergerFS - Combine multiple hard drives into a single mountpoint ====== ====== MergerFS - Combine multiple hard drives into a single mountpoint ======
- 
-[[MergerFS:Combine multiple hard drives into a single mountpoint|Combine multiple hard drives into a single mountpoint]] 
- 
----- 
  
 ===== Objective ===== ===== Objective =====
Line 18: Line 14:
  
 <WRAP info> <WRAP info>
-**NOTE:*+**NOTE:** **/srv/media** is the unified mount point.
- +
-  * **/srv/media**:  The unified mount point.+
  
 </WRAP> </WRAP>
Line 26: Line 20:
 ---- ----
  
-===== Install and Configure MergerFS =====+===== Download MergerFS =====
  
 Get the latest release from the MergerFS [[https://github.com/trapexit/mergerfs/releases/latest|GitHub]] page. Get the latest release from the MergerFS [[https://github.com/trapexit/mergerfs/releases/latest|GitHub]] page.
Line 45: Line 39:
 </WRAP> </WRAP>
  
 +----
 +
 +===== Install MergerFS =====
 +
 +<code bash>
 +dpkg -i mergerfs_2.40.2.debian-bookworm_amd64.deb
 +</code>
 +
 +----
 +
 +===== Try to Manually Mount =====
 +
 +<code bash>
 +mergerfs -o defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true /drive1:/drive2:/drive3 /srv/media
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  The mount point is /srv/media
 +
 +
 +If after mounting, there are problems with the permissions, 
 +Set user_allow_other in /etc/fuse.conf
 +</WRAP>
 +
 +----
 +
 +===== Try to Access the Mount =====
 +
 +<code bash>
 +cd /srv
 +/srv$ ls -l  
 +ls: cannot access 'virt': No such file or directory  
 +total 0  
 +d????????? ? ? ? ?            ? virt  
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  If after mounting, there are problems with the permissions:
 +
 +  * Set **user_allow_other** in /etc/fuse.conf
 +</WRAP>
 +
 +
 +----
 +
 +===== Configure fstab =====
 +
 +Edit /etc/fstab.
 +
 +<file bash /etc/fstab>
 +...
 +UUID=b8548ed6-a3e9-44b2-845c-648892491c2d   /mnt/media1   ext4    errors=remount-ro     0
 +UUID=c09544b8-0dc3-4532-a1c7-31fd63c8c97e   /mnt/media2   ext4    errors=remount-ro     0
 +UUID=347f34a3-b4b1-47c9-bec9-3ea0c4aa3715   /mnt/media3   ext4    errors=remount-ro     0
 +/mnt/media* /srv/media fuse.mergerfs defaults,allow_other,nonempty,moveonenospc=true,dropcacheonclose=true,category.create=epmfs,fsname=mergerfs 0 0
 +
 +#OLD /mnt/media* /srv/media fuse.mergerfs defaults,allow_other,nonempty,use_ino,moveonenospc=true,dropcacheonclose=true,category.create=mspmfs,fsname=mergerfs 0 0
 +
 +</file>
 +
 +<WRAP info>
 +**NOTE:**  It is recommended to have the mount points for each drive to be /mnt/media1, /mnt/media2, and /mnt/media3, and so on.
 +
 +  * This way by using /mnt/media* for the new mergerfs entry in fstab, it will pick up all the drives and any future ones added that uses the same naming scheme.
 +  * The new unified single mount point will be in **/srv/media**.
 +  * To get the UUID values for the disks, use <code bash>lsblk -d -o NAME,PATH,SIZE,SERIAL,UUID</code>
 +
 +</WRAP>
 +
 +
 +<WRAP info>
 +**NOTE:**  The options used against the bottom line shown in the config are:
 +
 +  * **defaults**: Use default options.
 +    * The default depends on the kernel and the filesystem.
 +  * **allow_other**:  To make the drive available to regular users.
 +  * **nonempty**:  Mount the filesystem on to an existing (non-empty) directory.
 +  * **moveonenospc=true**:  If a write fails with ENOSPC (no space left on device) or EDQUOT (disk quota exceeded) the policy selected will run to find a new location for the file.
 +    * An attempt to move the file to that branch will occur (keeping all metadata possible) and if successful the original is unlinked and the write retried. (default: pfrd).
 +  * **dropcacheonclose=true**:  When a file is requested to be closed call posix_fadvise on it first to instruct the kernel that we no longer need the data and it can drop its cache.
 +    * Recommended when cache.files=partial|full|auto-full|per-process to limit double caching. (default: false).
 +  * **category.create=epmfs**: Existing path, most free space.
 +    * **OLD category.create=mspmfs**: Most shared path, most free space.
 +  * **fsname=mergerfs**:
 +
 +
 +Obsolete option:
 +
 +  * **use_ino**:  Causes mergerfs to supply file/directory inodes rather than libfuse.
 +    * While not a default it is recommended it be enabled so that linked files share the same inode value.
 +    * Effectively replaced with inodecalc.
 +      * inodecalc=passthrough|path-hash|devino-hash|hybrid-hash: Selects the inode calculation algorithm. (default: hybrid-hash).
 +
 +
 +
 +See https://trapexit.github.io/mergerfs/config/options/#types
 +
 +See https://trapexit.github.io/mergerfs/config/functions_categories_policies/
 +
 +
 +</WRAP>
 +
 +----
 +
 +===== Created the new mount points =====
 +
 +<code bash>
 +sudo umount /mnt/media1 /mnt/media2 /mnt/media3
 +mkdir /srv/media
 +</code>
 +
 +----
 +
 +===== Reboot =====
 +
 +<code bash>
 +sudo reboot
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  The fstab config should take effect and mount the drives to the new mount point.
 +</WRAP>
 +
 +----
 +
 +===== Check =====
 +
 +Check if everything shows up:
 +
 +<code bash>
 +ls /srv/media
 +</code>
 +
 +returns:
 +
 +<code>
 +movies  music  photos  tvshows
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  The nified mount point should show all the data.
 +</WRAP>
 +
 +
 +----
 +
 +===== References =====
 +
 +https://github.com/trapexit/mergerfs
 +
 +https://github.com/trapexit/mergerfs/blob/2.40.2/README.md
 +
 +https://www.man7.org/linux/man-pages/man5/fstab.5.html
 +
 +https://perfectmediaserver.com/02-tech-stack/mergerfs/
  
mergerfs/combine_multiple_hard_drives_into_a_single_mountpoint.1745573026.txt.gz · Last modified: 2025/04/25 09:23 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki