How can I safely restore a Borg backup to a new ssd?

Hello,

I am switching my current SSD to a larger one, and I plan to do a bottom to top migration (***://wiki.archlinux.org/index.php/migrate_installation_to_new_hardware#Bottom_to_top) of my system. I currently have backups of my /etc and /home directory using borgmatic. The disk with the backups is encrypted and I’ll use the default full disk encryption on the new SSD.

Here is my current plan :

  • Boot from a Manjaro live USB
  • Install Manjaro on the new disk
  • Install Borgmatic and decrypt the HDD with the backups
  • Mount and chroot the new system from the live usb
  • Do a borgmatic extract or restore (not sure about that yet) of my /etc and /home directory
  • Navigate to my pkglist.txt and reinstall my packages
  • exit the chroot environment and unmount the new ssd.

Here are my questions and concerns :

Are my current steps ok ? Do I need to do anything with fstab and should I do anything with my grub ? I don’t plan to unplug my current SSD yet and I’m worried about running into some issues when I reboot since I’d copy my /etc and have the same fstab / grub as with my old system. Is the bottom to top migration a good strategy here or should I do a clonezilla restoration ?

Thank you very much for your help !

I have never used borgbackup to restore a system disk, but why are you not using a tool designed to replicate a disk like clonezilla?

A quick search resulted in this: https:// blog.jamesthebard. net/restoring-with-the-borg/ <-- no idea if it will work, Borg backup documentation recommends system image backup for system disks, not file based.

Just use this system: (uses Borg and CloneZilla)

In your particular case however, you should use a CloneZilla USB stick instead of adding CloneZilla to your grub menu…

:innocent:

Hello,
Thank you both for your answers !
I’ve tried to restore the system with the method I mentioned (and I’ve read the blog link) but it didn’t work, the repo was not recognized.

I’ve also read your Guide Fabby, which is amazing, but I was afraid of some things. Currently, I can’t make the backup because the my external HDD Is encrypted, and I don’t know the way to back it up through Clonezilla command line…I guess i’ll open another thread for this specific issue.

Thank you

EDIT : Oh and timeshift also didn’t work. I’ve ran into the “Boot device not selected” error.

  • Unencrypt first, unless you’re a guru that knows what he’s doing and remember the adagio: With great security comes great responsibility! :innocent:
  • Re-partition the encrypted HD and shrink the encrypted partition and create an unencrypted one next to it.
  • Buy an additional HD and use that. (easiest, most expensive solution)

There is no command line: it uses a TUI and you can just follow easy step-by-step instructions here.

Please read the article again as I just verified the link to the correct chapter in the CloneZilla manual is in there already!

:man_shrugging:

Thank you once again for your answer.

I’ll try to learn how to resize the encrypted HDD but I’m a bit afraid of losing the data I have there ATM. I’ll maybe try on an USB key. Unfortunately, I can’t buy another HDD atm.

Yes it does, but since I’m using an encrypted HDD the TUI doesn’t recognize the Luks format. From what I’ve read, I need to chose the “Enter_shell” option when given the choice to either “Start Clonezilla” or “Enter_shell”.

For now, if I were to do this, I only know that I should decrypt the HDD with luksOpen, mount it, create a /home/partimg as a mount point and then run clonezilla as root. I don’t know what happens next, and how to restore the backup once it’s done yet.

But you’re right I guess, I should for now re-partition the encrypted disk and try it this way. I’ll browse the arch wiki.

Thanks !

1 Like