0

I have rebuild my Ubuntu 14.04.1 installation as the USB drive which contained the boot partition crashed. I have a recent backup of all of / except for /proc /sys /mnt /media /run /tmp /dev.

Starting from a clean 14.04.1 installation, I have tried copying the entire contents of the tar archive over the new installation. It core dumped, when copying the /lib files.

I copied the directories from the tar archive individually and managed to get almost all files to copy apart from some /sbin executables, which were in use. But when I rebooted, it did not boot up and never reached a command prompt.

Is there a better way to use the tar archive to recover the system? Do I have to ensure that the new USB boot drive is physically the same size? Should I pick some key config files/directories to restore rather than the whole archive? If so, which ones?

  • The crash comes from the fact that you are overwriting files that are in use and files that are not. By overwriting them, you create incompatibility which end up breaking your processes. – Alexis Wilke May 10 '15 at 2:30
  • Actually, it does not make sense to backup system files since you can always re-install them from a CD/DVD or the Internet using packages. The only system folder you should backup is /etc and even that, you should be very careful when restore. – Alexis Wilke May 10 '15 at 2:32
1

You can restore your whole tar archive but do it from a Live CD/USB instead. tar will not core dump this time.

In either case, once done you need to run update-grub to update grub config file.

If you do it from a Live CD/USB you need to chroot into the mounted partition before running update-grub like this:

sudo -i
mount /dev/sda4 /mnt
# you need to mount your boot partition if you have one
mount -o bind /sys /mnt/sys
mount -o proc /mnt/rpoc
mount -o dev /mnt/dev
chroot /mnt
update-grub
exit
umount /mnt/sys
umount /mnt/proc
umount /mnt/dev
0

In the end it was easier to rebuild the server from scratch, so that is what I did. My backup provided a list of the packages that I had installed previously and I was able to weed out a few that were no longer required, so the installation is now a bit cleaner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.