Best way to mount remote folder
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.
You can use plenty of things, among which, popular options are:
- 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
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/fstabtoo, and you don't have to put sensitive data (such as usernames or passwords), and if you have your usernames syncrhronized (same
/etc/groupfiles) you can use the usual POSIX permissions toolset (
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).
Samba may confuse some unix applications, notably around permissions or what `stat()` returns, e.g. things that rely on the `nlink` count which CIFS has no notion of. SSHFS I've been not much impressed with, as it ran context switches on the fileserver up mighty high, and did not support the necessary locking required by in-house programs. So, NFS...