TEST: Mount disparate remote storage devices as if they were a single directory.
Ubuntu 14.04 "Daily cloud image" as obtained on 2014-07-31
First ensure that FUSE works; use sshfs as a test (or whatever).
$ apt-get install sshfs
$ mkdir -p mnt/host
$ sshfs -o uid=`id -u` user@host:/home/user mnt/host
$ mount | grep user@host
user@host:/home/user on /home/vagrant/mnt/host rype fuse.sshfs (rw,nosuid,nodev,user=vagrant)
$ fusermount -u ./mnt/host
Inspired by:
$ apt-get install davfs2
$ sudo dpkg-reconfigure davfs2 # enable setuid
$ sudo usermod -G davfs2 vagrant
$ sudo sh -c 'echo "https://dav.dumptruck.goldenfrog.com/dav/ /home/vagrant/mnt/dumptruck davfs rw,user,noauto 0 0" >> /etc/fstab'
$ mkdir -p mnt/dumptruck
$ mkdir .davfs2
$ echo 'https://dav.dumptruck.goldenfrog.com/dav <user> <password>' >> .davfs2/secrets
$ mount /home/vagrant/mnt/dumptruck/
$ mount | grep dumptruck
https://dav.dumptruck.goldenfrog.com/dav/ on /home/vagrant/mnt/dumptruck type davfs (rw,nosuid,noexec,nodev,_netdev,user=vagrant)
$ umount mnt/dumptruck
Any files "written" to the Dumptruck mount will be 0 bytes in size. This is a problem with the davfs configuration; the solution, for some reason, is to disable locks.
$ echo 'use_locks 0' >> .davfs2/davfs2.conf
- https://romanrm.net/mhddfs
- http://serverfault.com/questions/191299/can-we-mount-multiple-disks-as-one-directory
$ sudo apt-get install mhddfs
$ mkdir mnt/mhddfs
** mount sshfs and dumptruck
$ mhddfs /home/vagrant/mnt/dumptruck/,/home/vagrant/mnt/host /home/vagrant/mnt/mhddfs/
$ mount | grep mhddfs
/home/vagrant/mnt/dumptruck/;/home/vagrant/mnt/host on /home/vagrant/mnt/mhddfs type fuse.mhddfs (rw,nosuid,nodev,user=vagrant)
$ fusermount -u /home/vagrant/mnt/mhddfs
Totally works.
$ sudo apt-get install unionfs-fuse
$ mkdir -p mnt/unionfs
** mount sshfs and dumptruck
$ unionfs-fuse /home/vagrant/mnt/host=RW:/home/vagrant/mnt/dumptruck=RW /home/vagrant/mnt/unionfs
$ mount | grep unionfs
unionfs-fuse on /home/vagrant/mnt/unionfs type fuse.unionfs-fuse (rw,nosuid,nodev,default_permissions,user=vagrant)
$ fusermount -u /home/vagrant/mnt/unionfs
Also totally works - behaves just like mhddfs, in fact.
$ sudo apt-get install linux-image-extra-virtual aufs-tools
$ mkdir mnt/aufs
** mount sshfs and dumptruck
$ sudo mount -t aufs -o br:/home/vagrant/mnt/host=rw:/home/vagrant/mnt/dumptruck=rw none /home/vagrant/mnt/aufs
mount: wrong fs type, bad option, bad superblock on none,
$ $ dmesg | tail -n 1
[ 3641.846489] aufs au_wbr_init:378:mount[11621]: /(fuse), unsupported namelen 0
Didn't work. Dunno.