FreeBSD 11.3 mount network share

marcus123

Member

Reaction score: 3
Messages: 32

I would like to mount network share folders (Synology NAS, and Windows 10) from my FreeBSD 11.3, is mount_smbfs the only way?

but it seems mount_smbfs still only support SMBv1, any alternative way to mount them in SMBv2 / SMBv3?

would installing samba4 on FreeBSD help?

Thanks
 

Zvoni

Member

Reaction score: 24
Messages: 69

I have a Gluster-Volume running on 2 servers with 4 HD's in total, exported via Samba410 as a network-share.
I mount it with cifs in my fstab (not smbfs). I've seen working mount-examples with fusefs, but that didn't work for me for a reason (permissions)
 
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 32

Maybe, I will check it. If so, is below correct?

Assume 192.168.1.123:/usr/local/downloads is the share folder I need to mount:
Code:
echo 'nfs_client_enable="YES"' >> /etc/rc.conf

service nfsclient start

mkdir /mnt/test

mount -v 192.168.1.123:/usr/local/downloads /mnt/test

I have seen someone on Internet using below, but not sure whether it is necessary:
Code:
mount -t nfs -o nfsv3,nolockd 192.168.1.123:/usr/local/downloads /mnt/test
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,085
Messages: 33,642

The first command should be fine, there's rarely a need to force NFSv3.
 

Zvoni

Member

Reaction score: 24
Messages: 69

In a testrun using mount -v i'd explicitly set "-o rw" just to make sure there is no issue with read/write
 
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 32

thanks all, btw, how to mount window share? I have tried below but no luck...

192.168.1.123:/share is the share folder on win10, it's set to share to Everyone (i.e. any users)

Code:
mount -v 192.168.1.123:/share /mnt/test
do I need to set something on win10 first? any hints is welcome
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,085
Messages: 33,642

On Windows SMBv1 has been turned off completely. You can turn it back on but I really don't recommend doing that because there is malware abusing the issues inherent with SMBv1 (which is why Microsoft turned it off).

And it looks like you're trying to NFS mount an CIFS/SMB share, that's not going to work for obvious reasons.
 

Zvoni

Member

Reaction score: 24
Messages: 69

thanks all, btw, how to mount window share? I have tried below but no luck...

192.168.1.123:/share is the share folder on win10, it's set to share to Everyone (i.e. any users)

Code:
mount -v 192.168.1.123:/share /mnt/test
do I need to set something on win10 first? any hints is welcome
It's also in the Link: Do you have Password-authentication turned off on your Windows-Machine?
 

Zirias

Aspiring Daemon

Reaction score: 460
Messages: 961

It's unfortunate, but FreeBSD is currently not usable as an SMB client. AFAIK, mount_smbfs is the only option you have, and as SBMv1 is dead in practice, there's no use ...

The only sane option ATM is to use NFS instead. Windows servers support NFS, for other Windows systems, you can install 3rd party NFS services.
 

Zirias

Aspiring Daemon

Reaction score: 460
Messages: 961

Here seems to be a workaround using gvfs
See this quote from the thread over there:
So, everything OK? Not quite. The performance of the chain fuse->gvfs->smb is very poor. If you have many small files - like I have with a Maildir - you wait ages for file operations to be finished.

Now I ended up using sshfs. It is also a fuse based filesystem, but a lot faster than using gvfs (which seems to be the bottleneck in the chain mentioned above).
Doesn't sound like a workaround to me. If even sshfs works faster, this must pe practically unusable.
 
OP
marcus123

marcus123

Member

Reaction score: 3
Messages: 32

Thanks all, I hope FreeBSD would consider to add support for mounting SMBv2 / SMBv3 share
 

Zirias

Aspiring Daemon

Reaction score: 460
Messages: 961

That would be nice ideed! I guess, as always, "somebody has to do it" ;) For me personally, it was much simpler to provide my shares via NFS as well, so Windows clients use SMB and FreeBSD clients use NFS.
 

kpedersen

Daemon

Reaction score: 825
Messages: 1,827

I would enable SMBv1 on your Windows machine but use the firewall to block it (port 139 and 445).

(Actually, on Windows block everything but the programs you need, then you can avoid the telemetry and consumer "updates", creating a much more deterministic and secure install).

Set up a SSH server on your windows machine and allow it through the firewall (port 22 incoming).

Now to connect, first set up a tunnel to your server:
$ ssh -L1445:localhost:445 <your_ip>

You can now use mount_smbfs on localhost, like it was on your server.

# mount_smbfs //<username>@localhost:1445 <mountpoint>

Remember to use the gpedit.msc firewall instead of the normal one because programs can change the normal one and allow their DRM/telemetry through.

If you set up SSH with passwordless access (priv/pub keys) and you might as well do the same with your SMB server because only local users (or authenticated SSH users) can now access it, you can create a script to mount it at start up.
 
Top