Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Cloning an Ubuntu Machine

Options
  • 11-10-2013 8:40pm
    #1
    Registered Users Posts: 839 ✭✭✭


    Hi guys.
    I have Ubuntu installed on a VirtualBox machine on my Windows 7 laptop. I have a spare server, and was going to install Ubuntu as the dedicated OS on this. I assume I can just get the basu ubuntu iso and boot from a CD to kick off an install.
    The problem is that I would like to replicate the exact machine thats on my virtual laptop install, on the server - as in all the software, configuration, user accounts/passwords - I want it to be the exact same machine.
    I'm guessing its possible, by creating an image of the existing build or something similar, but my lack of experience with ubuntu means I'm not quite sure where to start. Would really appreciate some guidance.


Comments

  • Registered Users Posts: 5,238 ✭✭✭humbert


    I've done similar to this and it's worked fine. Presume it'd be just the same on a VM. Others may have more elegant solutions though.


  • Registered Users Posts: 2,720 ✭✭✭niallb


    If you're used to rsync, it will work well for you - I often use it and you can get very good results.

    A really handy approach is to download a copy of clonezilla live.
    Boot your virtual machine from the iso, and back it up to a network location.
    Then boot the hardware machine, and restore from the same network location.

    If you have a udev based distro, delete the file 70-persistent-net.rules from /etc/udev/rules.d before restarting the vm to back up.
    If you don't, the hardware machine will come up with interface eth2 for example as the rules will link eth0 to the hardware address of the card in the VM, which will not be in the hardware box. This is a really clean way to clone, and you have a full backup if anything goes astray.
    I use a similar technique to deploy and update a central image of an ubuntu 12.04 install to a few dozen machines.
    I actually use 'fog', but as it doesn't currently support ext4, clonezilla is better for default installs.


  • Registered Users Posts: 53 ✭✭spynappels


    +1 for niallb's solution, I've used Clonezilla to move a VM to physical hardware without too many issues.


  • Registered Users Posts: 838 ✭✭✭human 19


    I use qt4-fsarchiver run from a live disk/usb to copy and reinstall partitions

    Unlike clonezilla, it doesnt copy blank info, only the data, so its much quicker.
    I have previously used this to save all my partitions, dban the disk, set up new partitions and reinstall the old partitions back on to the new ones.

    Unlike clonezilla, this also allows you to copy from a larger partition to a smaller one, as long as there is enough room for the data

    I also use it to save back-ups of whole partitions


  • Registered Users Posts: 2,720 ✭✭✭niallb


    Clonezilla doesn't copy empty blocks unless you're using an unsupported filesystem, in which case it will indeed run a full filesystem copy.
    Filesystem supported: (1) ext2, ext3, ext4, reiserfs, reiser4, xfs, jfs, btrfs of GNU/Linux, (2) FAT12, FAT16, FAT32, NTFS of MS Windows, (3) HFS+ of Mac OS, (4) UFS of FreeBSD, NetBSD, and OpenBSD, (5) minix of Minix, and (6) VMFS3 and VMFS5 of VMWare ESX.
    Therefore you can clone GNU/Linux, MS windows, Intel-based Mac OS, FreeBSD, NetBSD, OpenBSD, Minix and VMWare ESX, no matter it's 32-bit (x86) or 64-bit (x86-64) OS. For these file systems, only used blocks in partition are saved and restored. For unsupported file system, sector-to-sector copy is done by dd in Clonezilla.

    Clonezilla's default settings don't allow for copying a partition to a smaller one.
    It's not hard to get around if you're running off a live cd like partedmagic,
    and it's a reasonable default behaviour, but fsarchiver wins here hands down for convenience.


  • Advertisement
Advertisement