Linux Server Diary

The trials and tribulations of a Linux newbie trying to setup a home server.

Friday, April 25, 2008

Backup Check


After a little over a week, a quick check of the backup server shows that it's working just fine.

Labels:

Thursday, April 17, 2008

New Backup Server - Part 7

In Part 6, the full backup of the file server had started. Observant readers may note that the last post was made two days ago. That's because the backup finished after 44 hours! We backed up 143GB with a compression average of 27%.

I think I'm setup. I'll try a quick recovery, but I don't expect problems with it. Let's call this project done.

Labels:

Tuesday, April 15, 2008

New Backup Server - Part 6

Part 5 saw the localhost backup run successfully. Time to move on to the big prize, the file server.

Before I can backup my file server, I need to setup the public keys required for rsync to login to the server as root without a password. For this part of the task, the new guide is pretty limited and apparently missing some steps, so I'm reverting back to the HowToForge Guide on Page 4. The instructions are clear and complete, and it worked last time.

As I went through these steps, everything went well. The commands made sense, and the responses came back as expected. Except for the path to the home directory on the backup server. The guide said to expect /var/lib/backuppc, but instead I saw /home/backuppc. I wasn't able to change it, so I went with it.

Everything was great, until the last command which tested the connection, as it still asked for the password. I changed one thing: on the file server, I removed what I had added to the authorized_keys2 file - from = "gentry2" - and the ssh command worked.

However, my attempt at a backup still failed. What finally made it work was this: instead of using the IP address in the ssh test, I used the hostname of the server. I was asked to confirm the RSA key fingerprint once again. Then, the backup worked. Yeah!

I hope to better understand this stuff someday, but I'm just happy that it's working. (I wonder how long this full backup will take.)

Read the exciting conclusion in Part 7.

Labels:

Monday, April 14, 2008

New Backup Server - Part 5

Part 4 got the BackupPC program running, now let's try a backup of the localhost.

This whole thing with file permissions is a little confusing. I don't know if the installation program is doing something wrong, the Ubuntu installation I'm starting with is setup in an unexpected way, or if I'm messing things up. Here's the latest:

After Part 4, I was ready to try a backup, so I fired off a backup of the local system. The backup never started, and I saw this message in the log:
localhost: mkdir /backup/pc: Permission denied at /usr/share/backuppc/bin/BackupPC_dump line 193
I looked at the /backup folder's settings, and it was set to root as the owner and group. First, I changed the group to backuppc, and then I changed the groups rights to include write.
sudo chgrp -R backuppc /backup
sudo chmod -R g+w /backup
Now, the backup has started.

Unfortunately, it didn't get very far, as the log is filled with hundreds of messages like this:
BackupPC_link got error -4 when calling MakeFileLink(/backup/pc/localhost/0/f%2fetc/fprotocols, ce42ab405aca581a1cff4f0ba04ab6c4, 1)
No backup happened.

It would be nice if I knew how backuppc should be setup, but I haven't found anything yet to help me.

More later...

UPDATE: Well, I found several sites that described a solution to this problem. It seems that while BackupPC allows one to change the $TopDir setting, it isn't recommended. So, I changed it back to the default of /var/lib/backuppc and then changed the mount point in fstab to point to that directory rather than /backup. I then ran the localhost backup without issue.

In part 6, I'll attempt a backup of the file server.

Sunday, April 13, 2008

New Backup Server - Part 4

As I mentioned in Part 3, I found a new guide for the installation and configuration of BackupPC - BackupPC Setup at TakSuyama.com. I'll give it a try.

The first step is to install the pre-requisites:
sudo apt-get update
sudo apt-get install ssh samba smbfs rsync apache2
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart
So far, so good. The restart of apache2 completed without incident and I can see a default web page. Just like inPart 2, I'm receiving a hostname error from apache. I'll try to fix it the same way.

That worked well - no problems.

Next, the guide says it is time to install BackupPC.
sudo useradd backuppc
sudo passwd backuppc
sudo apt-get install backuppc
OK, the web interface for BackupPC is up. (I wish I could take a snapshot of this point, so it would be easy to go back in case of problems.)

Next, I'll change the password.
htpasswd /etc/backuppc/htpasswd backuppc
Using the Edit Config tab, I changed the TopDir to /backup, and restart the web server again - just to be sure things are still OK. And they are. I'm feeling pretty good about this.

Unfortunately, as I attempted to restart BackupPC, problems came up. Here's the error:
* Restarting backuppc...
No process in pidfile `/var/run/backuppc/BackupPC.pid' found running; none killed.
grep: /etc/backuppc/config.pl: Permission denied
BackupPC cannot be started because important parameters are missing from config.pl.
If you just upgraded BackupPC, please update /etc/backuppc/config.pl.
Which is a pretty poor error message. Why not tell me what needs to be updated?

After thinking about it a little, I looked at access settings on the file. I changed the security levels on the config.pl file with sudo chmod a+r config.pl, and I was able to get a little further. Now the error on BackupPC restart is start-stop-daemon: Unable to set gid to 1001 (Operation not permitted). Slow progress!

UPDATE: Sometimes I get worked up and miss the easy stuff. The restart of BackupPC should be performed by root, so the correct command is:
sudo /etc/init.d/backuppc restart


More in Part 5.

Labels:

New Backup Server - Part 3

In Part 2, we learned that I'm having trouble with permissions and Apache2.

These problems I'm having rebuilding the backup server have me concerned about my ability to recover in case of another disk failure. With BackupPC my backups are locked in a proprietary format. Sure, the odds of losing both the file server drive and the operating system drive on the backup server are low, but my inability to get BackupPC back up concerns me. While I have my offsite copies of the photos, but those are only burned every few months when I have enough to fill a DVD.

I've got one more thing to try, as I've found another guide that suggest installing the supporting software (apache2, rsync, etc) and confirming their operation before installing BackupPC. This may help with the apache troubles.

In order to receive warnings when backups don't work, such as the disk full error from before, I also need to get the email notifications going.

See Part 4 for the next exciting episode.

Tuesday, April 08, 2008

New Backup Server - Part 2

(This is the third time I've tried this)

In Part 1, I installed the base linux software and made a few tweaks. In this exciting episode, I'll install the backuppc software.

Just like last time, I'll follow this tutorial to install the software.

(for this version (3.0.0) at least, be sure to check 'apache 2' as the web server of choice)

During the installation, as apache was starting, I got this error:
apache2: Could not reliably determine the server's fully qualified domain name
Several sites, including this one recommend that I modify /etc/apache2/httpd.conf to include the line:
ServerName hostname
I used the same name assigned as the hostname during the Ubuntu setup.

As before, I modified the topdir setting, but I used the Edit Config option to do it.

When I attempted to restart apache2, I received some serious looking errors:
* Restarting web server apache2 httpd (pid 13462?) not running
install: cannot change owner and/or group of `/var/lock/apache2': Operation not permitted
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
I think it has something to do with the apache2 server running as root rather than backuppc.

Enough for tonight. More in Part 3.

Labels: