From fe698bace3ea6fa665b9a93a671e98bcbe71a080 Mon Sep 17 00:00:00 2001 From: Sven Vermeulen Date: Thu, 2 Sep 2010 23:33:50 +0200 Subject: [PATCH] mention stage4/5 --- ChangeLog | 1 + src/linux_sea/18-backup.xml | 60 +++++++++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b708068..0f3fc5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ ** (2010-09-02) Sven Vermeulen - Add chapter on logfile management - Add chapter on backups + - Mention stage4 and stage5 ** (2010-08-27) Sven Vermeulen - Add information on kernel module parameters diff --git a/src/linux_sea/18-backup.xml b/src/linux_sea/18-backup.xml index c711d7d..24d2123 100644 --- a/src/linux_sea/18-backup.xml +++ b/src/linux_sea/18-backup.xml @@ -38,7 +38,7 @@ ... Really, this location is not to be forgotten. Next, there are a few non-/etc files or directories that you want - to copy as well. + to copy as well. @@ -85,7 +85,7 @@ Sample Script The following command will make an archive of the above mentioned - settings. + settings. ~# tar cvzpf /var/tmp/poormanbackup.tar.gz /etc /var/lib/portage/world /usr/local /proc/config.gz /home/*/.??* @@ -133,7 +133,7 @@ backup settings of above would result in a file similar to the following: - File /etc/backup.d/20-basic-system.rdiff to + File /etc/backup.d/20-basic-system.rdiff to backup regular files: when = daily @@ -215,5 +215,59 @@ directory = /var/backups/backupninja ~# partimage -e restore /dev/sda /media/usb/gentoo_full.sda.partimg.gz.000 + +
+ Stage4/5/... Installation + + Specifically for Gentoo, some users have created enhancements on + top of the standard "stage3" installation used by Gentoo Linux. With + stage4 or stage5 installations, the extracted tarball is a lot larger + (it contains almost an entire system) and is accompanied with additional + script(s) that set up or recover the system. These scripts can, for + instance, restore your partition layout, reformat the partitions, + reinstall the bootloader, etc. + + You can find references to this installation approach on the + Gentoo Forums. + + Compared with the poor man's backup approach described above, this + can be seen as a "entire system poor man's backup", with: + + + + Backup & restore of the master boot record and partition + table + + (Backup) +dd if=/dev/sda of=/media/usb/full-stage-backup/mbr.img bs=512 count=1 +sfdisk -d /dev/sda > /media/usb/full-stage-backup/sfdisk.dat + +(Restore) +dd if=/media/usb/full-stage-backup/mbr.img of=/dev/sda +sfdisk /dev/sda < /media/usb/full-stage-backup/sfdisk.dat + + + + Restoration of the boot loader + + (Restore: command after restoring /boot content) +grub-install --root-directory=/mnt/gentoo/boot /dev/hda + + + + Reformatting of partitions (be carefull here, this is very + error-prone and specific for your system) + + (Backup) +mount | grep -v 'dev/mapper' | grep -v 'dev/md' | grep 'type ext' | awk -F' ' '{print "mkfs."$5" "$1}' > /media/usb/full-stage-backup/reformat.sh + +(Restore) +/media/usb/full-stage-backup/reformat.sh + + + + I personally prefer imaging software for such large recovery + scenarios. +