Alternatives to sshfs?

Dear all
I am using sshfs to mount a remote hard disk, as I am using this folder quite a lot (my main MyDocuments folder is there) I think it is a bit slow…

I have read that there are better alternatives for mounting partitions over ssh. Could you please pinpoint these?

B.R
Alex

On Mon, 13 Feb 2012 14:56:02 +0000, alaios wrote:

> Dear all I am using sshfs to mount a remote hard disk, as I am using
> this folder quite a lot (my main MyDocuments folder is there) I think it
> is a bit slow…
>
> I have read that there are better alternatives for mounting partitions
> over ssh. Could you please pinpoint these?

If you want to mount stuff over SSH, then sshfs is the way to do it.

There are other network file systems available (that have actual file
locking etc. as well, so are actually “real” network file systems, which
fuse-mounted filesystems aren’t) that are going to give better
performance - NFS, CIFS/SAMBA, etc.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

I once used nbd (network block device) to access a “partition” “over ssh”. I created an ssh-connection with a TCP-forwarder, and then accessed an nbd-server through this. Advantage: Raw access to the partition. Disadvantage: Raw access to the partition (the partition must not be mounted elsewhere), and you need root access on both machines to set up the nbd connection. I doubt this is faster, but you might try. Lookup ssh man-page for the TCP tunnel and nbd-client and nbd-server man-pages for the nbd connection.

Besides, you might tweak ssh’s encryption settings if you have slow machines and a fast network. Otherwise any solution will be limited by network speed.

Yarny

I am posting here my sshfs- fstab entry in the case I have done some major mistake ( i have edited the confidential parts, user names and paths)

sshfs#username@myserver:/storage/Data    /home/myuser/Documents/Data        fuse comment=sshfs,rw,exec,uid=1000,allow_other,reconnect,transform_symlinks,BatchMode=yes,nonempty,noauto 0 0

And, does it work?

Could you please help me offload a bit my cpu by pushing more my network? I guess that it is at least 100mb switches that connects my pc with the server.

Regards
Alex

The following procedure mounts the filesystem in the block device “/dev/sdz” on the machine “server” onto the directory “/mnt” on the machine “client”. This is done via nbd (network block device). As a result the filesystem logic is done on the machine “client”. I doubt that there will be a considerable speed advantage, but if your “server” is very slow and your client and network are quite fast, it’s possible. You will have to replace strings like “/dev/sda”, “/mnt” and “server” with the actual names.

Your ssh daemon should already be running on the server, otherwise you couldn’t have used sshfs. Install package “nbd” on both machines. Login at “server” as root, then:


$ nbd-server 127.0.0.1:60000 /dev/sdz

Add “-r” to the command line to enforce read-only access (you can only mount read-only later with this). Caution: This command allows any local user to access this block device on “server”.

On the client, connect to the server with ssh (as ordinary user, if you want):


$ ssh -c blowfish-cbc -L 127.0.0.1:60000:127.0.0.1:60000 server

The blowfish cipher is said to be quite fast, hence not eating too much CPU power on the server and client. Caution: This command allows any local user on “client” to access the block device on “server”. Don’t close this ssh-connection while the file system is mounted!

Now login as root on “client”, and mount the device with:


$ modprobe nbd
$ nbd-client localhost 60000 /dev/nbd0
$ mount /dev/nbd0 /mnt

Your filesystem should now appear in /mnt, subject to access restrictions and privileges based on the user accounts on the machine “client”. In a multi-user environment, this might lead to unexpected results and even security risks! On the other hand, if you’re the only user of “client” and “server”, there shouldn’t be any serious problems. And if your machines are connected via a secure link, you can skip the ssh tunnel entirely (thus saving more CPU power) and connect the nbd-server and nbd-client directly.

To unmount everything:


$ umount /mnt
$ nbd-client -d /dev/nbd0

Now you can close the ssh connection.

Yarny

I would like to thank you for the time spent to reply this … I will try it and post back.

Alex