LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-09-2010, 02:37 AM   #1
gjblackford
Member
 
Registered: Jul 2006
Location: Reading, UK
Distribution: Ubuntu
Posts: 68

Rep: Reputation: 15
Network share and Backups


Hi,

It has been a while since I have used Linux so this might no longer be an issue, but when I last used Linux if I had a network share (/media/Backups) and I had a backup app backing up to the Share I found that if the back software tried to run when the Share wasn't mounted then the Backups were done to the folder /media/Backups instead of the network device that was mounted as /media/Backups, does any know if this is still an issue and if it is how I can get arround it?

Thanks,




Gavin,
 
Old 11-09-2010, 08:04 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
This isn't an error the way you imply it is.

Most UNIX/Linux backup solutions backup directories. When you mount a share you mount it on a directory (which is called a mount point in that case). When you unmount the share the directory is still there. There is no way for backup software to determine whether you meant to backup a share when you told it to backup a directory. (Although many do have options for crossing nfs mount points that isn't quite the same thing.)

You apparently are used to the Windoze way of doing things where each mount of a share gets its own drive letter. That isn't the Linux way.

Many backup software packages do have options that allow you to run pre and post backup scripts. You could put in a pre script that checks to see if the share is a mount or a local directory. Alternatively you could create a script that does this then kicks off the backup from command line.

Also the reason many backup packages have an option to allow for crossing nfs mount points but don't do it by default is that it makes more sense to backup the filesystem on the system that shared it out than it does to do it on the system that has imported and mounted it. This is because:
1) Shares are often sent to multiple systems. You don't really need to do 20 backups of the same filesystem every night.
2) Shares are done over the network. This means any backup you do of a share is using network resources to essentially copy from the exporting system to the system it is mounted on. This is on top of the network bandwidth you are using to do the backup if you have a centralized backup server.

What backup software are you using?
How many times is the filesystem shared out?
Why can't it be backed up from the exporting system rather than the importing system?
Are you using automounter to mount the filesystem?
 
Old 11-09-2010, 08:22 AM   #3
gjblackford
Member
 
Registered: Jul 2006
Location: Reading, UK
Distribution: Ubuntu
Posts: 68

Original Poster
Rep: Reputation: 15
Hi,

Thanks for your reply, yes I am mainly used to Windows, but getting close to at last dumping it (just need to get work to give me a remote access from home method that doesn't require Windows!)

As for your questions, please see below

What backup software are you using?
Back In Time

How many times is the filesystem shared out?
currently the Shares are used by 2 PC's (1 Ubuntu box and 1 Win 7 box)

Why can't it be backed up from the exporting system rather than the importing system?
The backup is running from the PC and I am trying to backup to the Share on my QNAP NAS, I don't know of away of doing it the other way around.

Are you using automounter to mount the filesystem?
Not sure, how do I tell, I can tell you I am currently using Ubuntu 10.10 if this helps


Thanks,



Gavin,
 
Old 11-09-2010, 08:41 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Unfortunately I don't know "Back In Time". I see from links that it has "Options" and "Expert Options" tabs and perhaps one of those allows for the pre and post scripting I mentioned.

Since it is NAS it explains why you aren't backing up from exporting system. (Though many NAS devices provide their own snapshot technology.)

Since you share to both Windows and Ubuntu I'm wondering if this is a Samba mount rather than NFS mount on Ubuntu. (SMB/CIFS is the way Windows mounts shares and Samba allows for doing that in UNIX/Linux.)

You may want to explore the Back In Time stuff to verify it allows for backup of nfs and samba shares.

If the filesystem is a hard mount it should be in your /etc/fstab. If it is an automount it would be found in one of the files in /etc (grep for it in /etc/*auto*).
 
Old 11-09-2010, 10:15 AM   #5
gjblackford
Member
 
Registered: Jul 2006
Location: Reading, UK
Distribution: Ubuntu
Posts: 68

Original Poster
Rep: Reputation: 15
I will have to check what I have my NAS Share mounted as once I am home tonight but I do know I have both SAMBA and NFS Services enabled on the NAS.

Back In Time doe's not have options to run post-scripts, but as all it does is add a simple entry to cron I hopefully should be able to edit the cron job to mount and dismount the share

would something like this work

Code:
mount -t smbfs -o username=<username>,password=<password> //192.2.1.150/Backup /media/Backup
// Do I need to check if it has mounted here?
backintime -b
umount /media/Backup
Thanks,



Gavin,
 
Old 11-09-2010, 02:28 PM   #6
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I'd put the check before the mount not after it. No point in trying to mount if it's already there:

Something like:
Code:
if ! df /media/Backup |grep 192.2.1.150
then mount -t smbfs -o username=<username>,password=<password> //192.2.1.150/Backup /media/Backup
fi
backintime -b
umount /media/Backup
The "grep 192.2.1.150" will should only match if it finds it as a mount from that IP. Otherwise it will find it as a local filesystem (e.g. part of the root [/] filesystem) and should skip trying to mount it.

You could put another check after the mount to verify it mounted and only run the backintime after that.
 
Old 11-10-2010, 02:08 AM   #7
gjblackford
Member
 
Registered: Jul 2006
Location: Reading, UK
Distribution: Ubuntu
Posts: 68

Original Poster
Rep: Reputation: 15
Thanks for the help, gave it a try last night and all seams to ork
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Network Backups to a Terrabyte Tape drive stsvatos Linux - Software 3 01-15-2009 08:27 PM
mount windows share export to samba share -> improve network performance tuning newuser77 Linux - Server 1 07-23-2008 11:28 AM
network backups with rsync, keep deleted files somewhere else? Telexen Linux - Server 1 09-06-2007 01:24 PM
Linux network - backups, logs, push files jantman Linux - Server 1 03-24-2007 03:08 PM
Taking backups through network ashrafzia Programming 4 09-20-2006 11:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration