Quantcast

problem to mount sshfs with mount ...

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem to mount sshfs with mount ...

Petr Klíma
Hello

I have a problem to find how mount sshfs

this does work:
# sshfs 'root@tux:/' '/mnt/ramecek'
root@tux's password:
[root@klima-pc mnt]# ls /mnt/ramecek
base  bin  boot  dev  etc  home  initrd  lib  lost+found  mnt  opt  proc
  root  sbin  tftpboot  tmp  usr  var


but this does not

[root@klima-pc mnt]# mount -t fuse 'root@tux:/' '/mnt/ramecek'
mount: wrong fs type, bad option, bad superblock on root@tux:/,
        or too many mounted file systems

[root@klima-pc mnt]# mount -t fuse 'sshfs#root@tux:/' '/mnt/ramecek'
mount: wrong fs type, bad option, bad superblock on sshfs#root@tux:/,
        or too many mounted file systems


I use strace and I find it is looking for /sbin/mount.fuse but it does
not exist ... I cant find it in fuse sources ...

[root@klima-pc mnt]# strace mount -t fuse 'root@tux:/' '/mnt/ramecek'

.............
getuid32()                              = 0
geteuid32()                             = 0
lstat64("/etc/mtab", {st_mode=S_IFREG|0644, st_size=489, ...}) = 0
stat64("/sbin/mount.fuse", 0xbfe92c60)  = -1 ENOENT (No such file or
directory)
rt_sigprocmask(SIG_BLOCK, ~[TRAP SEGV RTMIN RT_1], NULL, 8) = 0
mount("root@tux:/", "/mnt/ramecek", "fuse", 0xc0ed0000, 0) = -1 EINVAL
(Invalid argument)
.............


What is wrong ?


    Petr Klíma

    JIHOMILK a.s.
    Rudolfovská 246/83
    370 50 České Budějovice
    Czech Rpublic

    phone:   +420 389 136 209
    e-mail:  [hidden email]




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: problem to mount sshfs with mount ...

Vincenzo Ciancia
Petr Klíma wrote:

> Hello
>
> I have a problem to find how mount sshfs
>
> this does work:
> # sshfs 'root@tux:/' '/mnt/ramecek'
> root@tux's password:
> [root@klima-pc mnt]# ls /mnt/ramecek
> base  bin  boot  dev  etc  home  initrd  lib  lost+found  mnt  opt  proc
>   root  sbin  tftpboot  tmp  usr  var
>
>
> but this does not
>
> [root@klima-pc mnt]# mount -t fuse 'root@tux:/' '/mnt/ramecek'
> mount: wrong fs type, bad option, bad superblock on root@tux:/,
>         or too many mounted file systems

The executable code for sshfs is compiled into the sshfs executable, while
the fuse kernel module (and the corresponding "fuse" filesystem type) is
only a wrapper which, alone, can't mount anything. So the correct usage of
sshfs and other fuse filesystems is to use the filesystem executable. There
are many fuse-based filesystems, each one with its own executable.

In other words, if you look at your second attempt, you will see no way to
tell the "fuse" module what protocol to use to mount "root@tux:/", and
other information like the password for example. This is the task of the
sshfs executable.

V.

--
Please note that I do not read the e-mail address used in the from field but
I read vincenzo_ml at yahoo dot it
Attenzione: non leggo l'indirizzo di posta usato nel campo from, ma leggo
vincenzo_ml at yahoo dot it



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: problem to mount sshfs with mount ...

Petr Klíma
Vincenzo Ciancia napsal(a):

> Petr Klíma wrote:
>
>
>>Hello
>>
>>I have a problem to find how mount sshfs
>>
>>this does work:
>># sshfs 'root@tux:/' '/mnt/ramecek'
>>root@tux's password:
>>[root@klima-pc mnt]# ls /mnt/ramecek
>>base  bin  boot  dev  etc  home  initrd  lib  lost+found  mnt  opt  proc
>>  root  sbin  tftpboot  tmp  usr  var
>>
>>
>>but this does not
>>
>>[root@klima-pc mnt]# mount -t fuse 'root@tux:/' '/mnt/ramecek'
>>mount: wrong fs type, bad option, bad superblock on root@tux:/,
>>        or too many mounted file systems
>
>
> The executable code for sshfs is compiled into the sshfs executable, while
> the fuse kernel module (and the corresponding "fuse" filesystem type) is
> only a wrapper which, alone, can't mount anything. So the correct usage of
> sshfs and other fuse filesystems is to use the filesystem executable. There
> are many fuse-based filesystems, each one with its own executable.

OK

This confused me
[root@klima-pc ~]# mount
....
sshfs#root@tux:/ on /mnt/ramecek type fuse (rw)
....

> In other words, if you look at your second attempt, you will see no way to
> tell the "fuse" module what protocol to use to mount "root@tux:/", and
> other information like the password for example. This is the task of the
> sshfs executable.
>

but i prevents me from mounting an FUSE fs on boot time

it would be nice if you can write something like:

# mount(.fuse) -t fuse -o opt1=1,opt2=2 'root@tux:/' '/mnt/ramecek'

