Windows Backups not working, SMB3?

Status
Not open for further replies.

fullspeed

Contributor
Joined
Mar 6, 2015
Messages
147
I have a powershell script which dumps backups onto a windows DFS share \\shares\backups which works great.

I pointed it at my new Freenas server and it fails with "Backup of volume C: has failed. Incorrect function."

After some research I've seen that there are some issues with SMB3 and windows backups however my minimum protocol is set to nothing so shouldn't it try and connect via SMB2?

Looking at some other threads it looks like SMB2 is actually recommended, is this still the case?
 
Joined
Oct 2, 2014
Messages
925
I have mine set to a min of NT1 (that option just appeared, idk what it was before) and a max of SMB2, as i had issues with SMB3 with my original build, and havent tinkered with it since i had issues in January of this year.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
I have mine set to a min of NT1 (that option just appeared, idk what it was before) and a max of SMB2, as i had issues with SMB3 with my original build, and havent tinkered with it since i had issues in January of this year.
I agree with Darren---set your *MAX* to SMB2 and see where you are.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Sounds like your script is broken, that error message doesn't sound like a smb error.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Some powershell cmdlets don't work with freenas. For instance, Get-SmbConnection, Get-SmbOpenFile, etc. This is because freenas isn't an actual Windows server.

If you can, post the script and I'll take a look at it.
 

fullspeed

Contributor
Joined
Mar 6, 2015
Messages
147
Sounds like your script is broken, that error message doesn't sound like a smb error.
Some powershell cmdlets don't work with freenas. For instance, Get-SmbConnection, Get-SmbOpenFile, etc. This is because freenas isn't an actual Windows server.

If you can, post the script and I'll take a look at it.

It initiates the backup, but when it goes to write craps out, it only writes the log files.

I could post the script but if it was a syntax problem it wouldn't work on my windows file servers, but it does.

What I'll do is set it to SMB2 max and see if that works to start then post my results.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
It initiates the backup, but when it goes to write craps out, it only writes the log files.

I could post the script but if it was a syntax problem it wouldn't work on my windows file servers, but it does.

What I'll do is set it to SMB2 max and see if that works to start then post my results.
I'm not looking for syntax errors. I'm looking for reasons why it works with Windows servers but not samba servers. The short answer will probably be that samba servers aren't windows servers.
 

fullspeed

Contributor
Joined
Mar 6, 2015
Messages
147
I'm not looking for syntax errors. I'm looking for reasons why it works with Windows servers but not samba servers. The short answer will probably be that samba servers aren't windows servers.

Sure

# ------------------------------------------------------------------
# function to pull windows logs and copy to remote server
# ------------------------------------------------------------------
function WriteLogs()
{
# Get logs from windows
$successlog = get-wbjob -previous 1 | select -ExpandProperty SuccessLogPath
$failurelog = get-wbjob -previous 1 | select -ExpandProperty FailureLogPath
$failuredesc = get-wbjob -previous 1 | select -ExpandProperty ErrorDescription
# write/format success log
$successfile = Get-Content $successlog
if(!(Test-Path -Path $slogpath))
{
New-Item -ItemType file $slogpath
}
Add-Content -Path $slogpath "HOST: $env:computername"
Add-Content -Path $slogpath "DATE: $date"
Add-Content -Path $slogpath "VOLUMES: $successfile".TrimEnd()
Add-Content -Path $slogpath "--------"

# write/format failure log
$failurefile = Get-Content $failurelog
if(!(Test-Path -Path $flogpath))
{
New-Item -ItemType file $flogpath
}
Add-Content -Path $flogpath "HOST: $env:computername"
Add-Content -Path $flogpath "DATE: $date"
Add-Content -Path $flogpath "FAILURES: $failurefile".TrimEnd()
Add-Content -Path $flogpath "DESCRIPTION: $failuredesc"
Add-Content -Path $flogpath "--------"
}

# ------------------------------------------------------------------
# Main
# ------------------------------------------------------------------

