Version 8 (modified by jsalamero@…, 4 years ago) (diff)

--

Restore

To restore our system we will use the Rescue a broken system from the Ubuntu based eBox installer:

You will have to follow the same steps than in the install but when we made the partition now the rescue menu appears:

  1. Select /dev/sda1 as root file system, this is where /boot is.
  2. Select Execute a shell in the installer environment.
  3. We see an information message.

Rescue mode then offers a restricted shell to work:

Create a mount point for the backup and mount it:

% mkdir /mnt/backup
% mount -t ext3 /dev/sdb1 /mnt/backup

Create a mount point and mount the root partition. Then delete everything there:

% mkdir /mnt/ebox
% mount -t ext3 /dev/ebox/root /mnt/ebox
% rm -fr /mnt/ebox/*

Do the same with var:

% mkdir /mnt/ebox/var
% mount -t xfs /dev/ebox/var /mnt/ebox/var
% rm -fr /mnt/ebox/var/*

Restore the data:

% cd /mnt/backup/ebox-backup
% cp -ra * /mnt/ebox/

Create dirs not included in back and clean up /var/run, /var/lock and rdiff-backup-data:

% mkdir /mnt/ebox/dev
% mkdir /mnt/ebox/sys
% mkdir /mnt/ebox/proc
% rm -fr /mnt/ebox/var/run/*
% rm -fr /mnt/ebox/var/lock/*
% rm -fr /mnt/ebox/rdiff-backup-data

The rescude mode mounted /boot under /target so let's clean this directory and move the restored contents there:

% rm -fr /target/*
% mv /mnt/ebox/boot/* /target/*

Umount everything and exit (but after umounting the /var partition and before the root we have to create var/run and var/lock to prevent some fails on Ubuntu start up):

% umount /mnt/ebox/var
% mkdir /mnt/ebox/var/run 
% mkdir /mnt/ebox/var/lock
% umount /mnt/ebox
% exit

Reboot into the restored system.

Attachments