it should make life really easier

I know /sbin/mount.fuse should know what binary represents what
fusefilesystem but it shoul be easy to do.














> V.
>


--

    Petr Klíma

    JIHOMILK a.s.
    Rudolfovská 246/83
    370 50 České Budějovice
    Czech Rpublic

    phone:   +420 389 136 209
    e-mail:  [hidden email]




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: problem to mount sshfs with mount ...

Miklos Szeredi
> OK
>
> This confused me
> [root@klima-pc ~]# mount
> ....
> sshfs#root@tux:/ on /mnt/ramecek type fuse (rw)
> ....
>
> > In other words, if you look at your second attempt, you will see no way to
> > tell the "fuse" module what protocol to use to mount "root@tux:/", and
> > other information like the password for example. This is the task of the
> > sshfs executable.
> >
>
> but i prevents me from mounting an FUSE fs on boot time
>
> it would be nice if you can write something like:
>
> # mount(.fuse) -t fuse -o opt1=1,opt2=2 'root@tux:/' '/mnt/ramecek'
>
> it should make life really easier
>
> I know /sbin/mount.fuse should know what binary represents what
> fusefilesystem but it shoul be easy to do.

Yes, a generic /sbin/mount.fuse would be nice.  It could make the
assumption, that the name of the binary can be derived from the
"device" parameter if it's the same as the filesystem type.

For example:

  mount -t fuse "sshfs#root@tux:/" /mnt/ramecek

The "device" parameter should be of the form "fstype[#location]".
mount.fuse could cut out the part before '#' and try to execute it.

Any volunteers for this?  I'd prefer a bash script to perl/python, for
less dependencies.

Thanks,
Miklos




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: problem to mount sshfs with mount ...

Valient Gough
In reply to this post by Petr Klíma
On Monday 27 June 2005 13:17, Petr Klíma wrote:

> but i prevents me from mounting an FUSE fs on boot time
>
> it would be nice if you can write something like:
>
> # mount(.fuse) -t fuse -o opt1=1,opt2=2 'root@tux:/' '/mnt/ramecek'
>

Fuse used to include a mount.fuse python script in the util directory which
could be used this say.  Although I never used it, here are the script
comments:

[comments from fuse-2.1/util/mount.fuse]:

> This utility allows FUSE filesystems to be mounted with the regular *nix
> 'mount' command, or even be listed in /etc/fstab
>
> To enable this, you need to:
>  1. set execute-permission on this script
>  2. symlink this script into /sbin/mount.fuse
>
> Usage:
>
>  You can use this in 3 ways:
>      1.  mount -t fuse /path/to/script/or/program /path/of/mount/point
[options]
>      2.  mount -t fuse none /path/of/mount/point -o
fs=/path/to/script/or/prog[,
> opt=val...]
>      3.  in /etc/fstab, add:
>            /path/to/script/or/prog /path/of/mount/point fuse noauto[,...]
>

I don't know what happened to it in later versions of Fuse.

Valient


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: problem to mount sshfs with mount ...

Petr Klíma
In reply to this post by Miklos Szeredi
>
> Yes, a generic /sbin/mount.fuse would be nice.  It could make the
> assumption, that the name of the binary can be derived from the
> "device" parameter if it's the same as the filesystem type.
>
> For example:
>
>   mount -t fuse "sshfs#root@tux:/" /mnt/ramecek
>
> The "device" parameter should be of the form "fstype[#location]".
> mount.fuse could cut out the part before '#' and try to execute it.
>
> Any volunteers for this?  I'd prefer a bash script to perl/python, for
> less dependencies.
>
> Thanks,
> Miklos
>
>
====================================================================
#!/bin/bash
#
# FUSE mount helper
# Petr Klima <[hidden email]>
# Thanks to Miklos Szeredi <[hidden email]>
# to kick me to the right way
#

VERSION="0.0.1"
PRGNAME=`basename $0`

USAGE="${PRGNAME} version ${VERSION}
usage: ${PRGNAME} fusefs_type#[mountpath] mountpoint [FUSE options]

        example: ${PRGNAME} sshfs#root@tux:/ /mnt/tuxssh -o rw
"

function die {
        echo -e "$PRGNAME# $1" >&2
        [ -z "$2" ] && exit 128
        exit "$2"
}

[ "$#" -ge 2 ] || die "${USAGE}"

