Note: this wiki is no longer maintained. If you have any questions related to this wiki, please post them on the CrunchBang forums.

Translations of this page?:

ADMIN Backing up and restoring your root partition

First you need a LIVE CD so you can get into an environment that allows you to download and use fsarchiver. You can use your Crunchbang CD for that; onced logged in, use Synaptic Package Manager to install fsarchiver.

Now mount the partition where you want to save your backup. If sda1 is your root partition and sda2 is your data partition you will want to mount sda2

cd /mnt
sudo mkdir sda2
sudo mount /dev/sda2 /mnt/sda2

Making the backup

sudo fsarchiver savefs /mnt/sda2/distro_backup.fsa /dev/sda1

Restoring the root partition

Again, you only want to mount the partition containing your backup file, in this case sda2

cd /mnt
sudo mkdir sda2
sudo mount /dev/sda2 /mnt/sda2

Restore it

sudo fsarchiver restfs /mnt/sda2/distro_backup.fsa id=0,dest=/dev/sda1

After restoring the backup to your root partition, mount it, so you can reinstall your boot manager

sudo mount /dev/sda1 /mnt

If your backup distribution uses grub2, like Crunchbang

sudo grub-install --root-directory=/mnt /dev/sda
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /proc /mnt/proc
sudo mount -o bind /sys /mnt/sys
sudo chroot /mnt
sudo update-grub

Or, if your backup distribution uses grub-legacy, like Arch - in this case dont try to do a “grub-install –root-directory=/mnt /dev/sda” from the host as you will end up with a mix of both versions of grub and you wont be able to boot. Just chroot and reinstall.

sudo mount -t proc none /mnt/root/proc
sudo mount -o bind /dev /mnt/root/dev
sudo chroot /mnt/root /bin/bash
sudo grub
grub> find /boot/grub/stage1
grub> root (hd0,0)
grub> setup (hd0)
grub> quit

Or, if your backup distribution uses lilo, like Slackware, you will only need to

sudo chroot /mnt
sudo lilo -v

Check your fstab for UUID changes - in case your backup distribution used UUIDs in fstab, they might have changed. Use ls /dev/disk/by-uuid -lha to display your UUIDs and fix your fstab accordingly.

Reboot.

 
howto/backup_using_fsarchiver.txt · Last modified: 2012/05/25 17:11 by machinebacon
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported

Powered by DokuWiki. Hosted by Linode.
Copyright © 2010 CrunchBang Linux.
Proudly powered by Debian GNU/Linux.
Debian is a registered trademark of Software in the Public Interest, Inc.