How to recover with a full backup?
Xen
list at xenhideout.nl
Sat Dec 9 15:05:39 UTC 2017
Volker Wysk schreef op 09-12-2017 15:26:
> Hi!
>
> I'm making preparations for the case when I can no longer boot my
> machine, and I'm not able to recover with the GRUB recovery mode.
>
> I have a full backup, which includes the system as well as personal
> data.
>
> When I can't recover, I would install the system anew, from the
> Kubuntu installation ISO. Then I would unpack my backup, in some
> directory /backup. Now, how to get a running system again, from that?
If you unpack your backup anyway, you could do so from a live dvd.
You then don't need to install the system, just restore the (root)
filesystem.
Including /boot if it is on a different partition.
At that point you do indeed need to install Grub.
This goes like this. Assuming your backup is in /backup.
# for d in sys dev run proc; do mount --bind /$d /backup/$d; done
# chroot /backup
(This assumes /boot is already mounted on /backup/boot)
# grub-install /dev/sda
That's really all you need to do. Linux has no "special files" that are
hardcoded on your partition; which means you can just do a *file
restore* with the one exception that you need to install grub.
Which you already thought of.
> Could I just replace the top level directories with ones from the
> backup?
Better not do this in the *running* system.
You can do the exact same thing in a live session without interfering
with any files.
> Now, how to make it bootable?
You are right on that.
> Can I just do:
>
> grub-install /dev/sda
Yes. What you proposed might actually work as long as the "mv" binary
and its required libraries remained accessible but if you don't do it
"atomically" corruption could occur. That is why it is much more
reliable to do it from a live session.
Of course you could do the experiment; after all you have nothing to
lose.
But I would not trust my system to be in a completely consistent state
and it saves you time to (not have to do) the install if you do it from
a live session.
In conclusion, there is no reason or *benefit* to be doing it from an
installed system.
(I assumed you wouldn't need to recreate any partitions).
More information about the ubuntu-users
mailing list