Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 863515 - net-fs/autofs-5.1.8-r1 / Unable to mount SSHFS
Summary: net-fs/autofs-5.1.8-r1 / Unable to mount SSHFS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Yixun Lan
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-04 06:38 UTC by Ciaran
Modified: 2022-08-15 18:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ciaran 2022-08-04 06:38:06 UTC
I am having issues mounting SSHFS, both computers have the other root's key copied, and have no issues logging in to the other machine without a password. As well both the following commands work flawlessly


mount -t fuse.sshfs root@192.168.X.X:/root /mnt
sshfs -o rw root@192.168.X.X:/root /mnt

it appears as though the issue might be with 'spawn_mount' passing -n or something else. Again, the keys are copied, no issues logging in or manually assigning the mounts, just with autofs, it doesn't work.

I have tried many different kinds of auto.sshfs configurations, and after reading the log, I believe as long as the generic mount is phrased properly, it should work. But I have done it all the rest of the ways (w/ sshfs\#USER ... )

-----------------------------------------------------------------------------
Aug  3 23:12:50 localhost automount[27996]: lookup_mount: lookup(file): /srv/sshfs/root -> -fstype=fuse.sshfs,allow_other    root@localhost:/root                                                                                                                                         
Aug  3 23:12:50 localhost automount[27996]: parse_mount: parse(sun): expanded entry: -fstype=fuse.sshfs,allow_other  root@localhost:/root                                                                                                                                                 
Aug  3 23:12:50 localhost automount[27996]: parse_mount: parse(sun): gathered options: fstype=fuse.sshfs,allow_other                                                                                                                                                                      
Aug  3 23:12:50 localhost automount[27996]: parse_mount: parse(sun): dequote("root@localhost:/root") -> root@localhost:/root                                                                                                                                                              
Aug  3 23:12:50 localhost automount[27996]: parse_mount: parse(sun): core of entry: options=fstype=fuse.sshfs,allow_other, loc=root@localhost:/root                                                                                                                                       
Aug  3 23:12:50 localhost automount[27996]: sun_mount: parse(sun): mounting root /srv/sshfs/root, mountpoint /srv/sshfs/root, what root@localhost:/root, fstype fuse.sshfs, options allow_other
Aug  3 23:12:50 localhost automount[27996]: do_mount: root@localhost:/root /srv/sshfs/root type fuse.sshfs options allow_other using module generic
Aug  3 23:12:50 localhost automount[27996]: mount_mount: mount(generic): calling mkdir_path /srv/sshfs/root                                  
Aug  3 23:12:50 localhost automount[27996]: mount(generic): calling mount -t fuse.sshfs -o allow_other root@localhost:/root /srv/sshfs/root
Aug  3 23:12:50 localhost automount[27996]: spawn_mount: mtab link detected, passing -n to mount                                             
Aug  3 23:12:50 localhost automount[27996]: >> fuse: unknown option(s): `-n'                         
Aug  3 23:12:50 localhost automount[27996]: mount(generic): failed to mount root@localhost:/root (type fuse.sshfs) on /srv/sshfs/root        
Aug  3 23:12:50 localhost automount[27996]: dev_ioctl_send_fail: token = 157                         
Aug  3 23:12:50 localhost automount[27996]: failed to mount /srv/sshfs/root                                                       
Aug  3 23:12:50 localhost automount[27996]: handle_packet: type = 5                                                               
Aug  3 23:12:50 localhost automount[27996]: handle_packet_missing_direct: token 158, name /srv/sshfs/root, request pid 29143     
Aug  3 23:12:50 localhost automount[27996]: dev_ioctl_send_fail: token = 158                                                                 
A

---------------------------------------------------------------------------

/-      /etc/autofs/auto.sshfs  --ghost --timeout=60
#/-     /etc/autofs/auto.ftp
+auto.master

----------------------------------------------------------------------------

/srv/sshfs/root     -fstype=fuse.sshfs,allow_other  root@localhost:/root
Comment 1 Ciaran 2022-08-05 15:08:49 UTC
of note, I have also set GID,UID to 0 as well as passing the key file from the /root/.ssh/...
Comment 2 Ciaran 2022-08-05 22:16:22 UTC
Also, I run an encrypted ZFS root.
Comment 3 Ciaran 2022-08-06 16:22:41 UTC
I created a ZFS and EXT4 version of ubuntu, and threw and autofs mount on them, and both worked flawlessly, Both SUN formatted autofs entries parsed just the same and mounted the remote just fine. On UBUNTU there is no mention of the -n flag not being recognized aswell, 

do_mount goes to mount_mount to mount_generic to token = 3 , to mounted. 

Both Gentoo and Ubuntu are running 5.1.8 of autofs. On both distros, sshfs by itself and mount.sshfs works just fine, it's only autofs and only autofs on Gentoo is throwing the unrecognized flag -n. 

--- UPDATE

Aug  5 15:13:52 localhost automount[2497]: parse_mount: parse(sun): expanded entry: --fstype=fuse.sshfs,allow_other     root@localhost:/root                                        
Aug  5 15:13:52 localhost automount[2497]: parse_mount: parse(sun): gathered options: -fstype=fuse.sshfs,allow_other                                                                
Aug  5 15:13:52 localhost automount[2497]: parse_mount: parse(sun): dequote("root@localhost:/root") -> root@localhost:/root                                                         
Aug  5 15:13:52 localhost automount[2497]: parse_mount: parse(sun): core of entry: options=-fstype=fuse.sshfs,allow_other, loc=root@localhost:/root                                 
Aug  5 15:13:52 localhost automount[2497]: sun_mount: parse(sun): mounting root /srv/sshfs/root, mountpoint /srv/sshfs/root, what root@localhost:/root, fstype nfs, options -fstype=
fuse.sshfs,allow_other                                                                                                                                                              
Aug  5 15:13:52 localhost automount[2497]: mount(nfs): root=/srv/sshfs/root name=/srv/sshfs/root what=root@localhost:/root, fstype=nfs, options=-fstype=fuse.sshfs,allow_other      
Aug  5 15:13:52 localhost automount[2497]: mount(nfs): nfs options="-fstype=fuse.sshfs,allow_other", nobind=0, nosymlink=0, ro=0
Aug  5 15:13:52 localhost automount[2497]: add_host_addrs: hostname lookup for root@localhost failed: Name or service not known
Aug  5 15:13:52 localhost automount[2497]: mount(nfs): no hosts available
Aug  5 15:13:52 localhost automount[2497]: dev_ioctl_send_fail: token = 164
Aug  5 15:13:52 localhost automount[2497]: failed to mount /srv/sshfs/root
Comment 4 Ciaran 2022-08-06 16:25:00 UTC
* UBUNTU 22.04-LTS

I will try to get the source from the Ubuntu package and build in place to see if there is a change in behavior.
Comment 5 Ciaran 2022-08-06 19:07:09 UTC
Just tried to run the ubuntu binaries on Gentoo and no dice, there seems to be a incompatibility issue with fuse. I suspect the issue is with FUSE or FUSE-COMMON as it is :

Aug  3 23:12:50 localhost automount[27996]: >> fuse: unknown option(s): `-n'                         


I noticed that the same version requirements for Gentoo are not the same for Ubuntu as Ubuntu is running 2.9 of autofs w/ newer versions of fuse, but on Gentoo it's required to have a later version of autofs. The afformented unknown option is not logged in the debug output of the ubuntu 22.04LTS's.
Comment 6 Ciaran 2022-08-06 19:09:20 UTC
* running 2.9 of FUSE w/ newer versions of FUSE-COMMON, autofs is the same version on both distros. Sorry for the confusion.
Comment 7 Ciaran 2022-08-15 18:44:11 UTC
Just updated sys-fuse-2.9.9-r2 

and the problem has resolved itslef. Case closed.
Comment 8 Ciaran 2022-08-15 18:45:05 UTC
Updated to 2.9.9-r2 from 2.9.9-r1
Comment 9 Ciaran 2022-08-15 18:45:46 UTC
sys-fs/fuse. Thank you for the fix.