To have all media held across various disks under a single mountpoint.
/srv/media |- movies |- music |- photos |- tv
NOTE: /srv/media is the unified mount point.
Get the latest release from the MergerFS GitHub page.
wget https://github.com/trapexit/mergerfs/releases/download/2.40.2/mergerfs_2.40.2.debian-bookworm_amd64.deb
NOTE: It is preferred to use the GitHub version, rather than from APT repository, as the APT one may not be the most up-to-date version.
sudo apt install mergerfs
dpkg -i mergerfs_2.40.2.debian-bookworm_amd64.deb
sudo mkdir /mnt/disk01 sudo mkdir /mnt/disk02 sudo mkdir /mnt/disk03 sudo mount /dev/sdb1 /mnt/disk01 sudo mount /dev/sdc1 /mnt/disk02 sudo mount /dev/sdd1 /mnt/disk03
NOTE: These locations and devices are just examples.
sudo mergerfs -o defaults,allow_other,use_ino,category.create=mfs,moveonenospc=true /mnt/disk01:/mnt/disk02:/mnt/disk03 /mnt/media
NOTE: The mount point for mergerfs, in this example, is /mnt/media.
cd /mnt /mnt$ ls -l ls: cannot access 'virt': No such file or directory total 0 d????????? ? ? ? ? ? virt
NOTE: If after mounting, there are problems with the permissions:
Edit /etc/fstab.
... UUID=b8548ed6-a3e9-44b2-845c-648892491c2d /mnt/disk01 ext4 errors=remount-ro 0 0 UUID=c09544b8-0dc3-4532-a1c7-31fd63c8c97e /mnt/disk02 ext4 errors=remount-ro 0 0 UUID=347f34a3-b4b1-47c9-bec9-3ea0c4aa3715 /mnt/disk03 ext4 errors=remount-ro 0 0 /mnt/disk* /mnt/media fuse.mergerfs defaults,allow_other,nonempty,moveonenospc=true,dropcacheonclose=true,category.create=epmfs,fsname=mergerfs 0 0 # Another way. #/mnt/disk01:/mnt/disk02:/mnt/disk03 /mnt/media fuse.mergerfs defaults,allow_other,nonempty,moveonenospc=true,dropcacheonclose=true,category.create=epmfs,fsname=mergerfs 0 0 #OLD /mnt/disk* /mnt/media fuse.mergerfs defaults,allow_other,nonempty,use_ino,moveonenospc=true,dropcacheonclose=true,category.create=mspmfs,fsname=mergerfs 0 0
NOTE: It is recommended to have the mount points for each drive to be /mnt/disk01, /mnt/disk02, and /mnt/disk03, and so on.
lsblk -d -o NAME,PATH,SIZE,SERIAL,UUID,LABEL
NOTE: The options used against the bottom line shown in the config are:
Obsolete option:
See https://trapexit.github.io/mergerfs/config/options/#types
See https://trapexit.github.io/mergerfs/config/functions_categories_policies/
sudo umount /mnt/media1 /mnt/media2 /mnt/media3 mkdir /srv/media
sudo reboot
NOTE: The fstab config should take effect and mount the drives to the new mount point.
Check if everything shows up:
ls /mnt/media
returns:
movies music photos tvshows
NOTE: The unified mount point should show all the data.