Mounting a Windows 2012R2 share in FreeNAS

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
I've been trying to mount an smb share inside of FreeNAS or inside of a jail for days now. I need to connect to a Windows 2012R2 server.

All I get is the following:

Code:
[root@ORL-Josh] /usr/local/etc# mount_smbfs -I 172.18.XX.XX //name@server_ip/temp /var/tmp/remote/VMLinks
Password:
mount_smbfs: unable to open connection: syserr = No such file or directory


Now I learn that FreeBSD 9's mount_smbfs only supports SMB v1 which Windows 2012R2 no longer supports. Can someone confirm this?

Any ideas how I can work around this?
 
D

dlavigne

Guest
I can't confirm it, but the FreeBSD manpage hasn't changed since 2011 so it's quite likely.
 
Joined
Apr 9, 2015
Messages
1,258
Easiest way i can think of to get around the problem is to copy the data in question to the local FreeNAS and then mount the directory into the jail and access the data that way. If this needs to be something that keeps data updated between the two boxes in nearly real time you could use Syncthing to keep both as up to date as possible, the default scan time is 60 seconds and could be reduced quite a bit. Don't know what kind of data you are working with but it's my best guess as a workaround.
 

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
Well, turns out you can re-enable the insecure SMB1 protocol on 2012R2, but that is a last resort. I'm using smbclient which work sort of like ftp but works with 2012R2. It's slow and pretty dumb but does get the job done. I'd still like mount an SMB2/3 share in FreeNAS.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Well, turns out you can re-enable the insecure SMB1 protocol on 2012R2, but that is a last resort. I'm using smbclient which work sort of like ftp but works with 2012R2. It's slow and pretty dumb but does get the job done. I'd still like mount an SMB2/3 share in FreeNAS.

I believe smbclient / mount_smbfs is SMB1 only. The Linux kernel CIFS client (mount.cifs) supports up to SMB3, but FreeBSD gets no such love.
 

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
smbclient for some reason does work. mount_smbfs does not work with Windows 2012R2.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
smbclient for some reason does work. mount_smbfs does not work with Windows 2012R2.

Ah yes. That's because I forgot that smbclient is a part of the samba suite and supports up to SMB3. On a linux system "mount.smbfs" actually calls executes "/sbin/mount.cifs". Mount_smbfs is FreeBSD-specific and presently SMB1. (Best guess). You can look at your windows server logs maybe confirm what's going on.

That said, you can probably script whatever you need to do through smbclient. A trivial example is
Code:
smbclient //192.168.42.42/foo -c 'cd "bar"; recurse; ls'
 
Last edited:

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
I am using smbclient now. Unfortunately error checking and incremental file copies are very difficult to do. The smbclient program is also very slow for file transfers.
 

dpearcefl

Contributor
Joined
Aug 4, 2015
Messages
145
Has there been any change on this issue with mount_smbfs? This is literally about to overly complicate the purchase of two FreeNAS certified boxes.
 
Last edited:

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Has there been any change on this issue with mount_smbfs? This is literally about to overly complicate the purchase of two FreeNAS certified boxes.
Is there a reason this would have changed?

It's not intended to mount a remote share within the NAS, so I doubt anyone is going to bother to fix it.
 

DAXQ

Contributor
Joined
Sep 5, 2014
Messages
106
Wow ... and that last comment seems to be holding true here in 2020 - apparently no-one in the FreeBSD or FreeNAS world has any need to ever mount a remote SMB/CIFS share with anything higher than Windows XP. Did a very small experimental trot in OMV and was really impressed by everything until Linus said NO ZFS. So I came back to FreeNAS and wanted to give the latest and greatest a twirl - the very first road block I run into is - it was very easy to mount cifs/smb shares on Windows computers and rsync data back to the NAS - with freeBSD and FreeNAS 11.3-U1 I cannot find a way to mount a MS Windows 10 share. Searching most everything out there talks about the other way round (mounting to FreeNAS FROM windows - which for me works flawlessly every time).

dpearcefl: did you ever find a solution to the issue, is there something I am missing.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Microsoft does provide an NFS server for Windows Server - possibly that's a better approach?
 
Joined
Jan 4, 2014
Messages
1,644
@DAXQ Have you considered using DFS?
 

DAXQ

Contributor
Joined
Sep 5, 2014
Messages
106
Microsoft does provide an NFS server for Windows Server - possibly that's a better approach?

It could be, but I would like to remove the Windows Servers not use them as a stepping stone to the desktops. Right now I use a Windows server to back up desktops, then copy it to the FreeNAS box. Would like to just have the FreeNAS box do itself - and would think it should be totally capable to handle the task. Really surprised that the documentation and mount_smbfs is still using old versions. That aside - even more surprised that other methods of mounting cifs/smb shares don't exists or that no-one else needs this. Maybe I am just missing something.

Not familer with DFS?
 

DAXQ

Contributor
Joined
Sep 5, 2014
Messages
106
(Distributed File System) Think I found your write up (icon looks the same) https://hendroff.wordpress.com/2019/03/19/freenas-and-samba-standalone-dfs/ And that sounds fine, but currently I have a 10 line script that rolls across the network mounting remote PC's and grabs the data needed. Pretty simple stuff if only I could mount a remote smb file system. Its not really even that, its more surprising to me that this is not common, I must just be old school and beating a dead horse that no one else does or needs.
 
Joined
Jan 4, 2014
Messages
1,644
Not familer with DFS?

Distributed File System might be an option to consider. I don't know that it goes far enough for what you're trying to achieve. It just needs to be unlocked in FreeNAS. I suggest you google FreeNAS and Samba Standalone DFS for more information and see if it suits.

EDIT: You got in just before I did ;)
 
Last edited:

DAXQ

Contributor
Joined
Sep 5, 2014
Messages
106
So basically they should just own it and say "freeBSD and freeNAS will not mount smb of cifs file systems".
That would be the right thing to do, why even include the utility mount_smbfs?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Because you would have to actively remove it. It is part of FreeBSD base. You will hardly need /usr/games/fortune or cc, either ...
Edit: I agree iX could document that it is mostly useless for any modern version of Windows ...
 

DAXQ

Contributor
Joined
Sep 5, 2014
Messages
106
Suppose I get that - doesn't make sense to me to keep around old utilities that can no longer be used (isn't that lowering the overall security footprint of the OS or something ;)). It also causes the plethora of out dated documentation out there that is no longer valid to continue to persist.

Anyway, so to do what I needed (wanted) to have done, I can use the latest greatest FreeNAS 11.3-U1 (soon to be TrueNAS 12 sweet) and this looks and seem to work great (kudos to those folks), except for the mounting of cifs shares. So I install the latest and greatest Debian buster as a small VM on the freeNAS box beehyve. Then use NFS in Debian to mount the freeNAS pool, and CIFS in Debian to mount the windows shares, run the Rsync - boom move on to the next one. Guess its just a little Linux helper for the FreeBSD inability. Seems overly complex to have to install another OS, and add the lag created for processing - but I suppose I should be grateful I can still use this "Old fashion way" to get the job done. Haven't actually run a full back, but I am hopeful this will work out and really seems a bit less complex than the DFS approach. Thanks to all who replied on this old post.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Hmmm ... if that is all you essentially need, isn't there an rsync server for Windows?

Patrick
 
Top