8

I have installed Ubuntu on a 32GB USB and set it up like I want, Installing some programs and removing others. I have added custom wallpaper and splash screen.

How can I duplicate my modified OS and GMail it using Google Drive, (10GB limit), to friends and family for Christmas?

It should be able to run on any modern x86-64 computer that meets Ubuntu hardware specifications. It should be uninstallable using Rufus, Etcher, mkusb and Gnome-Disks. I would also like to be able to install it from a USB stick.

I have heard of and tried Remastersys, ISORespin, Ubuntu Customization Kit and Systemback, but now these all seem to be abandoned now.

Sometimes I work in VirtualBox and would like to be able to distribute the OS's I create there also.

6
  • It is not possible to fit any sensible OS installation in 25 MB limit. The installation images of any OS - be it Linux or Windows - are WAAAAY larger than that. Do you seriously think about e-mailing OS install???
    – raj
    Jan 14, 2021 at 12:51
  • @raj: Oops, must have been thinking GMail using Google Drive, (10GB limit). or DropBox, I will edit the question. Jan 14, 2021 at 13:46
  • @Zanna Thank you for the edit, from 480 Miles due south of Chennai Jan 14, 2021 at 14:26
  • @C.S.Cameron :) must be lovely there!
    – Zanna
    Jan 14, 2021 at 16:52
  • Systemback works despite being abandoned. There are others. I worked out some good dd commands. See raywoodcockslatest.wordpress.com/2021/08/18/vmware-v2p/#Summary Aug 22, 2021 at 19:49

2 Answers 2

8

Duplicating a Ubuntu System for Distribution

1) Create Image file from existing operating system:

  • Boot Live Ubuntu USB and insert Full install, (or Persistent), USB to be copied.

  • Create an image file of the Full install USB, (or Persistent USB), using Gnome-Disks.

enter image description here

enter image description here

2) Truncate image for distribution, remove unwanted space from end of image file.

Example: Removes NTFS Microsoft basic data partition from end of drive.

Input

ubuntu@ubuntu:~$ cd /media/ubuntu/DATA/
ubuntu@ubuntu:/media/ubuntu/DATA$ fdisk -l DiskImageofsdd.img

Output

Disk DiskImageofsdd.img: 28.66 GiB, 30752636928 bytes, 60063744 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 82741D01-6511-4A8A-8FDF-52D8C165C178

Device                 Start      End  Sectors   Size Type
DiskImageofsdd.img1     1953     3906     1954   977K BIOS boot
DiskImageofsdd.img2     3907   503906   500000 244.1M EFI System
DiskImageofsdd.img3   505856 44578815 44072960    21G Linux filesystem
DiskImageofsdd.img4 44578816 60061695 15482880   7.4G Microsoft basic data

Input

ubuntu@ubuntu:/media/ubuntu/DATA$ truncate --size=$[(44578815+1)*512] DiskImageofsdd.img

3) Compress image for distribution:

  • For xz compression using 7Zip. Install 7Zip for Windows: https://www.7-zip.org/a/7z1900-x64.msi or for Ubuntu P7Zip Desktop from the Ubuntu store. Once 7Zip has been installed on Windows or Ubuntu, flashing tool should work without first decompressing xz file..

  • PKZip compression, may also be used but is not as tight.

4) Virtual Machine: Convert .vdi file to .img file that can be flashed to bootable USB.

  • Open VirtualBox

  • cd to folder that contains ubuntu.vdi and run:

VBoxManage clonemedium --format RAW ubuntu.vdi ubuntu.img

5) Install Image File to target drive

Caution: The target drive will be overwritten.

  • Use the pancake icon in Disks or use Etcher, Rufus, dd or mkusb when you want to restore or clone the image to another drive.

6) Create Installer Drive for Image File.

  • Use Etcher, Startup Disk Creator, dd, mkusb, etc to make Live USB.

  • From another Linux drive, convert new writable partition to NTFS partition using:

ubuntu@ubuntu:~$ sudo mkfs.ntfs -f -L usbdata /dev/sdx3

Where sdx is the Live drive.

  • Place the OS image file in the NTFS partition of the Live USB, where it can be flashed to a target drive from the Live USB when required.
4
  • Your answer is not very clear. If the OP wants just to "clone" his installed system onto another USB drive, isn't it sufficient just to get the image of the source USB and write the image to the target USB? What are steps 4 and 6 for (especially, what has a virtual machine to do with all this)? And what "flashing tool" exactly do you mean in step 3?
    – raj
    Jan 14, 2021 at 13:04
  • @raj I understand the idea is to be able to share a modified OS. My friends would not have a clue how to clone a drive but they can use Rufus. The answer shows a method how to share a virtual machine with someone who does know VBox exists item (4. The installer, drive item (6 , is to plug into a computer and flash the OS onto a USB or SSD or HDD. The flashing tool can be Rufus, Etcher, mkusb, Disks, dd, etc. Jan 14, 2021 at 14:37
  • So basically, if the OP creates the OS image and sends it to someone, the other person needs only to use whatever tool they know to clone that image onto another USB drive. They don't need any VM for that (as the OP did not say anything about any VM, so I assume he doesn't have one) and they don't need step 6 - am I right?
    – raj
    Jan 14, 2021 at 14:42
  • @raj: Some people like to use a VM for creating their ideal OS. The OP has this option. It is possible to convert that VDI to an IMG and put it on an installer drive that can be used to install that OS on a USB or Internal drive.I think the OP is going to edit the question to include virtual machines. Jan 14, 2021 at 16:09
1

We have been updating a fork of Remastersys for several years now, called Wasta-Remastersys

Note that we removed the GUI for creating an ISO, but it can run in "dist" (don't save user settings, instead be ready for distributing to others) or "backup" mode (save your settings, etc). Also note that the ISO specification is limited to 4GB in size: if the resulting ISO is larger then there will be a failure.

We have added features from Pinguy Builder, etc. to make sure it runs in UEFI mode, can install broadcom drivers offline, etc.

Good luck! It has served us well over the years.

1
  • I will try to give it a try, if it is simple enough. Remastersys was doable for me. Thanks Jan 14, 2021 at 13:06

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.