Koozali.org: home of the SME Server

[SOLVED] Connecting to a NFS share for backups.

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
[SOLVED] Connecting to a NFS share for backups.
« on: December 08, 2014, 11:51:11 PM »
I need a walk-through or a link to documentation on how to use the server-manager to set up backups to a NFS share.  I am backing to a NAS4Free server.  In the NFS service configuration, I have set up a share /mnt/TEST/.

In the server-manager under "backup or restore", I have tried various permutations of a file name, /mnt/, /mnt, /mnt/TEST/, /mnt/TEST, etc, etc, etc, but when I try "verify workstation backup", I am getting an error,

Code: [Select]
Unable to mount workstation shared folder mount: wrong fs type, bad option, bad superblock on XXX.XXX.XXX.XXX:/mnt/TEST/, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so
Is it the wrong path, am I missing a setting on the NAS?  How can I troubleshoot this problem?
« Last Edit: December 11, 2014, 07:11:08 PM by LANMonkey »

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: Connecting to a NFS share for backups.
« Reply #1 on: December 09, 2014, 12:18:00 AM »
--
qui scribit bis legit

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Connecting to a NFS share for backups.
« Reply #2 on: December 09, 2014, 12:51:24 AM »
Have you read the wiki http://wiki.contribs.org/Backup_with_dar#NFS
and relevant Bug http://bugs.contribs.org/show_bug.cgi?id=7006

That worked.

Now I am getting a different error:

Code: [Select]
No directory for your host in shared folder. Maybe your host name is different from backup ones
I had some confusion over the "authorized network".  My LAN is like 123.123.123.1, 123.123.123.2, etc.  So I assume the setting is 123.123.123.0/24.  Right?

The shares I have set up are /mnt, /mnt/TEST.

What else might be causing a problem?

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: Connecting to a NFS share for backups.
« Reply #3 on: December 09, 2014, 03:48:28 AM »
I don't see a Item called  "authorized network" but there is a "Workstation IP or hostname" put the local ip of the NAS here eg 192.168.1.69

The backup share is simply the directory ie  "TEST" or "mnt/test" whatever you have called it.

Also you may need this from the cli
ln -s /etc/init.d/portmap /etc/rc7.d/S92portmap

See Bug 7006
--
qui scribit bis legit

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Connecting to a NFS share for backups.
« Reply #4 on: December 09, 2014, 08:43:52 PM »
No progress.

In SME, I apply "showmount -e XXX.XXX.XXX.XXX"  and return,

"Export list for XXX.XXX.XXX.XXX:
/mnt           XXX.XXX.XXX.0
/mnt/TEST   XXX.XXX.XXX.0"

In the export settings in my NAS4Free BSD box GUI for these two mount points I have XXX.XXX.XXX.XXX for the allowed host for /mnt and denied is blank. For /mnt/TEST both allowed and denied is blank.

Here is your reference in Bug 7006 in comment 5:

http://bugs.contribs.org/show_bug.cgi?id=7006#c5

Quote
Now, I don't know if this is useful (and correct for that matter), but I did find what should be done in order to be able to mount foreign NFS shares
Code: [Select]
yum install nfs-utils
ln -s /etc/init.d/portmap /etc/rc7.d/S92portmap

The first command is definitely needed, not sure about the second one though at least in the context of SME templating etc. What is certain is that if portmap is not running, I can not mount anything... The choice of rc7.d and S92 (in S92portmap) were arbitraty though.

I tried to install the utilities and it was already installed.  I tried adding the link and I still see the error, "No directory for your host in shared folder. Maybe your host name is different from backup ones" when I check the configuration in the Backup or Restore section of the SME GUI.

I try the command,  "mount -t nfs 192.168.1.3:/mnt/TEST /TEST/" on a directory I made, "mkdir /TEST" and after a period of time, I get an error, "mount.nfs: Input/output error".

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: Connecting to a NFS share for backups.
« Reply #5 on: December 09, 2014, 11:36:47 PM »
Ok so lets see your backup config

[root@smevm ~]# db configuration show backupwk

NAS must have the dir you specify "shared" or "allowed" or whatever terminology is used.
--
qui scribit bis legit

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Connecting to a NFS share for backups.
« Reply #6 on: December 10, 2014, 12:02:01 AM »
And here is some more information showing what I have to work with from the configuration panel:

http://wiki.nas4free.org/doku.php?id=documentation:setup_and_user_guide:nfs

http://wiki.nas4free.org/doku.php?id=documentation:setup_and_user_guide:services_nfs_shares

In setting up shares, I use XXX.XXX.XXX.0/24.  This is where I have the most doubts.

db configuration show backupwk:

