I hurt my back lifting cement mix for the garden wall into the trailer, so I've taken the day, seen the oseteopath and bought "Linux Journal" for a bit of dead tree reading on the couch.
While flicking through it I came across mention of backuppc http://backuppc.sourceforge.net/index.html as a good backup application.
Given that I have got much of the data I want backed up already going to the Thecus N4200 via locally run rsync scripts, I figure it's time to get things sorted out a little better and where I can centralised.
Backuppc certainly seems to be the go.
I've installed backuppc on my debian server with a simple apt-get install backuppc.
The only thing I need to change is the password for the backuppc web interface user:
htpasswd /etc/backuppc/htpasswd backuppc
Now the plan is to nfs mount a mount point on the N4200 on the server and have all backups located here where we have RAID 5. The server itself is just a desktop PC with only 1 hard drive, a recipe for disaster.
Creating the mount point on the server is simple, just the usual mkdir command(s).
Creating the Folder on the Thecus requires access to the web interface, then ShareFolder.
I created backuppc on the root. I added in the NFS permissions.
I then created the relevant entry in my fstab and mounted the filesystem.
All going fairly well at this point.
I change the TopDir path to point to my the nfs mounted directory and restart the server.
I'm just accepting the inital defaults to see if I can kick off a backup of local host.
<pre>
2011-04-04 12:21:55 Can't create a test hardlink between a file in /mnt/nas/backuppc/pc/localhost and /mnt/nas/backuppc/cpool. Either these are different file systems, or this file system doesn't support hardlinks, or these directories don't exist, or there is a permissions problem, or the file system is out of inodes or full. Use df, df -i, and ls -ld to check each of these possibilities. Quitting...
</pre>
Well, that hasn't worked so well.
Looking at the filesystem on the nas via the nfs mount on the server I can see the owner of the files is 117, the user created when backuppc installed itself, this doesn't map to any user on the N4200.
I figure that I should have a userid on the N4200 that matches the userid of the backuppc account on the server.
You can create a new user on the N4200 via the admin web interface under User and Group Authentication.
So I create a backuppc user try to set its userid to 117, this fails, I have to user a userid > 1000, so I create it with 1117.
Now I have to set the backuppc userid on the server to 1117, I do this editing the passwd file and run the find command to chmod the files to backuppc.backuppc.
I used this link: http://it.toolbox.com/blogs/locutus/how-to-change-a-users-uid-and-gid-26368 as the basis for my userid changing requirements.
<pre>
find / -user 117 -exec chown backuppc.backuppc {} \;
</pre>
Now that I have userid the same on both, I now add the backuppc user on the N4200 to the backuppc folder I created ealier, under Storage, click on ShareFolder, click on backuppc folder and then the ACL button at the top, add backuppc as writable, Apply.
Now to see if this works.
FAIL.
Seems that my command broke all the permissions to the directories and files such that backuppc web interface no longer works.
The correct way to chown was to just chown the owner of the file like so:
<pre>
find / -user 117 -exec chown backuppc {} \;
</pre>
So rather than fight this process, I'm going to uninstall and then reinstall backuppc as little has been done with the setup.
<pre>
apt-get --purge remove backuppc
apt-get install backuppc
</pre>
once done, I have a working web site again and the user is mapped to backuppc which is the right userid I need for the mapping between the server and the N4200.
I edit the /etc/backuppc/config.pl file and change the TopDir to point to the server's nfs mount point for the NAS.
Save the change, restart the service and refresh the web admin page.
With nothing to loose, click "full backup". The NAS ( yes I can hear it ) makes a bit of noise as the intitial part of the backup kicks off, a quick check to see if we have any errors....
<pre>
2011-04-04 14:00:01 localhost: test hardlink between /mnt/nas/backuppc/pc/localhost and /mnt/nas/backuppc/cpool failed
</pre>
That would be a fail!
Back to googling.
Recent Comments