Building an MX the Easy Way

Boot off RHEL5 disk 1.
linux rescue
Activate network interface eth0 (first interface).
Give IP and so on.
Use fdisk to create
/dev/sda1 /boot Linux 100Mb
/dev/sda2 Linux swap 2048Mb
/dev/sda3 / Linux all the rest
mkfs.ext3 /dev/sda1
mkfs.ext3 /dev/sda3
mkswap /dev/sda2
mkdir /mnt2
mount /dev/sda1 /mnt2
ssh crow ‘dump 0f - /dev/sda3’ | ( cd /mnt2 && restore -rf - )
umount /mnt2
mount /dev/sda3 /mnt2
ssh crow.ecs.soton.ac.uk ‘dump 0f - /dev/mapper/VolGroup00-LogVol00’ | ( cd /mnt2 && restore -rf - )
or else
ssh crow.ecs.soton.ac.uk ‘cd / && tar clf - .’ | ( cd /mnt2 && tar xvBpf - )
Fix /mnt2/etc/fstab so it points to all the right partitions.
If you really want to use partition labels, use the “e2label” command to set the label of each partition so that your shiny new /etc/fstab can find them. Syntax is obvious: /sbin/e2label device [ new-label ]
umount /mnt2

Installing Grub
Cloning an RHEL4 system using the RHEL5 rescue disc? You must use Grub from RHEL4 to setup a boot record for an RHEL4 system. So mount the (newly copied) root filesystem in /mnt2 and copy /mnt2/sbin/grub to /sbin/grub. Then follow the instructions below.
mkdir /boot
mount /dev/sda1 /boot
rm -rf /boot/boot
grub
grub> root (hd0,0)
grub> setup (hd0)
Edit /boot/grub/grub.conf and change the root command to (hd0,0) and the kernel root-filesystem argument to /dev/sda3.
Repeat that edit for all the other kernels available.

Unplug network interface
Reboot and it should boot from hard disk
cd /var/spool/mqueue.in
rm -f *
cd /var/spool/mqueue
rm -f *
cd /var/spool/MailScanner/quarantine
rm -rf *
cd ../incoming
rm -rf *
cd ../archive
rm -rf *
cd /var/log
Remove all old logs
service syslog restart
Fix ethernet and IP address in /etc/sysconfig/network-scripts/ifcfg-eth0 and /etc/sysconfig/network
Fix /etc/hosts
Repair ownership and permissions of /home/* and /usr/local/share/clamav (and subdirectories).
Fix extra ClamAV databases so that “MailScanner --lint” runs correctly.
Reboot with network interface connected.

Re-register with RedHat network for yum updates, get the info from the Systems KB.
yum update
Comments