Install & Configure MHDDFS Virtual Storage Pool

hard-drive-stack

MHDDFS is a fuse based driver. It is used to seamlessly combine several directories or mount points into a single virtual file system. Since it is not in the Linux kernel it uses a significant amount of processing power and suffers somewhat from reduced write performance. If that is not acceptable try to Install AuFS. For home server purposes MHDDFS is perfectly acceptable and simple to set up. There are only a handful of options of which a few are essential for basic customization.

 

Mount options

The mounting process of mhddfs volume is fundamentally the same as it is outlined in Mount Partitions Automatically in Ubuntu Linux. File system argument includes the list of all mhddfs directories like this mhddfs#/mnt/disk1,/mnt/disk2,/mnt/disk3,/mnt/disk4,/mnt/disk5. Mount point is the directory like /mnt/virtual that will contain combined contents of all mhddfs directories. Type of the mhddfs is simply fuse. Options arguments can be the same as for any mount but they generally do not apply so they can be omitted. Options specific to mhddfs should also be included here. Dump should be left at it’s default value of 0 like any other mount. Pass option should be 0 as fsck should never check mhddfs volume.

 

MHDDFS Options

By default mhddfs volume will only be accessible by the user that mounted it. If the volume is mounted automatically it will generally mean that only the root user will have access. To allow access to other users as well allow_other option should be used.

Minimum limit setting is used to keep a set amount of space free on all partitions. Minimum limit value can be specified in megabytes [mM], kilobytes [kK] or gigabytes [gG] like this mlimit=25G. This limit will only be exceeded if all directories reach this limit in which case the directory with the most free space will be used. This means the limit can be set very low to spread data on all drives. If you want directories to fill up before moving on to the next drive the default of 4 GB is sufficient. The minimum allowed value is 100M. For optical performance it’s a good idea to leave 5-10% of the storage device free.

 

Install and Configure MHDDFS

Update the package list.

sudo apt-get update

 

Download latest MHDDFS, Compile and Install it or install an older version available in the repository.

sudo apt-get install mhddfs

 

Create a directory that will be used as a mount point for the virtual pool.

mkdir /mnt/virtual

 

Once all directory path exist, mount MHDDFS volume with desired options.

mhddfs /mnt/disk1,/mnt/disk2,/mnt/disk3,/mnt/disk4,/mnt/disk5 /mnt/virtual -o allow_other -o mlimit=20G

 

Mount MHDDFS at Startup

Open fstab configuration file.

nano /etc/fstab

 

Add the mount command at the end of the file.

mhddfs#/mnt/disk1,/mnt/disk2,/mnt/disk3,/mnt/disk4,/mnt/disk5 /mnt/virtual fuse allow_other,mlimit=20G 0 0

 

Alternatively MHDDFS could be mounted at user level by editing rc.local configuration file.

nano /etc/rc.local

 

Add the mount command at the end of the file.

mhddfs /mnt/disk1,/mnt/disk2,/mnt/disk3,/mnt/disk4,/mnt/disk5 /mnt/virtual -o allow_other -o mlimit=20G

 

Reboot to test that mhddfs is mounted automatically.

reboot

 

Quick Reference

apt-get update
apt-get install mhddfs
mkdir /mnt/virtual
nano /etc/fstab
mhddfs#/mnt/disk1,/mnt/disk2,/mnt/disk3,/mnt/disk4,/mnt/disk5 /mnt/virtual fuse allow_other,mlimit=20G 0 0
nano /etc/rc.local
mhddfs /mnt/disk1,/mnt/disk2,/mnt/disk3,/mnt/disk4,/mnt/disk5 /mnt/virtual -o allow_other -o mlimit=20G
reboot

dom