What must be changed for cloned Linux systems?

10,988

Solution 1

For Linux this depends upon the cloning software and OS used (Ubuntu in your case), but any static settings relating to network interfaces is a big one. IPs and (sometimes) hardware addresses will be stored in text files in the event of static addressing which you will have to change.

In Red Hat-based distros there is a tool called sys-unconfig which will undo these types of settings to prepare it for reconfiguration, although I'm not aware of an Ubuntu equivalent. There aren't really "SIDs" in a Linux environment, so sysprep tools aren't really needed. The closest thing to a SID would be stored in the SAMBA files under /etc for remote administrative connection purposes, which you can modify. Likewise you will need to regenerate any SSH keys if you had any created.

Solution 2

I really should be adding this to John's post, but since I do not have points to comment everywhere...

/etc/cups/cupsd.conf for network printers. password files for VNC is also important.

Having said that, the prepare-whatever step is mostly a MS windows issue.
Unless written in a very evil way, applications should, and must have data (the config) and code (the binary executables) separated in a clean manner.

Not recommended at all, but once I had a situation where cloning by
dd if=/dev/$disk |nc X.X.X.X Y to dest nc -lp Y > /dev/$disk
had to be done, on diffrent hardware (although same CPU arch), and it still worked.
Separation of your config file is a important thing.

For mass deployment, you might get clonezilla to work nice. Good old PXE boot Installation works as well. SystemImager has articles that fits the job discription How to back up an ubuntu 8.10 system with SystemImager
clonesys fully-automated-installs And finally Ubuntu Installation Help

Basically, most of these will have automated ways one way or another to do most of your job, like network config, DNS resolvers, sync time, etc, etc...

The oddball I had experienced recently was with firewall configuration files. Do not forget them.

Share:
10,988

Related videos on Youtube

Stephen Jennings
Author by

Stephen Jennings

Updated on September 17, 2022

Comments

  • Stephen Jennings
    Stephen Jennings almost 2 years

    When cloning Windows systems, it's fairly well-known that one should run sysprep before creating an image. This way, when the machine starts up, it will reconfigure itself for its new environment: re-generate machine SIDs, install appropriate drivers, create initial user accounts, etc.

    I have less experience with Linux machines, so I ask: what sort of pre- or post-cloning actions should be taken when cloning Linux machines? I haven't found any mention of it online, it this because I'm not looking hard enough or because it's just not a necessary step with Linux machines? I'm particularly interested in Ubuntu Server and Desktop since those are what I'm toying with, but I don't know how much the distribution matters for this question.

    Obviously I'd want to change the hostnames, and I don't expect a comprehensive list of every software that might need to somehow be reconfigured, but are there any common system settings or software packages that need reconfiguration when being imaged?

  • Stephen Jennings
    Stephen Jennings over 13 years
    I hadn't thought of SSH keys, that's a good point.
  • charlesbridge
    charlesbridge over 13 years
    You'll probably have problems with the UUIDs in /etc/fstab, too. You might want to switch back to the older /dev/sda format.
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 13 years
    The hostname (/etc/hostname) and the ssh keys (which are also the machine's identity) are the two things you will always need to change. What else must be changed depends on the hardware (most of the time, only the video settings need to change) and the network configuration (highly variable).