How to recover with a full backup?

Volker Wysk post at volker-wysk.de
Sat Dec 9 19:26:19 UTC 2017


Am Samstag, 9. Dezember 2017, 16:05:39 CET schrieb Xen:
> 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.

The filesystem which might need to be recovered, is encrypted and a logical volume (LVM based). I don't know how to activate the volume group. This is what I meant with the message "LVM: How to access a foreign volume group", here in this list. I could try to access it with an non-encrypted, non-LVM  maintenance system. I'll try that next.

> 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.

This sound good. Next I'll look after this.


> 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.

Okay.

 
> 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.

OK, see above.

Bye,
Volker




More information about the ubuntu-users mailing list