# Execute rotation if enabled
if ($MaxBackup -ne 0)
{
# Write-Host "Rotating Backups"
Rotation
}
# Backup folder creation
New-Item ($HomeBkpDir+"\"+$Filename) -Type Directory | Out-Null
$WBPolicy = New-WBPolicy
# Enable BareMetal functionnality (system state included)
Add-WBBareMetalRecovery -Policy $WBPolicy | Out-Null
# Add backup target

$BackupLocation = New-WBBackupTarget -network ($HomeBkpDir+"\"+$Filename)
Add-WBBackupTarget -Policy $WBPolicy -Target $BackupLocation -force | Out-Null
# Add non critical volumes
if ($Volumes -ne $null)
{
Add-WBVolume -Policy $WBPolicy -Volume $Volumes | Out-null
}
# Make this a full VSS backup as opposed to a copy backup. This will truncate Exchange logs etc...
Set-WBVssBackupOptions -policy $WBPolicy -vssfullbackup | Out-null

# Displays the backup settings prior to running the job.
$WBPolicy

# Runs the backup task.
Start-WBBackup -Policy $WBPolicy

# Write-Host "Writing Logs"
WriteLogs
 

theermine

Cadet
Joined
Sep 14, 2012
Messages
9
Did you try adding a "net use" call to your script for your remote share? I was having the same issues as you until I did. I also do a "net use <path> /delete" upon completion.
 

sfcredfox

Patron
Joined
Aug 26, 2014
Messages
340
Did you try adding a "net use" call to your script for your remote share? I was having the same issues as you until I did. I also do a "net use <path> /delete" upon completion.
Are you using the 'Windows Server Backup' utility or a backup script? - Or a script calling WSB?

I have also been unsuccessful in getting the WSB utility to be happy with a samba target from FreeNAS, or anything other than another windows server as OP stated.
 

theermine

Cadet
Joined
Sep 14, 2012
Messages
9
Are you using the 'Windows Server Backup' utility or a backup script? - Or a script calling WSB?

I have also been unsuccessful in getting the WSB utility to be happy with a samba target from FreeNAS, or anything other than another windows server as OP stated.

I'm using a PowerShell Script to invoke WSB.

I am only using my script for WSB to another Windows Server share.

I just figured I'd mention the net use since I explicitly remember blowing loads of time figuring that beast out initially and "net use" fixed it, for me.

Since I initially set my script up over a year ago though, I do not actually remember if I did my initial testing with my FreeNAS share or not. I'd test it, but I'm on the road and unable to.
 

sfcredfox

Patron
Joined
Aug 26, 2014
Messages
340
fullspeed,

Did you ever get this working? I conclusion was that WSB was doing something at the filesystem level (NTFS) that I got pissy about when it was trying to write to anything that wasn't NTFS. Come to think of it, I thought I read it has to be an NTFS target, but I'm not sure. That's why I was holding out hope it would work with FreeNAS.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
The "Start-WBBackup" cmdlet supports common parameters such as "-Verbose" and "-Debug". Replace the line
Code:
Start-WBBackup -Policy $WBPolicy
with
Code:
 Start-WBBackup -Verbose -Policy $WBPolicy


This will hopefully generate a more helpful error message. Post any new information here in the thread.
 

sfcredfox

Patron
Joined
Aug 26, 2014
Messages
340
Here's my result, same as OP. 'Incorrect function'.

I guess I'm thinking it's going to be an NTFS limiting thing? Haven't seen any posts online that say they've had sucess with WSB on Server 2012 and a NAS :(
 

Attachments

  • Error.txt
    1.1 KB · Views: 444

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Here's my result, same as OP. 'Incorrect function'.

I guess I'm thinking it's going to be an NTFS limiting thing? Haven't seen any posts online that say they've had sucess with WSB on Server 2012 and a NAS :(
Try adding the auxiliary parameter 'strict allocate = yes" to the share config for your backup target. As this may incur a performance penalty, make sure you are using a dedicated share rather than a subfolder within an existing share as your backup target.
 

fullspeed

Contributor
Joined
Mar 6, 2015
Messages
147
Try adding the auxiliary parameter 'strict allocate = yes" to the share config for your backup target. As this may incur a performance penalty, make sure you are using a dedicated share rather than a subfolder within an existing share as your backup target.

Sorry to all in this thread, priority wise this has taken a back burner as I have a lot on the go.

I'll try some of these suggestions when I get time, including the dedicated share with the aux param then update this thread.
 

fullspeed

Contributor
Joined
Mar 6, 2015
Messages
147
Update:

I created a new dataset+share with strict allocate = yes (didn't work)
Set CIFS to SMB2 max (didn't work)

It creates the directories, writes the catalog files then dies.


upload_2015-10-7_16-7-0.png


Same error as sfcredfox:

upload_2015-10-7_16-11-32.png
 
Status
Not open for further replies.
Top