14

I am new to linux, but had a question. I am getting in the business of buying old computers, putting Linux on them, then donating them to students who don't have their own computer at home. I have gone through and installed Xubuntu on my system, installed/uninstalled all the software that I want/need, and now want to know if there is a way that I could make an ISO of my system, and put it onto ANOTHER computer, and still have all of my tweaks, and programs ready to go after the ISO has installed. That way I don't need to go through and spend an hour or two on every computer.

What programs would you recommend for creating an ISO like this?

Thanks, Tobin

1

7 Answers 7

6

Parts of this answer comes from: How to move Ubuntu installation from one hdd to another?

I can't say an exact answer for the creation of an ISO as you say in your question but if you wish to reduce the amount of time for creating identical copies of an operating system in different computers, the Cloning process can be useful for your case, of which I suggest you the usage of Clonezilla which can be useful for cloning hard disk drives even for those situations on which you need to do it with different size disks as mentioned here: http://www.tuxradar.com/content/how-clone-hard-drives-clonezilla

enter image description here

Moving to a bigger disk

It's easy to ensure that a clone of a SCSI disk is restored to a SCSI disk, but you'll have a tough time finding an exact replica size-wise. The good news is you don't have to restore a disk on another disk of the same size. The even better news is that you can in fact restore the image to a much larger disk.

When restoring a disk, Clonezilla enables you to resize the filesystem and create partitions on the new disk proportionally. But even if you are moving to a bigger disk, you might prefer to keep the partitions as they are. In that case you can ask Clonezilla to create the partition table as its listed in the image.

There is documentation about moving to a larger disk but I am not sure that you can do it the opposite (cloning to a smaller disk). That's why I should suggest you to use just the amount of hard disk drive space needed for the install or check which is the smallest hard disk drive of your equipment in order to create the install based on that disk. Let's say: If you have 9 hard disk drives, 2x100GB, 4x80GB 2x40GB and 1x20GB, let's use the smallest one to install and to be the source for cloning so you can clone it in the largest ones. Remember to expand the partitions as needed in order to use the full hard disk drive after cloning.

Clonezilla offers several Live CD's and bootable USB images and there is also documented that you can resize the free space on the disk after the copy, in which case the suggestion to use gparted is also a good idea.

You don't need to worry about drivers and possible failures related to these things. Ubuntu will install whatever drivers as needed for the new computer, except the proprietary drivers of certain video cards (ATI/nVidia) or more specific hardware. Based on that I suggest you to check every cloned system in order to make sure that everything is running fine after the cloning.

By using a cloning procedure you can do as many customization as you wish to the system and be sure that all the cloned hard disk drives will have the same software that you include on the original.

Good luck!

3

There is extensive documentation on how to create custom installation CDs. Relevant to your question is this excerpt from that page:

Probably the prime motivation to build your own install CDs is to modify which packages are installed; in particular you may want to add some packages to the CD.

The easiest way to do this is to build an 'extras' repository structure, containing only your extra .debs, and merge these into the CD file hierarchy before rebuilding the .ISO image. This guide will step you through how to do this.

I would caution against doing too much customization, preferring to copy /home/tobin/.config and similar files using a simple rsync once the machines are bootstrapped. This suggestion is largely based on the introduction on the instruction page:

The process of customizing or "remastering" Ubuntu installation CDs is not especially complex, but it is a little tedious and finicky.

Which I read as "the more clever you try to be, the harder it will to get right".

2

It might be partly off-topic, but perhaps PXE and kickstart + preseeding with a post-install script could be a safer solution. Some info on kickstart and PXE. At my company I am using kickstart + preseeding for installing VMs on some Xen servers, I have to admit though that I never installed a GUI-enabled host this way.

There is an app called system-config-kickstart (available in standard repo for all I know) with which you can browse through most options and easily create a kickstart configuration file. The packages section not working properly, it seems, as apparently not every functionality is ported from RHEL/Fedora yet, but it is still possible to add that section manually to the configuration file.

There are also tricks for post-install scripts, like setting up default root passwords for MySQL servers etc., but I suppose we'd need more data in order to help with a specific requirements setup.

I found surprisingly much data about those topics in 'The Official Ubuntu Server Book' by Kyle Rankin (not trying to advertise in here though).

2
  1. Install Ubuntu (or in your case Xubuntu)
  2. Install the programs you want & make any other changes you want
  3. Install Remasterys:

-------3a. Download key: http://www.remastersys.com/ubuntu/remastersys.gpg.key

