LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   sshfs reports invalid free space on remote machine (https://www.linuxquestions.org/questions/linux-networking-3/sshfs-reports-invalid-free-space-on-remote-machine-431924/)

+Yan 04-05-2006 05:52 AM

sshfs reports invalid free space on remote machine
 
I'm mounting remote windows machine, via sshfs.
everything is fine, but when i try to get free space on remote machine (df -h)
it gives remote free space:
size: 7,5T (7999999992 bytes)
used: 0
free: 7,5T (7999999992 bytes)
this is not correct offcourse (remote hdd is 6.4 Gb.)
How can I obtain the real free space on remote machine using sshfs. I do not want to use samba. I want encrypted connection with public keys.

The remote machine have sshd version:
SSH-2.0-OpenSSH_3.8.1p
remote operating sysetem is windows 2000 SP4 with latest patches

Local ssh version is:
OpenSSH_4.3p1, OpenSSL 0.9.7g 11 Apr 2005

shfs --version gives:
SSHFS version 1.4
FUSE library version: 2.5.1
fusermount version: 2.5.1
using FUSE kernel interface version 7.5

my linux box is Slackware 10.2
kernel version is: 2.6.15.4
FUSE is compiled with the kernel

Trying to mount linux box gives the same strange result :(
I thing the problem is with fuse, or sshfs.

I hope somebody have the idea how to fix the problem
10x in advance and sorry for my bad english.

macemoneta 04-06-2006 03:27 PM

That's a workaround, because the current free space is not available via sftp (the protocol used by sshfs). If the destination runs out of space you will get an error, but at least this way GUI applications continue to function. SSH's sftp will need to be enhanced to provide the available free space information before sshfs can report a correct value.

+Yan 04-10-2006 05:37 AM

10x macemoneta, I found some workaround:

free_space=`ssh linux@$mashine 'cmd /c dir' | grep "bytes free" | grep "Dir(s)" | tr -s " " | cut -d ")" -f2 -s | cut -d " " -f 2 -s | tr -d \\\\000-\\\\057 | tr -d \\\\072-\\\\377`

This is not very scientific, but works for me :)
Hope it helps anybody too :)


All times are GMT -5. The time now is 09:56 PM.