Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have two RasberryPi running debian wheezy and I would like to mount a folder from computer A on computer B.

What is the best (as in most efficient) way to do this?

I can do it via SMB, but that is for windows, I think there must be a better way to share across linux.

share|improve this question
Possible copy of Download copy of file which updates on change –  dchirikov Jan 26 '13 at 20:58
add comment

3 Answers 3

up vote 3 down vote accepted

You can use plenty of things, among which, popular options are:

  • NFS
  • Samba / CIFS

By ease-of-setup I think they would have to be put in this order (top: easiest)


Through FUSE, you can mount remote filesystems via ssh. I won't cover how, as Cristopher has already very well explained that. Just note that, in order to mount the file automatically it will need a bit more of work.


It will allow you to use Windows and Unix machines to access the remote folder. If it's not a big deal for you, then you won't probably benefit from it. However, it's easy to automount it on init (just input the apropriate values at /etc/fstab, including username=<your-samba-username>,password=<your-samba-password> in the options column.


It will let you authenticate just via IP (no usernames thing = faster, only of use inside your non-hostile LAN) or via Kerberos Tickets (too painful for just two Raspberries; but useful in corporate environments).

As it has kernel mode support, it will run faster than sshfs. Besides, as there's no encryption performed it will have a better throughput, and in the case of the tiny Raspberry ARM, it may make a difference.

Besides, it's not so painful to setup simply you trust your network. You have automount support in /etc/fstab too, and you don't have to put sensitive data (such as usernames or passwords), and if you have your usernames syncrhronized (same /etc/passwd and /etc/group files) you can use the usual POSIX permissions toolset (chown, chgrp and chmod).

share|improve this answer
I use my Pi as an NFS server with a disks with mostly my movies and other media (ie not system-critical stuff, not '/home/' or anything similar). NFS allows me to watch a movie without first having to copy it to the local drive, but when writing files to the NFS disk I prefer to use rsync. I've therefore mounted my NFS disks readonly, and write stuff over SSH (with rsync). This also stops me from accidentally rsyncing to an NFS mounted disk (which is very inefficient). –  zrajm Feb 2 at 23:05
@zrajm how to you mount your disks on the pi? –  FutuToad Mar 7 at 16:30
arisu:/mnt/ytra /mnt/ytra nfs soft,ro,intr 0 2 –  zrajm Mar 11 at 22:11
add comment

SSHFS is wonderful; it can mount remote directories in a local directory.

You could install ssh on both sides:

# apt-get install ssh

On the client side, or both sides if desired, install sshfs and fuse utilities:

# apt-get install fuse-utils sshfs

Without reboot, load the kernel module:

# modprobe fuse

Create a mount point for the remote file system:

# mkdir /mnt/directory-name
# chown your-user:group /mnt/directory-name/

Add your username to the fuse group:

# usermod -a -G fuse [your-user]

My Debian creates /dev/fuse with 0600 permissions, so let the fuse group use the device:

# chmod 0660 /dev/fuse

Your user account may need to log out and in again to become a member of the fuse group. Then as the regular user...

$ sshfs remote-username@remote-server-name: /mnt/directory-name/

To mount a directory other than home, specify it after the colon:

$ sshfs remote-username@remote-server-name:/remote/directory /mnt/directory-name


fusermount -u /mnt/directory-name

The commands above use # to indicate that it was done as the root user, and the $ indicates that it was done as a regular user.

If you have a Windows machine, it too can use SSHFS with win-sshfs. This software will "map a drive" with SSHFS, so that you can have a Windows drive letter that contains the remote directory.

share|improve this answer
add comment

In linux, you would choose for NFS (also check out the article on archwiki about it which may have applicable information for your distribution aswell). It has more advanced features then samba. If you need to lock (i.e. concurrent acces) files you should look into lockd aswell because nfs is stateless. However it is harder to configure than smb. I would suggest trying both samba and nfs to see which one suits your needs.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.