-------3b. In the Ubuntu Software Center you need to open your sources and import the key

-------3c. In the Ubuntu Software Center you need to add a new source: deb http://www.remastersys.com/ubuntu precise main

-------3d. Close the Ubuntu Software Center and Open your terminal and type: sudo apt-get update

-------3e. In the Ubuntu Software Center search for remastersys, and install it make sure to check the addon box for the gui.

  1. Once you've installed remastersys you can use it to make an iso file of your operating system, that you can install on other computers. It will be an exact duplicated but you will be able to install it like you would with a normal ubuntu (or xubuntu) iso.

Please note: Remastersys does not support UEFI, and the iso file that is generated may not work under CPM mode on some UEFI systems.

0

Plug both HDDs in, then check which drives are which device files using gparted and then:

sudo apt install pv
sudo pv /dev/sdX | sudo dd of=/dev/sdY bs=128M

This will copy the full contents of your first hard drive (in this example /dev/sdX) 1:1 (bitwise) to your second drive (here /dev/sdY) considering your second drive is either bigger or the same size as the old drive (otherwise as soon as the second drive is full the write operation will abort).

You could use an external HDD for that. Clone it to your HDD and then clone your external hdd to every computer you need to install the system to.

6
  • Will only work if the destination PC IS the source PC, or IF the destination PC and OS boot in legacy mode. Not for UEFI
    – ProDigit
    Jul 22, 2020 at 17:20
  • It also works on UEFI and you can either plug the destination HDD to the source PC or use an external HDD as already said. In case you are conderned about boot entries, there are some ways you can get them to work again. Usually, it will boot from the ESP and work just fine.
    – xdevs23
    Jul 23, 2020 at 18:14
  • No it doesn't! BIOS won't boot the UEFI drive when DD is used to clone one drive to another. I've tried.
    – ProDigit
    Jul 23, 2020 at 19:31
  • That's not in the scope of the question and if u really need to do UEFI -> BIOS you can still do that. Install BIOS variant on one HDD and clone that.
    – xdevs23
    Jul 24, 2020 at 20:26
  • Not if the OS of the first drive is installed as UEFI. And the answer is perfectly within the scope of the question!
    – ProDigit
    Jul 25, 2020 at 5:11
0

With dd it might work, Create an ISO, save it to an external drive, Boot your destination PC with a live CD of Linux, Use DD to 'unpack' the ISO to the SSD, This only works IF your destination PC drive size is the same or bigger than the source/ISO, AND if you're booting in Legacy mode. Does NOT work for UEFI installations.

Do note, that most modern 64 bit operating systems use UEFI, and only few still use legacy.

0

Remastersys project lives on here: https://github.com/nerun/remastersys

Images >4GB now supported: https://github.com/nerun/remastersys/issues/11

All we need now are ports to other Linux versions for portability e.g from AWS:

sudo apt install remastersys*.deb

sudo apt install xorriso

man remastersys

sudo remastersys backup

  ___ ___ __  __   _   ___ _____ ___ ___  _____   _____
 | _ \ __|  \/  | /_\ / __|_   _| __| _ \/ __\ \ / / __|
 |   / _|| |\/| |/ _ \\__ \ | | | _||   /\__ \\ V /\__ \
 |_|_\___|_|  |_/_/ \_\___/ |_| |___|_|_\|___/ |_| |___/
  Version 4.9-1

BACKUP MODE SELECTED

Checking if the /home/remastersys folder has already been created.

Copying /var and /etc to temporary area and deleting extra files.

Setting up Live CD options for mode backup.
update-initramfs: Generating /boot/initrd.img-4.19.0-25-cloud-amd64
live-boot: core filesystems devices utils memdisk udev blockdev dns.

Copying your kernel and initrd to the Live CD.

Creating filesystem.squashfs. It will take a while, so be patient...

Parallel mksquashfs: Using 1 processor
Creating 4.0 filesystem on /home/remastersys/ISOTMP/live/filesystem.squashfs, block size 1048576.
[================================================================================\] 29001/29001 100%

...
Creating remastersys-livecd.iso in /home/remastersys using grub-mkrescue.

Creating remastersys-livecd.iso.md5 in /home/remastersys.

/home/remastersys/remastersys-livecd.iso is ready to be burned or tested in a virtual machine.

Check the size and if it is larger than 4GB, the USB key must be formatted in exFAT:
365M /home/remastersys/remastersys-livecd.iso

It is recommended to run "sudo remastersys clean" once you have burned and tested the image remastersys-livecd.iso.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .