Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Backing up is simple and should be done live, but not under use.

Borrowed from this Arch Linux Guide, with a bit more troubleshooting I had to do.

In this example the backup folder is mounted on a separate drive @ /mnt/exthd/rsync.

The basics are copy the entire filesystem, except folders that get populated at boot, to the extHD first. One the second box, install the OS that was used in the main server. This creates grub/partitions etc etc already configured. Label the boot/root/swap partitions with GParted. Delete filesystem (but gather /boot/grub/grub.conf and /etc/fstab first!) on second box and replace boot/root. Compare /boot/grub/grub.conf and /etc/fstab.conf from RSync backup of old filesystem, previously deleted filesystem and create a final revised version.

Copy the Entire Filesystem, except folders that get populated at boot, to the extHD :

 

rsync -aAXv --progress --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /mnt/exthd/rsync

 

Mount the boot directory and the root directory and the exthd/backupfolder.
In this example I have created

/mnt/{boot,root,rsync} folders on the target machine and am going to mount the corresponding partitions. 

 

Mount :

mount /dev/sda1 /mnt/boot
mount /dev/sda3 /mnt/root
mount /dev/sde1 /mnt/rsync (External HD) 

Copy the Boot and Root files to corresponding partitions with rsync :

rsync -aAXv --progress /mnt/rsync/boot/ /mnt/boot
rsync -aAXv --progress --exclude=["/boot/*} /mnt/rsync/ /mnt/root 

Compare Backups grub.conf and fstab to the previously deleted OS's grub.conf and fstab and create a combination of the two :

Grub.Conf Comparison :

# Revised FINAL /boot/grub/Grub.Conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/mapper/isw_dfbcfjejha_Volume0
boot=LABEL=boot
default=0
timeout=5
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-409.el5)
	root (hd1,0)
	kernel /vmlinuz-2.6.18-274.12.1.el5 ro ro root=LABEL=root
	initrd /initrd-2.6.18-274.12.1.el5.img 


 

------------------------------------------------------------------

# Original Backups Grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/mapper/isw_dfbcfjejha_Volume0
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-274.12.1.el5)
	root (hd0,0)
	kernel /vmlinuz-2.6.18-274.12.1.el5 ro root=/dev/VolGroup00/LogVol00
	initrd /initrd-2.6.18-274.12.1.el5.img 
 

Things I changed :

I had to specify boot=LABEL=boot because of a Hardware Raid setup.
(hd0,0) = (hd1,0) (Yours may stay the same, compare from working grub.conf)
root=/dev/VolGroup00 = root=LABEL=root (This keeps things simple and can be cross system unspecific)

Comparison /etc/fstab :

#Final Revised /etc/fstab
LABEL=root              /                       ext3    defaults        1 1
LABEL=boot              /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP              swap                    swap    defaults        0 0 


 

#Original /etc/fstab
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0 

 

Again, specifying Labels allows you to move the OS to different partitions/servers and not worry about UUID/VolumeGroup names etc etc.

That's it!

  • No labels