Thursday 22 October 2009

Automounting Filesystems in user space using afuse

Afuse is a useful utility to allow one to automount filesystems using FUSE. Below is a nifty hack shown to me by Jeremy Kerr to automount directories on remote machines using sshfs:

sudo apt-get install sshfs afuse
mkdir ~/sshfs
afuse -o mount_template="sshfs %r:/ %m" \
-o unmount_template="fusermount -u -z %m" ~/sshfs/

cat ~/sshfs/king@server1.local/etc/hostname
server1

Ben Martin has documented afuse and some useful examples here.

No comments:

Post a Comment