Code: [Select]
backupwk=service
    BackupTime=20:00
    Compression=6
    CompressionProg=gzip
    DaysInSet=1
    FullDay=7
    IncNum=0
    IncOnlyTimeout=no
    Login=
    Password=
    Program=dar
    SetNum=1
    SetsMax=3
    SmbHost=192.168.1.3
    SmbShare=mnt/TEST/
    Timeout=8
    VFSType=nfs
    status=enabled

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: Connecting to a NFS share for backups.
« Reply #7 on: December 10, 2014, 12:08:03 AM »
Config looks good, the only point is I would suggest to perhaps set the

SmbShare=mnt/TEST/

to just TEST

and my experience has been it is case sensitive, certainly as far as windows goes anyway.

Can you confirm the ip of your NAS is 192.168.1.3

I have no experience with NAS settings etc...
--
qui scribit bis legit

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: Connecting to a NFS share for backups.
« Reply #8 on: December 10, 2014, 12:15:56 AM »
I do think your issues are not with SME but the NAS setup..you will need someone familiar with that interface.
--
qui scribit bis legit

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Connecting to a NFS share for backups.
« Reply #9 on: December 10, 2014, 12:16:23 AM »
Something is not right.  This is supposed to be an NFS backup, not an SMB.  Here is my report in the server-manager:

"Backup is Enabled.
Backup is made on LAN workstation 192.168.1.3 via nfs
Destination backup share folder is mnt/TEST/
Number of rotating backup sets is 3
Number of daily backups contained in each set is 1
Compression level (0-9) of backup is 6
Daily backup occurs at 20:00
Each daily backup session is cleanly timed out after 8 hours.
Full backup sessions (new backup set) are allowed everyday"

So doesn't SmbShare refer to a SMB share?

Yes, the IP address of my NAS is correct.

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: Connecting to a NFS share for backups.
« Reply #10 on: December 10, 2014, 12:27:22 AM »
This is my setup for a backup to the ip 192.168.2.1 using NFS

Backup is Enabled.
Backup is made on LAN workstation 192.168.2.1 via nfs
Destination backup share folder is backup
Number of rotating backup sets is 2
Number of daily backups contained in each set is 2
Compression level (0-9) of backup is 0
Daily backup occurs at 22:30
Each daily backup session is cleanly timed out after 8 hours.except full backups which are cleanly timed out after 24 hours
Full backup sessions (new backup set) are allowed everyday

So did you reset the "Destination backup share folder " ?

The original message is telling you there are issues with that setting/ip or on the NAS setting

"No directory for your host in shared folder. Maybe your host name is different from backup ones"

--
qui scribit bis legit

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Connecting to a NFS share for backups.
« Reply #11 on: December 10, 2014, 07:21:44 PM »
I have created a new share nfs at /mnt/nfs and tried to apply it as instructed as just "nfs".  Now my report says, "Unable to mount workstation shared folder mount: 192.168.1.3:/nfs failed, reason given by server: Permission denied"

Here are some of my settings for that share:

"Map all users to root:  No

Authorised network 192.168.1.0/24"

Here is the export list from SME,

"[root@xxxxx ~]# showmount  -e 192.168.1.3
Export list for 192.168.1.3:
/mnt/nfs  192.168.1.0
/mnt/TEST 192.168.1.0"

Is the problem the share location?  Authorised networks?

From "db configuration show backupwk" I get for SmbHost and SmbShare,

"SmbHost=192.168.1.3
SmbShare=nfs"

Attempting to mount gives the same error, so at least I think I have a reliable diagnostic tool, I don't have to go into the server-manager to see if things are working at this level.

"[root@finch ~]# mount -t nfs 192.168.1.3:nfs /TEST
mount: 192.168.1.3:nfs failed, reason given by server: Permission denied"

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
Re: Connecting to a NFS share for backups.
« Reply #12 on: December 10, 2014, 09:48:58 PM »
So doesn't SmbShare refer to a SMB share?
Not really.  The Smb properties refer to any network share used, whether SMB or NFS.  FWIW, I did have my SME 8 server backing up regularly to an NFS share on a FreeNAS server, and I now have my SME 9 server doing the same.  It required only installing the nfs-utils package.  So yes, it can be done, though it may be tricky.  My server's down at the moment, but when it comes back up I can give my configuration if it'll help.
......

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: Connecting to a NFS share for backups.
« Reply #13 on: December 10, 2014, 10:17:19 PM »
What is the IP of your SME box?

Í have no experience with a NAS so can't advise there, but I do think the issue lies with the config there.


« Last Edit: December 10, 2014, 10:25:30 PM by TerryF »
--
qui scribit bis legit

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Connecting to a NFS share for backups.
« Reply #14 on: December 10, 2014, 10:30:22 PM »
The IP of my SME server is 192.168.1.11

Quote
Í have no experience with a NAS so can't advise there, but I do think the issue lies with the config there.

"there" being on my NAS?

To be clear, I say again that my NAS is NAS4Free, not FreeNAS.  I know they are related but there might be differences.

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: Connecting to a NFS share for backups.
« Reply #15 on: December 10, 2014, 10:38:25 PM »
NAS as in the generic term which covers all forms :-)

OK, so just making sure they were on same subnet.

