[K12OSN] Server Clone

Les Mikesell les at futuresource.com
Tue Jun 1 16:59:16 UTC 2004


On Tue, 2004-06-01 at 10:47, Jim Kronebusch wrote:

> My minutes must be in cat years today :-)  Loaded Mondo on the master
> server and backed up / and excluded /home to a nfs mount of /mnt/backup
> into a directory called server_root with no compression and now have 5
> iso's in this directory.  I burned 1.iso and booted the new server from
> it.  It cannot mount any filesystems and aborts.  So now I am trying to
> partition and format the drive identical to the first to see if that
> helps.
> 
> This is very frustrating, such a simple process and for some reason I am
> managing to make it very difficult.

Your problem is that you are using RAID on your master server and
trying to copy to plain disk partitions.  It may be possible to
patch that up after the fact, but it would be better to build your
raid sets first, then drop your backup in via tar while running
from a Knoppix CD.  Or, if the raids are mirrored, you might get
away with a sector by sector copy of one entire drive of each set,
then creating matching partitions on the mirror and hot-adding it
to the raid.  I'd recommend the tar approach but the raid-rebuild
is fun and something you should know how to do in case a drive goes
bad anyway. If the disks happen to be hot-swap and you are really
brave you can cheat by pulling the mirrors and rebuilding on both
machines.

Basics first: do you know how to do 'fdisk -l' on your master server
and duplicate the partitions on the clone?
Next step is to 'cat /proc/mdstat' and note which physical partitions
are combined for each md? device in what rail level and duplicate that
with "mdadm --create" commands.
Next, do 'mount' and note the filesystem type (probably ext3 everywhere)
on each of the md? devices.  Use 'mke2fs -j raid_device_name' to
make an ext3 filesystem.  Use 'mkswap device_name' to format the
swap partition(s) which may or may not be on raid devices.
The fun part about raid mirrors is that you don't have to wait for
them to sync.  You can do the format and start copying data as soon
as you create the set and even if you reboot before they are syncronized
they will start over correctly.  You can observe the progress with
'cat /proc/mdstat' anytime.
If you have gotten this far working from a Knoppix CD, the next step
is to make directories in /tmp where you can mount each raid partition.
Mount it, cd to it, then ssh a tar copy from the master:
ssh master_server 'cd /partition && tar --one-file-system -cf . -' |tar
-xpf
After doing the / partition check the copied /etc/fstab file to see if
it uses the /dev/md? names for the partitons or if it uses labels. If
it has labels, change the LABEL= entries to /dev/md? names.  When the
partitions are all copied and fstab matches the correct device names
you can reboot with the k12ltsp install disk with 'linux rescue' and
it will find and mount things so you can 'chroot /mnt/sysinstall'.  Then
run /sbin/lilo if you boot with lilo, or 'grub-install' for grub, then
exit (twice) to reboot, remove the CD and come up running.
There are a lot of steps involved here, but each one is fairly
straightforward and if you make it through you'll know someone can break
your server into little pieces and you can put it all back together.

---
  Les Mikesell
   les at futuresource.com






More information about the K12OSN mailing list