A mirrordir project

Frank Reichenbacher frank at bio-con.com
Wed Jun 9 03:41:53 UTC 2004


Below is the output from mount and a mirrordir script that runs from
cron.daily on a RH 7.0 box that I use to host a $-making email list.
hda1, 5, 6, 7, and 9 are partitions on the old primary hard disk which
probably only has another 1-2 years before a catastrophic failure. hdb1,
5, 6, 7, and 9 are partitions on an identical new hard drive. 

My goal is to make it as quick, simple, and cheap as possible to get
back up and running when the old drive bites the dust.

With my old system fully mirrored on the new drive this should be
possible, right? 

I assume that I can just pop a new drive back in the primary slot,
partition it properly, and mirrordir everything back to it from the
secondary and I'm up and running. 

It's not really going to be that simple is it?

What do I do with /proc? Should I mount the filesystem on a
/mirror/proc? What about automount, usbdevfs, and /dev/pts?

What else am I missing?

Frank


/dev/hda7 on / type ext2 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/hda1 on /boot type ext2 (rw)
/dev/hda9 on /home type ext2 (rw)
/dev/hda6 on /usr type ext2 (rw)
/dev/hda5 on /var type ext2 (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
automount(pid461) on /misc type autofs
(rw,fd=5,pgrp=461,minproto=2,maxproto=3)


#!/bin/sh
#
#
# mirror: Mirror all hda partitions to hdb
# 5/8/04 based on RH Linux Bible 7, p. 447

mount /dev/hdb7 /mirror
mount /dev/hdb1 /mirror/boot
mount /dev/hdb5 /mirror/var
mount /dev/hdb6 /mirror/usr
mount /dev/hdb9 /mirror/home

mirrordir /bin /mirror/bin
mirrordir /command /mirror/command
mirrordir /dev /mirror/dev
mirrordir /etc /mirror/etc
mirrordir /lib /mirror/lib
mirrordir /lost+found /mirror/lost+found
mirrordir /misc /mirror/misc
mirrordir /mnt /mirror/mnt
mirrordir /opt /mirror/opt
mirrordir /package /mirror/package
mirrordir /root /mirror/root
mirrordir /sbin /mirror/sbin
mirrordir /service /mirror/service
mirrordir /tftpboot /mirror/tftpboot
mirrordir /tmp /mirror/tmp

# /boot /dev/hdb1
mirrordir /boot /mirror/boot
umount /mirror/boot

# /home /dev/hdb9
mirrordir /home /mirror/home
umount /mirror/home

# /usr /dev/hdb6
mirrordir /usr /mirror/usr
umount /mirror/usr

# /var /dev/hdb5
mirrordir /var /mirror/var
umount /mirror/var

umount /mirror






More information about the redhat-list mailing list