fstab and sshfs

Mark Geisert mark@maxrnd.com
Sat May 3 05:15:17 GMT 2025


Hi David,
On 5/2/2025 7:22 PM, David Christensen via Cygwin wrote:
> cygwin:
>> I am attempting to mount a directory from a FreeBSD computer:
>> 2025年05月02日 19:16:01 admin@dq67sw ~
> $ ssh dpchrist@f5 freebsd-version -kru
> 13.4-RELEASE-p3
> 13.4-RELEASE-p3
> 13.4-RELEASE-p5
>> 2025年05月02日 18:51:15 admin@dq67sw ~
> $ ssh dpchrist@f5 uname -a
> FreeBSD f5.tracy.holgerdanske.com 13.4-RELEASE-p3 FreeBSD 13.4-RELEASE- 
> p3 GENERIC amd64
>> 2025年05月02日 19:08:29 admin@dq67sw ~
> $ ssh dpchrist@f5 ls -ld /var/local/samba/dpchrist
> drwxr-xr-x  104 dpchrist  dpchrist  105 Apr 30 00:45 /var/local/samba/ 
> dpchrist
>>> Onto a Windows 10 Home computer:
>> 2025年05月02日 18:53:47 admin@dq67sw ~
> $ systeminfo | grep OS
> OS Name:                   Microsoft Windows 10 Home
> OS Version:                10.0.19045 N/A Build 19045
> OS Manufacturer:           Microsoft Corporation
> OS Configuration:          Standalone Workstation
> OS Build Type:             Multiprocessor Free
> BIOS Version:              Intel Corp. SWQ6710H.86A.0068.2017.0601.1423, 
> 6/1/2017
>> 2025年05月02日 19:14:14 admin@dq67sw ~
> $ ls -al /samba
> total 4
> drwxr-xr-x 1 admin None           0 May  2 19:05 .
> drwxr-xr-x 1 admin Administrators 0 Apr 28 12:03 ..
>>> Using WinFsp and Cygwin:
>> 2025年05月02日 18:59:11 admin@dq67sw ~
> $ /cygdrive/c/Program\ Files\ \(x86\)/WinFsp/bin/fsptool-x64.exe ver
> 2.0 (SxS=20250430T013040Z)
>> 2025年05月02日 18:53:54 admin@dq67sw ~
> $ cygcheck -c cygwin
> Cygwin Package Information
> Package              Version    Status
> cygwin               3.6.1-1        OK
>> 2025年05月02日 18:55:15 admin@dq67sw ~
> $ cygcheck -c sshfs
> Cygwin Package Information
> Package              Version    Status
> sshfs                3.7.2-2        OK
>>> I can mount and unmount the directory onto Windows from a Cygwin64 
> Terminal:
>> 2025年05月02日 18:59:36 admin@dq67sw ~
> $ sshfs dpchrist@f5:/var/local/samba/dpchrist /samba/dpchrist -o 
> uid=197609 -o gid=197121
>> 2025年05月02日 19:03:16 admin@dq67sw ~
> $ ls /samba/dpchrist | grep ^[A-Z]
> David_s_iPhone
> Downloads
> Movies
> Music
> Music-leftovers
> Pictures
> Television
> Videos
>> 2025年05月02日 19:03:21 admin@dq67sw ~
> $ fusermount3 -u /samba/dpchrist
> fusermount3: /samba/dpchrist unmounted
>> 2025年05月02日 19:05:08 admin@dq67sw ~
> $ ls /samba
>>> RTFM sshfs(1) states:
>> MOUNTING FROM /ETC/FSTAB
>        To mount an SSHFS filesystem from /etc/fstab, simply use sshfs 
> as the file system type. (For backwards compatibility, you may also use 
> fuse.sshfs).
>>> But creating an /etc/fstab entry and using mount does not work:
>> 2025年05月02日 19:07:12 admin@dq67sw ~
> $ grep dpchrist /etc/fstab
> dpchrist@samba:/var/local/samba/dpchrist /samba/dpchrist sshfs 
> noauto,uid=197609,gid=197121 0 0
>> 2025年05月02日 19:07:15 admin@dq67sw ~
> $ mount /samba/dpchrist
> mount: can't find /samba/dpchrist in /etc/fstab or in /etc/fstab.d/$USER
>>> Comments or suggestions?

Unfortunately Cygwin hasn't integrated FUSE filesystem types into 
'mount' and /etc/fstab. This is why FUSE mounts are recorded in 
/var/run/fuse.mounts rather than in the usual mount table, for example.
The sshfs man page is correct for Linux and other OSs but less so for 
Cygwin. On Cygwin any FUSE mount has a managing process; these are 
sshfs, and when available, ftpfs, memfs, etc. They do the actual mount 
and then hang around in background to support operations on the mounted 
filesystem. The Cygwin DLL doesn't know about these filesystems.
If your goal is to have "permanently" FUSE-mounted filesystems, about 
all I can suggest is to run sshfs from your first Cygwin shell after a 
system boot.
HTH,
..mark


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /