Wednesday 29th November 2006

Fedora Core

Local Packages

Backup Server

More preparatory work done towards getting my bacula system up and running again. With the server consolidation effort of moving the file and print server on to my desktop box, and getting lots of new disk space, I'm also going to consolidate the storage dæmon on to this box instead of lumbering the Internet-facing box with that task.

Anyway, today's steps included making a new RAID1 device (/dev/md4), creating an LVM physical volume on it, creating a new volume group (VgBackup) using that, and three new logical volumes (/var/bacula - 3GiB, /var/lib/mysql - 5GiB, /var/spool/bacula - 50GiB).

First step was to create the new 80GiB Linux RAID autodetect partitions /dev/sdc2 and /dev/sdd2 using fdisk, and then reboot so that the kernel would use the new partition table.

Then:

# mdadm --create --level=1 --raid-devices=2 --auto=md /dev/md4 /dev/sd[cd]2
# mdadm --examine --scan --config=mdadm.conf
# vi /etc/mdadm.conf
(mdadm output pasted into /etc/mdadm.conf)
# pvcreate /dev/md4
# vgcreate VgBackup /dev/md4
# lvcreate --size=50G --name=BaculaSpool VgBackup
# mke2fs -j -L BaculaSpool /dev/VgBackup/BaculaSpool 
# lvcreate --size=3G --name=BaculaVar VgBackup
# mke2fs -j -L BaculaVar /dev/VgBackup/BaculaVar 
# lvcreate --size=5G --name=BaculaMySQL VgBackup
# mke2fs -j -L BaculaMySQL /dev/VgBackup/BaculaMySQL
# vi /etc/fstab
(add new mountpoints /var/bacula /var/lib/mysql /var/spool/bacula)

# cd /var/spool
# mkdir bacula
# chcon -t mnt_t bacula

# cd /var
# service bacula-fd stop
# service bacula-dir stop
# mv bacula bacula.orig
# mkdir bacula
# chcon -t mnt_t bacula

# cd /var/lib
# service mysqld stop
# mv  mysql  mysql.orig
# mkdir mysql
# chcon -t mnt_t mysql

# service netfs start
(mount new filesystems)
# chown mysql:mysql mysql
# mv mysql.orig/* mysql
# restorecon -rv mysql
# chcon -t lost_found_t /var/lib/mysql/lost+found
# rmdir mysql.orig
# service mysqld start
# cd /var
# chgrp bacula bacula
# chmod 770 bacula
# mv bacula.orig/* bacula
# mv bacula.orig/.bash_history bacula
# rmdir bacula.orig
# restorecon -rv bacula
# chcon -t lost_found_t /var/bacula/lost+found
# cd /var/spool
# restorecon -rv bacula
# chcon -t lost_found_t /var/spool/bacula/lost+found
# chown bacula:disk /var/spool/bacula
# service bacula-fd start


last edited 2008-01-31 12:30:37 by localhost