FSTYPE=${1%%\#*} # for now i have to be same as FUSE mount binary
                 # should be configurable

FSBIN=`which ${FSTYPE} 2>/dev/null` \
        || die "Can not find FUSE mount binary for FS ${FSTYPE}" 1

MOUNTPATH=${1#*#}

# was there an # in $1
[ "$1" = "$MOUNTPATH" ] && MOUNTPATH=""

MOUNTPOINT="$2"
[ -d "${MOUNTPOINT}" ] || die "Directory ${MOUNTPOINT} does not exist"

shift
shift

OPTIONS="$@"

${FSTYPE} ${MOUNTPATH} ${MOUNTPOINT} ${OPTIONS}

====================================================================

    Petr Klíma

    JIHOMILK a.s.
    Rudolfovská 246/83
    370 50 České Budějovice
    Czech Rpublic

    phone:   +420 389 136 209
    e-mail:  [hidden email]




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: problem to mount sshfs with mount ...

Petr Klíma
In reply to this post by Valient Gough
>>it would be nice if you can write something like:
>>
>># mount(.fuse) -t fuse -o opt1=1,opt2=2 'root@tux:/' '/mnt/ramecek'
>>
>
>
> Fuse used to include a mount.fuse python script in the util directory which
> could be used this say.  Although I never used it, here are the script
> comments:
>
> [comments from fuse-2.1/util/mount.fuse]:

sorry but in 2.3.0 it disapears ...

$ ls fuse-2.3.0/util/
fusermount.c  Makefile.am  Makefile.in


     Petr Klíma

    JIHOMILK a.s.
    Rudolfovská 246/83
    370 50 České Budějovice
    Czech Rpublic

    phone:   +420 389 136 209
    e-mail:  [hidden email]






-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: problem to mount sshfs with mount ...

Miklos Szeredi
In reply to this post by Valient Gough
>
> Fuse used to include a mount.fuse python script in the util directory which
> could be used this say.  Although I never used it, here are the script
> comments:
>
> [comments from fuse-2.1/util/mount.fuse]:
> [...]
>
> I don't know what happened to it in later versions of Fuse.

I removed it.  It was unmaintained, and I didn't really like that it
was a python script (not because I don't like python, but because not
everybody has it installed).

Miklos


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: problem to mount sshfs with mount ...

Miklos Szeredi
In reply to this post by Petr Klíma
> ====================================================================
> #!/bin/bash
> #
> # FUSE mount helper
> # Petr Klima <[hidden email]>
> # Thanks to Miklos Szeredi <[hidden email]>
> # to kick me to the right way
> #


Thanks, added to CVS.

For me an "export PATH" is needed before starting the filesystem
(otherwise it won't find /usr/local/bin/fusermount).  I don't really
see the reason why PATH is not passed to the mount script...

Miklos


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: problem to mount sshfs with mount ...

Vincenzo Ciancia
In reply to this post by Petr Klíma
Ouch, you beat me, I implemented it too, but your is more professional so I
will retire :)

However, for this to work, at least on my system, fusermount or a symlink to
it has to be in /usr/bin and not in /usr/local/bin, or else it says

fuse: failed to exec fusermount: Invalid argument

I think this is because forked processes get somewhat their PATH reset for
security reasons but don't know.

Perhaps this might be considered a bug in the fuse libraries that should
know where the fusermount utility is located instead of looking for it in
the path, but I am not sure.

bye and thanks

Vincenzo

--
Please note that I do not read the e-mail address used in the from field but
I read vincenzo_ml at yahoo dot it
Attenzione: non leggo l'indirizzo di posta usato nel campo from, ma leggo
vincenzo_ml at yahoo dot it



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: Re: problem to mount sshfs with mount ...

Miklos Szeredi
> Ouch, you beat me, I implemented it too, but your is more professional so I
> will retire :)
>
> However, for this to work, at least on my system, fusermount or a symlink to
> it has to be in /usr/bin and not in /usr/local/bin, or else it says
>
> fuse: failed to exec fusermount: Invalid argument
>
> I think this is because forked processes get somewhat their PATH reset for
> security reasons but don't know.
>
> Perhaps this might be considered a bug in the fuse libraries that should
> know where the fusermount utility is located instead of looking for it in
> the path, but I am not sure.

Hmm, yes, the library ought to know.  Maybe it should try to find it
in the path, and if that fails, fall back on the install directory
determined at configure time.

I'll fix that.

Thanks,
Miklos


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: problem to mount sshfs with mount ...

Vincenzo Ciancia
In reply to this post by Miklos Szeredi
Miklos Szeredi wrote:

>
> For me an "export PATH" is needed before starting the filesystem
> (otherwise it won't find /usr/local/bin/fusermount).  I don't really
> see the reason why PATH is not passed to the mount script...
>

It is passed to the mount script, I tried with echo $PATH, but it's not
passed to the fuse library, maybe because there is a fork?

V.


--
Please note that I do not read the e-mail address used in the from field but
I read vincenzo_ml at yahoo dot it
Attenzione: non leggo l'indirizzo di posta usato nel campo from, ma leggo
vincenzo_ml at yahoo dot it



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: Re: problem to mount sshfs with mount ...

Miklos Szeredi
> > For me an "export PATH" is needed before starting the filesystem
> > (otherwise it won't find /usr/local/bin/fusermount).  I don't really
> > see the reason why PATH is not passed to the mount script...
> >
>
> It is passed to the mount script, I tried with echo $PATH, but it's not
> passed to the fuse library, maybe because there is a fork?

That's because the PATH shell variable is automatically set by bash to
a sane value on startup, if the PATH environment variable is not set.
But it does not automatically export PATH to the environment, so any
programs started from the shell will not inherit PATH.

Miklos


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
fuse-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/fuse-devel
Loading...