18

I am running Ubuntu 20.04 and I have my entire dev environment set up on this. I need to make some hardware upgrades and need to reinstall Ubuntu.

However I would like to take backup of my entire Ubuntu machine with my development environment intact. How do I create a backup as an ISO file and reinstall it. Is that possible?

Eliah Kagan
  • 117,780
  • 1
    Gnome-Disks will make an image file, (,img), of your disk. It can be copied to a second disk and restored using Gnome-Disks, Etcher, Rufus, mkusb, etc, when needed. Other people swear by Clonezilla. Not sure you can make a bootable installer for it. I will be wachin this question just in case someone has an answer. – C.S.Cameron Oct 01 '20 at 04:53
  • 1
    I would use Clonezilla for this task, to create a compressed image (a directory with a number of files). See more details at this link. But you may feel that using mkusb / Disks is more straightforward. Both methods work. In both cases it is important that you test that your image is restorable and that you really know how to do it. – sudodus Oct 01 '20 at 07:08
  • you can save your current packages and reinstall those with dpkg – Thorbjørn Ravn Andersen Oct 01 '20 at 14:17
  • @ThorbjørnRavnAndersen Wouldn't you have to copy all the configuration files after that? – Andyc Oct 01 '20 at 15:20
  • @Andyc Those would be in your home directory which should be transferred seperately. – Thorbjørn Ravn Andersen Oct 01 '20 at 21:32
  • While Clonezilla does work, it's a very convoluted and poorly documented process. I'll b e trying gnome-disk-utility package to see if I can replicate an image from one computer to another identical one. – guitarpicva Mar 22 '24 at 14:55

1 Answers1

10

Ubuntu Operating System Reinstaller

Hopefully the following should suit your requirements even though it does not involve an ISO file.

Procedure.

enter image description here

Showing partitions created by mkusb persistent install.

  • Boot the mkusb drive in the computer who's OS you want to backup.

  • Open Gnome-Disks, (Disks), Select the disk you wish to backup on the left.

  • Select the icon that looks like a stack of pancakes upper right.

enter image description here

  • Click "Create Disk Image" and save the image to the usbdata partition of the persistent USB.

enter image description here

  • When it comes time to restore your OS, boot the USB in the Target computer and use the pancake icon to restore the image to the hard drive. The restore will overwrite everything on the target drive. Best to test the image before deleting the original OS.
C.S.Cameron
  • 19,519
  • Will this backup also the configuration files, that for some programs are in the /home/user directory? Or do you have to take care of that manually? – Andyc Oct 01 '20 at 15:17
  • This will clone everything on the disk. – C.S.Cameron Oct 02 '20 at 00:19
  • how to backup from /home or another mounted partition? it's telling me that can't create an image because the disk is busy (mounted) – nima May 10 '21 at 22:26
  • 1
    @novonimo: You must run Disks from a Live or Persistent USB, not from the drive you are cloning. You do not need to run it from the Target drive. See also: https://askubuntu.com/a/1336673/43926 – C.S.Cameron May 11 '21 at 01:29
  • thank you for your helpful post and answer. – nima May 11 '21 at 10:51
  • The above assumes that all partitions are on the same disk. If e.g. /home is on a separate disk I'd clone/copy that separately (as a second process), having excluded it from the first root / clone/copy. – Hannu Nov 26 '22 at 08:02