Login  View  Edit  Attributes  History  Attach  Print  Search

Backup

Backup Cheat Sheet

Weekly

Weekly backup is done on hard drives. Weekly backup happens on Sat. morning at 1am, so the drive can be changed anytime
during the week, just needs to be done by Friday night. The hard drives are located in a black case under the computer counter
by the lab door. There are 3 drives for the weekly backup, labeled Weekly1, Weekly2, and Weekly3. They are inserted into a white
hard drive dock at the back of the computer closet on the left side. I will refer to it as the backup dock or just the dock. The dock
has a giant blue power button on it and slots on top for 2 hard drives.
Procedure:

  • Log onto billie and unmount the hard drive:

billie:~# umount /backup

  • Turn off the power to the drive (big blue button). Let hard drive spin down before pulling it out (waiting 30 seconds is sufficient).

While waiting, you can go to next step.

  • Get out the next Hard Drive from the case (Weekly1 after Weekly3).
  • Take out the hard drive from the dock (stabilize drive with your hand as you press down the eject button). Drive will be

pretty warm, let it cool down before placing in case. Place the next hard drive in the dock. Turn on the power.

  • Remount the hard drive, first ensure the drive has the same device number:

billie:~# fdisk -l

This will give you a list of lots of drives. The last one should look something like this:

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa215300f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      121601   976760001   83  Linux 

The backup drive will be the only one that is 1000.2 GB. If you don't see it, wait a couple of seconds and give the command again. If it
still doesn't show up, the drive wasn't inserted well. Try shutting down the power to the dock, and re-inserting the drive. The name
(/dev/sdc1) should always be the same, as long as you always use the same slot on the dock.
Mount the drive:

billie:~# mount /dev/sdc1 /backup

If it mounts with no problem, it will not give you a message. You can verify it is mounted by using the df command:

billie:~# df -h

There will be a list of various mounted device, again backup should be at the bottom:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              19G  906M   17G   6% /
tmpfs                 881M     0  881M   0% /lib/init/rw
udev                   10M  132K  9.9M   2% /dev
tmpfs                 881M     0  881M   0% /dev/shm
/dev/sda7              18G  173M   17G   2% /tmp
/dev/sda2              19G  1.1G   17G   7% /usr
/dev/sda5              19G  2.9G   15G  17% /var
/dev/hdb1              25G  9.0G   15G  39% /lab_mac
/dev/hdb2              49G   27G   20G  58% /lab
/dev/sdb1             1.8T  479G  1.3T  28% /home
/dev/sdc1             917G  361G  511G  42% /backup

At the beginning of each month, a monthly backup is done. This is basically the same, but use the monthly hard drive instead
of the weekly hard drive. The only difference between these backups is that the monthly backups are archived longer.

Note: If you are inserting the weekly hard drive after the monthly backup, you may need to check the
backup software to see which weekly drive to put in. To check, log into billie and start the backup terminal:

billie:~# bconsole
Connecting to Director 127.0.0.1:9101
1000 OK: billie-dir Version: 2.4.4 (28 December 2008)
Enter a period to cancel a command.
*

Note: The backup software will print to the screen the same messages that are sent in emails every
night. It will first tell you there are messages, and then if you don't print messages to see them, it
will automatically print them to the screen after a moment or two, which can be annoying if you aren't
expecting it. Some day I will find a way to turn off this *feature*.

Check the weekly drives to see which one was used the longest time ago:

*list volumes pool=Weekly
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
+---------+------------+-----------+---------+-----------------+----------+--------------+---------+------+-----------+-----------+---------------------+
| MediaId | VolumeName | VolStatus | Enabled | VolBytes        | VolFiles | VolRetention | Recycle | Slot | InChanger | MediaType | LastWritten         |
+---------+------------+-----------+---------+-----------------+----------+--------------+---------+------+-----------+-----------+---------------------+
|       1 | weekly1    | Used      |       1 | 386,618,871,599 |       90 |    1,468,800 |       1 |    0 |         0 | File      | 2009-05-16 21:52:04 |
|      16 | weekly2    | Append    |       1 | 388,312,194,304 |       90 |    1,468,800 |       1 |    0 |         0 | File      | 2009-05-24 00:36:01 |
|      17 | CLNA0001   | Cleaning  |       1 |               0 |        0 |    2,160,000 |       1 |    0 |         0 |           | 0000-00-00 00:00:00 |
|      19 | weekly3    | Used      |       1 | 386,107,688,816 |       89 |    1,468,000 |       1 |    0 |         0 | File      | 2009-05-09 10:50:30 |
+---------+------------+-----------+---------+-----------------+----------+--------------+---------+------+-----------+-----------+---------------------+
*

In this case, weekly3 was used on 5-09, which is the earliest date, so this one should be used again next.

Monthly

In the case of recycling, monthly backup is fairly straightforward, just make sure the Recycle bit is set to 1, and that the date is beyond the recycle after date (VolRetention). In the case of using a new hard drive, things are slightly more complicated, since you need to format the drive first. Insert the new volume and check to see which device it is. It will be easy to spot, as it will tell you that one of the drives does not have a partition table.

Note to self: remember to rename drive when reusing for different month.

fdisk -l

The above command will list all attached devices. Now you need to create a partition table. Let us assume that the above command told you that the new hard drive was /dev/sdb.

fdisk /dev/sdb

Make absolutely sure you have the correct device. If this is a new drive, it should say something like: Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel.

This command will tell you that m gives you a help menu. You will be using the letter n to create a new partition. I ususally use the 1st primary partition, but this shouldn't matter. We want to use the entire drive, so we can use the default cylinders. Once you have created the partition you can check it with the letter p. Now you can write the partition table to the drive and exit by using the letter w.

Now to format the new drive. We are actually formatting the partition we just created, so we need to add the number 1 to the end of the device name, in our case, /dev/sdb1.

mkfs -t ext2 /dev/sdb1

This will take a while. When it is done, it is ready to be mounted. ext2 is said to work faster for backup then ext3.

mount /dev/sdb1 /backup

We also need to change the owner to bacula

chown bacula: /backup

Now we log into bacula and tell bacula about the new drive:

bconsole
*label
The defined Storage resources are:
     1. Exabyte
     2. File
Select Storage resource (1-2): 2
Enter new Volume name: sep09
Defined Pools:
     1. Daily
     2. Weekly
     3. Monthly
     4. Servers
     5. Scratch
Select the Pool (1-5): 3
Connection to Storage daemon File at billie:9103...

And some more messages will appear. I always label the monthly disks with the first three letters of the month and the last two digits of the year.

Hints for using bconsole can be found here http://www.bacula.org/en/dev-manual/Bacula_Console.html.