HOWTO FTP Mount

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

Contents

[edit] Introduction

This HOWTO article deals with Filesystem in USErspace (FUSE), Linux Userland File System (LUFS) and (CurlFtpFS). The first two are libraries aimed at enabling the user to mount all kinds of filesystems (including ssh and ftp) at a local mountpoint. The last (CurlFtpFS) is "a filesystem for acessing FTP hosts based on FUSE and libcurl." At the time of writing, LUFS is no longer in active development (last publicized version is from 2003) while FUSE seems to become more and more mainstream, staying in active development. Therefore I suggest using either FUSE or CurlFtpFS to ensure bug and performance fixes.

[edit] FUSE

[edit] Prerequisites

You have to have File systems->Filesystem in Userspace support enabled in your kernel configuration in order to use FUSE (FUSE_FS=m or FUSE_FS=y). Otherwise you'll get compile error in the next step.

[edit] Installing and using FUSE

FUSE is easy in both installation and use. Simply execute:

# emerge sys-fs/fuse

FUSE allows you to mount a variety of filesystems. Unfortunately, currently only the sshfs module is available through portage, so we'll use that as an example:

# emerge sys-fs/sshfs-fuse

Then load the fuse module (as root):

# modprobe fuse

To mount a remote host's file system through SSH at a local mount point, all you have to do is type:

# sshfs [user@]host:[dir] mountpoint

Or

# sshfs [user@]host:[dir] mountpoint -o allow_other

To allow access to mountpoint for non-root users

To unmount a remote host's file system type:

# fusermount -u mountpoint

For more information, see:

[edit] LUFS

If LUFS tries to get the remote /etc/password file, don't worry - that's normal, it's done by the load_credentials() function.

[edit] Installing and using LUFS

Installing LUFS from portage:

# emerge sys-fs/lufs

To mount an ftp host:

# lufis fs=ftpfs,host=ftp.kernel.org /mnt/lufis/ -s 

To Unmount an ftp host:

# fusermount -u /mnt/lufis

[edit] More Information on LUFS

Specific mount options:

  • host=server : the ftp server to mount
  • port=port : the port the ftp server is listening on
  • username=user : the user to authenticate on the server
  • password=pass : the user's password
  • ftpactive : will use active data connection (the server initiates the data connection)
    instead of passive data connection (the client opens the connection)

For more information, see the man page:

# man lufs (doesn't work)

[edit] CurlFtpFS

[edit] Installing and using CurlFtpFS

Warning: 2007-10-27

Whenever I try to create a directory I get the following error and the program crashes.

mkdir: cannot create directory `tst': Software caused connection abort

Solution to the Warning above is to install the unstable version of curl.


Note: CurlFtpFS depends from FUSE so take a look to FUSE Prerequisites before emerging.


Installing CurlFtpFS from portage:

# emerge -av net-fs/curlftpfs

CurlFtpFS uses typical FTP syntax:

# curlftpfs ftp://ftp.gentoo.org/ /path/to/mountpoint 

To unmount an ftp host:

# fusermount -u /path/to/mountpoint/

/etc/fstab line:

curlftpfs#user:password@server.tld /mount/point fuse user,disable_eprt,noauto

[edit] More Information on CurlFtpFS

Additional options:

  • User and password : ftp://user:password@ftp.gentoo.org/
  • Specific port : ftp://ftp.gentoo.org:8585

For more information, see the man page:

# man curlftpfs
Personal tools