Debian/Ubuntu Tips and Tricks

Debuntu

Debian/Ubuntu Tips and Tricks

Mounting a fuse Filesystem from /etc/fstab

Posted by chantra on April 27th, 2006

Earlier on, I showed how-to mount a remote filesystem with fuse, using a remote partition accessible by SSH. Since version version 2.4.0, it is possible to use fstab to mount those kind of partition.

The current version installed on ubuntu dapper is fuse-utils-2.4.2. Unfortunately, /sbin/mount.fuse is not included in the package. I've recompiled it, submitted to revu, hopefully it is going to make its way up to the main repository. In the meanwhile you can get it from here.


FUSE comes in 4 packages:

  • fuse-source: Filesystem in USErspace (source for kernel module)
  • fuse-utils: Filesystem in USErspace (utilities), the package we are going to use here.
  • libfuse2: Filesystem in USErspace library
  • libfuse-dev: Filesystem in USErspace (development files)

EDIT: A newer fuse .deb version is available from Debuntu .deb repository , installing fuse package from the repository will include new features.

Ok, let's go to it. The packages we are going to need are fuse-utils and sshfs. Download fuse-utils_2.4.2-0ubuntu3_i386.deb and install it:

:~$sudo dpkg -i /path/to/fuse-utils_2.4.2-0ubuntu3_i386.deb

Install sshfs as well:

:~$sudo apt-get install sshfs

Now, taking the exemple used in How to: Mount a remote filesystem using SSH, SSHFS and FUSE, we are going to modify /etc/fstab :


sshfs#my-remote-user@my-remote-host:/home/my-remote-user /my-local-filesystem/remotefs fuse defaults 0 0

EDIT: Since Fuse 2.5.3, new parameters such as user and noauto can be used in fstab, so changing the previous line to:

sshfs#my-remote-user@my-remote-host:/home/my-remote-user /my-local-filesystem/remotefs fuse user,noauto 0 0

will not mount the filesystem automatically during boot (noauto) and will let a non-privileged user (but belonging to fuse group) to mount the filesystem from the command line.
And that's it, you can now mount your file system, just like other filesystem in /etc/fstab, here:

:~$sudo mount /my-local-filesystem/remotefs
my-remote-user@my-remote-host's password:

:) .

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>