With the first statement above in mind have you tried changing the NAS setting for "Map all users to root" I see default is yes have you changed it? Have you tried setting it to Yes?
--
qui scribit bis legit

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
Re: Connecting to a NFS share for backups.
« Reply #16 on: December 10, 2014, 10:49:21 PM »
NASMonkey, I understand you're using NAS4Free rather than FreeNAS, but hopefully the experience of someone using FreeNAS can be useful.  Here's my SME server configuration:
Code: [Select]
[root@e-smith ~]# config show backupwk
backupwk=service
    BackupTime=23:00
    Compression=0
    CompressionProg=gzip
    DaysInSet=7
    FullDay=5
    IncNum=3
    IncOnlyTimeout=yes
    Login=
    Password=
    Program=dar
    SetNum=3
    SetsMax=4
    SmbHost=192.168.1.10
    SmbShare=mnt/tank/newsme
    Timeout=8
    VFSType=nfs
    status=enabled
......

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Connecting to a NFS share for backups.
« Reply #17 on: December 11, 2014, 06:29:10 PM »
Here is where we should have been able to stop.

That worked.

Now I am getting a different error:

Quote
No directory for your host in shared folder. Maybe your host name is different from backup ones

I had some confusion over the "authorized network".  My LAN is like 123.123.123.1, 123.123.123.2, etc.  So I assume the setting is 123.123.123.0/24.  Right?

The shares I have set up are /mnt, /mnt/TEST.

What else might be causing a problem?

"No directory for your host in shared folder. Maybe your host name is different from backup ones"

When I go into the server-manager, I select "Verify workstation backup".  I try that and get the error, "No directory for your host in shared folder. Maybe your host name is different from backup ones".

Ah, but I haven't made a backup yet, I only want to verify that I can make a backup.  When you actually make a backup, the backup creates a backup directory for your host.  This explains the report, it can't find a directory to verify a backup has been made.

When I actually test the connection from the command line in SME, I'm getting a connection, mount -t nfs 192.168.1.3:/mnt/nfs /TEST" works.  I can read files in the imported directory.

I have configured a backup and ran a test backup, and my email cron reports from do_backupwk:

"Backup terminated: pre-backup failed - status: 256"

But I'm ready to post this thread [SOLVED] based on the correction and the fact that I can make a connection from the command line.

Still, can anyone explain why the backup failed?

One of the things I see on my NAS is that I have mounted the data partition of the NAS on the exact same directory that I am mounting using nfs for the SME backup.  So the backup directory is /mnt/TEST and the mount for the data partition is also /mnt/TEST.

And also, there is only 32GB available on this little experimental NAS4Free installation and both the MySQL database and the website files is pretty big.  Can anyone tell me how to see how much space the backup would need?  That might finish this up.

I would like to suggest an option in the Backup or Restore page dropdown menu to actually verify the connection, rather than verify an existing backup

Offline DanB35

  • *****
  • 764
  • +0/-0
    • http://www.familybrown.org
Re: Connecting to a NFS share for backups.
« Reply #18 on: December 11, 2014, 06:39:37 PM »
And also, there is only 32GB available on this little experimental NAS4Free installation and both the MySQL database and the website files is pretty big.  Can anyone tell me how to see how much space the backup would need?  That might finish this up.
On the Backup and Restore panel in the server manager is an estimate of the disk space used by the configuration and data files on your system, and the note that twice that amount of space is needed on the backup share.

Quote
I would like to suggest an option in the Backup or Restore page dropdown menu to actually verify the connection, rather than verify an existing backup
I agree, and I'm pretty sure a bug report has already been filed suggesting this, but I can't find it at the moment.
......

Offline LANMonkey

  • *****
  • 350
  • +0/-0
    • Database Collection of Transcripts for the ICTY
Re: Connecting to a NFS share for backups.
« Reply #19 on: December 11, 2014, 07:09:20 PM »
Sure enough, it's right there.  I see 5GB necessary, so I should have enough space.

I am looking at "messages" in the logs and I see a backup error related to mysql.

"Dec 11 09:11:03 finch esmith::event[3611]: mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES"

I'm checking my old email, and this problem predates storage problems, so this should be the subject of another thread, if I can't fix it myself.

End of thread and problem.

Thanks to all who posted, there were definitely things that had to be fixed.  Despite the occasional gotchas, SME is still the greatest.

Offline TerryF

  • grumpy old man
  • *
  • 1,847
  • +6/-0
Re: Connecting to a NFS share for backups.
« Reply #20 on: December 11, 2014, 08:27:38 PM »
Smacks forehead..it would have been handy to have had that info at the start..

The wiki tells it all, it would be of benefit to have a close read - Workstation Backup/Verify Backup

There is a multitude of references in the forums and bugzilla, eg Bug 6921 relating to that error, all clues

In particular there will be log entries associated with the pre-backup event..

I think its time you flew solo..good luck
--
qui scribit bis legit