I have more than 100 units of the same HW I need to prepare for our product delivery. All of them are the very same HW (celeron N platform, 32GB SSD) and come with a standard Ubuntu 20.10 installation which needs to be customized for our specific product. I did all the customization on a single unit I would like to keep as a "master" setup to be spread on all the unit. I dumped an image of this "master" installation through Rufus on a windows 10 machine and tried to prepare the cloned units. The issue here is that the cloned SSD only boots on the "master" unit, but it will not boot on a different one. I got a message stating "... Select proper boot device ...Insert boor media in selected boot device and press a key". I should be a EFI related setup, which actually I do not know in details. I tried to copy the file this way cp /boot/efi/EFI/ubuntu/grubx64.efi /boot/efi/EFI/BOOT/bootx64.efi (which in my installation is actually all capitals BOOTX64.EFI), as I got it should be used as recovery when main boot file is not found. But this did not work. How can I create an usable portable Ubuntu 20.10 image for this massive installation?

  • You know that 20.10 support will end in 3 weeks from now? – pLumo Jun 14 at 8:48
  • ok, granted. Does the newest Ubuntu release not having cloning issues like the one I'm describing above? – Maurizio Santovito Jun 14 at 9:30
  • If you want a long life, I recommend that you use Ubuntu 20.04.x LTS (Long Time Support for 5 years). - Maybe there is some crucial difference between your computers, that make a cloned copy fail in the other computers. Or are you installing Ubuntu Server? It is setting up the wired network in a non-portable way, and there may be other things that prevent cloning. – sudodus Jun 14 at 9:45
  • Rufus would be very slow flashing just one image at a time, Etcher will do multiple images at once. Etcher also has a Linux version. I have had problems using old versions of Rufus, best to use the latest version. – C.S.Cameron Jun 14 at 10:47
  • I understand that you can also check the image using MD5SUM, but have not tried the following method: geekmungus.co.uk/linux-and-nagios/… – C.S.Cameron Jun 14 at 11:39

Duplicating a Ubuntu System for Distribution

Ref: How to Duplicate a Ubuntu System for Distribution?

Once you have created the running Ubuntu OS with everything you want, use Gnome-Disks to create an image file of it, (.img).

enter image description here

Use balenaEtcher, https://www.balena.io/etcher/, to flash the Ubuntu image file to the new hardware. Etcher will flash an image file to multiple SSD's at the same time.

enter image description here

Use the settings icon in the upper right hand corner of the window to select Unsafe mode for flashing to large drives.

enter image description here

When cloning images, all the OS partitions have the same UUID. GParted has an option for creating new UUID's if desired.

  • thanks C.S.Cameron, I do not need to have different UUID, I just need the cloned disk can boot when moved on a PC which is identical to the one used to create the .img file. So far this is prevented by EFI boot procedure, at least this is the only explanation I can find for that. I've used Rufus a lot cloning lot of with Debian Buster systems, so I never expected such a difference in Ubuntu releases. If Balena etcher (which I know as well) will prevent such difficulties in Ubuntu SSD cloning, then I can easily use it – Maurizio Santovito Jun 14 at 14:09
  • Actually the reason was the UEFI boot was not properly configured in the BIOS. Anyway this procedure actually worked – Maurizio Santovito Jun 16 at 17:29

My experience is that an installed Ubuntu desktop system (in a portable drive) can boot in many pc computers, not only with identical hardware. as long as there are no proprietary drivers (e.g. for graphics and wifi). And hence, cloned systems will work too (in other computers).

But there are some things to check.

  • Cloning works correctly when the target drive is at least as big as the source drive (not one single byte smaller). Please notice that two drives with the same nominal size (e.g. 32 GB) may contain different numbers of bytes.

    • If the target drive is slightly smaller, you can work around the problem by leaving enough unallocated drive space near the tail end of the drive.
  • If there is a GUID partition table, GPT, and the target drive size is different, you must fix the backup partition table, which should be located at the tail end of the drive. You can do that with gdisk or easier with gpt-fix.

  • Ubuntu Server is setting up the wired network in a non-portable way, and there may be other things that prevent cloning.
  • Thanks for the answer, sudodus. – Maurizio Santovito Jun 14 at 9:50
  • Both the source and the target SSD are identical units, same manifacturer, same product, same everything, as the PC it is connected to. Same product. This is why I need to have a master image to be spread everywhere. But I'm stuck in not being able to run the image on a different unit of the same product. The only alternative we have so far is to manually install Ubuntu on each PC and repeat every customization steps. doable but not efficient at all. I guess I'm stuck with UEFI configuration I do not know, as I'm not familiar on how UEFI boot work, I'm afraid – Maurizio Santovito Jun 14 at 9:56
  • Maybe you created the master system with another drive connected, and that drive was seen as the first drive, and the EFI system partition was located there. Hence the master drive contains no EFI system partition. - If you unplug, disconnect or otherwise disable the internal drive, and install your Ubuntu again, things should work better. See this link – sudodus Jun 14 at 9:58
  • I think even 'identical units' of SSD may contain different number of bytes. Please check it for example with lsblk -bdo name,size – sudodus Jun 14 at 10:03
  • 1
    Please notice also, that you should never boot a computer with two cloned drives connected at the same time. It is OK to connect a cloned copy after the boot process, when you have reached the desktop environment. - The reason is that the two clones have the same UUIDs on the file systems, and the booted system cannot tell them apart and may mix part of one drive with [another] part of the other drive, and this can cause severe corruption. – sudodus Jun 14 at 12:22

Actually the reasn for a boot failure on cloned disk was that the UEFI feature was misconfigured on the BIOS. I reconfigured it properly and it boots. Thanks anyone who commented in this very helpful and reactive community.

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.