Backuppc: Moving the pool
Here are the instructions to create a dual disk system using backuppc. This approach creates a "copy" of the pool data without RAID. I have two external USB drives, both 500 Gig here. The advantage (I think) of this method is that if a mistake is made or a disk crashes no rebuilding is needed, just a copy. Also, the second disk can be removed for safe keeping, all we need is a replacement disk (no rebuilding)
1). Stop backuppc:
/etc/init.d/backuppc stop
2). Sync the current default location to your new mount point excluding "pc" (USB device = /data1):
rsync -avPH --exclude=pc/ --delete /var/lib/backuppc/ /data1/backuppc/
(This creates all the data for backuppc in /data1/backuppc, the "H" preserves hard links)
3). Move the old location to a new file, just in case:
mv /var/lib/backuppc /var/lib/backuppc_old
4). Change the /data1 mount point in /etc/fstab to mount /var/lib/backuppc, here's the line:
before: /dev/sdc /data1/backuppc ext3 defaults 0 0
after: /dev/sdc /var/lib/backuppc ext3 defaults 0 0
5). If there's a second disk, setup a crontab with an rsync:
rsync -aPH --exclude=pc/ --delete /var/lib/backuppc/ /data2/backuppc/ >/dev/null 2>&1
6). Reboot and verify the disk(s) are mounted correctlty
7). Start backuppc, /etc/init.d/backuppc start
8). After a few days if all is working remove /var/lib/backuppc_old
Note: Rather than creating a symbolic link from /var/lib/backuppc to /data1/backuppc I opted to create a static mount point in /etc/fstab. This is more straightforward. When someone runs "df -k" they'll see the giant mount point at /var/lib/backuppc and hopefully notice that it's a USB device.
Formatting USB: You may also have to format the USB drive with "mkfs.ext3 /dev/sdc". The device can be determined pretty easily with the Logical Volume Management Tool available in the GNOME GUI.
Further Note: Changing /etc/BackupPC/conf.pl and some of the files like "/usr/lib/BackupPC/Lib.pm" so the top directory is hard changed is NOT recommended. This is because someone else may update the backuppc package and the topDir will break.
-Andy
1). Stop backuppc:
/etc/init.d/backuppc stop
2). Sync the current default location to your new mount point excluding "pc" (USB device = /data1):
rsync -avPH --exclude=pc/ --delete /var/lib/backuppc/ /data1/backuppc/
(This creates all the data for backuppc in /data1/backuppc, the "H" preserves hard links)
3). Move the old location to a new file, just in case:
mv /var/lib/backuppc /var/lib/backuppc_old
4). Change the /data1 mount point in /etc/fstab to mount /var/lib/backuppc, here's the line:
before: /dev/sdc /data1/backuppc ext3 defaults 0 0
after: /dev/sdc /var/lib/backuppc ext3 defaults 0 0
5). If there's a second disk, setup a crontab with an rsync:
rsync -aPH --exclude=pc/ --delete /var/lib/backuppc/ /data2/backuppc/ >/dev/null 2>&1
6). Reboot and verify the disk(s) are mounted correctlty
7). Start backuppc, /etc/init.d/backuppc start
8). After a few days if all is working remove /var/lib/backuppc_old
Note: Rather than creating a symbolic link from /var/lib/backuppc to /data1/backuppc I opted to create a static mount point in /etc/fstab. This is more straightforward. When someone runs "df -k" they'll see the giant mount point at /var/lib/backuppc and hopefully notice that it's a USB device.
Formatting USB: You may also have to format the USB drive with "mkfs.ext3 /dev/sdc". The device can be determined pretty easily with the Logical Volume Management Tool available in the GNOME GUI.
Further Note: Changing /etc/BackupPC/conf.pl and some of the files like "/usr/lib/BackupPC/Lib.pm" so the top directory is hard changed is NOT recommended. This is because someone else may update the backuppc package and the topDir will break.
-Andy



2 Comments:
Thanks.
This one really helped me out! I tried to use symlinks, and followed a guide for that, but I didnt get that one working.
By
espen, at 5:49 AM, October 20, 2008
I should have also included the process for disk labeling an external USB disk do it will mount on the correct directory after reboot. Here it is:
1). Identify the blank external USB disk
root@server~]# fdisk -l /dev/s*
You should see something like “/dev/sdd” with the disk size here:
Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdd doesn't contain a valid partition table
2). Format the disk (You may have to use “umount” if the disk has been previously mounted)
[root@server~]# mkfs.ext3 /dev/sdd
NOTE: answer “y” to all
3). Label the disk
[root@server~]# e2label /dev/sdd /EXTERNAL_USB
4). Setup /etc/fstab with a line like this:
LABEL=/EXTERNAL_USB /EXTERNAL_USB ext3 defaults 0 0
5). Create the actual directory that will be mounted on boot up
[root@server~]# mkdir /EXTERNAL_USB
6). Mount the disk
[root@server~]# mount /EXTERNAL_USB
By
Andrew Krone, at 8:40 AM, October 20, 2008
Post a Comment
Links to this post:
Create a Link
<< Home