Skip to content

Instantly share code, notes, and snippets.

@phrawzty
Created July 31, 2014 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phrawzty/ee66daa218ee254289b1 to your computer and use it in GitHub Desktop.
Save phrawzty/ee66daa218ee254289b1 to your computer and use it in GitHub Desktop.
TEST: Mount disparate remote storage devices as if they were a single directory

fs test

TEST: Mount disparate remote storage devices as if they were a single directory.

Environment

Ubuntu 14.04 "Daily cloud image" as obtained on 2014-07-31

SSHfs test

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

Dumptruck test

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

0-byte files.

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

mhddfs

$ 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.

UnionFS

$ 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.

AuFS

$ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment