Easiest & Quickest tool to clone Linux ??

Discussion in 'Linux' started by smallhagrid, May 30, 2018.

  1. smallhagrid

    smallhagrid MDL Senior Member

    Sep 14, 2013
    Hi Folks.
    Without getting overly specific, from years of doing it I know there are a bunch of really super easy & quick tools to clone that 'other' OS basically in a one-and-done manner. (i.e.: 'Drive Snapshot', etc...)

    Having "graduated" into a happier time of Linux (Ubuntu Mate) use, I have tried to narrow down the choices to some sort of similar solution that is quick, easy & GUI based rather than a whole bunch of strung out DD commands via the CLI.

    Yes, there are GUIs for DD, and I may end up just using one of those, but I am very much hoping that someone who knows more than myself will point me to something even better ??

    For a while there was cloning heaven to be had via 'Redo Backup' - but it now seems abandoned & I've no idea if it will handle anything newer than 12.04 correctly.

    The back-story here for anyone who has read this far (Thanks !!):
    After a very busy 20+ year career as an independent consultant, aging & illness forced me to mostly retire.
    For a while now I have kept serving the needs of just a few hangers-on that became good friends during those other times.
    Of course all of them have heard of the wonders of using Linux from me over time & naturally became curious.

    That handful of folks have (all except 1) since become delighted Linux users.

    Now, the time has arrived for several of them to upgrade a bit & of course that means Ubuntu Mate 18.04 is the basis for all.

    Given that we're all also great fans of the really minimal & clean way that win2k pro operated, I do a number of small tweaks to sort of minimalize that already very clean OS - always the same tweaks, also:
    Given that all of our small 'group' use about the same apps for emailing, browsing, making some docs now & then, viewing photos, etc. and zero gaming or online chatting of any sort - I remove the apps that will just sit there unused - again - all the same for the lot of us.

    No worries about Linux waking up & struggling with driver issues as the h/w we use is not unusual or fancy - also no desire for raging hot speed as it is not needed as much as simplicity & reliability are preferred.
    (The setup I make has root, home & swap partitions as I've found that is all which we need.)

    The starting point for me is getting this all set up this way on a single PC - which is already about 98% done.
    My next desire is to get it sort of 'canned' - then to just blast it onto the other couple of PCs without having to fix GRUB2 as I've had to do in the past.

    Hopefully...as I said before - someone else here will have some helpful pointers allowing me to accomplish these things more quickly & easily without having to repeat the same actions over & over ?!?

    Thanks for any helpful replies.
  2. Dude Guyman

    Dude Guyman MDL Junior Member

    Jun 20, 2017
    #2 Dude Guyman, May 30, 2018
    Last edited: May 30, 2018
    If I am hearing correctly, you want to set it all up on one PC then image the drive and "restore" that to other PCs?

    My thoughts on that depend on the file system. EXT3 can be done with Acronis True Image 2014+ or Macrium Reflect (free or paid).

    EXT4 can be a bitch. Acronis and most others I tried will only do a sector by sector, 1:1 (forgot proper terminology) image/clone and it will be huge (a 90GB partition with 8GB used was 40GB) because it images everything, even unused space and all the deleted/overwritten data on it. The latest Macrium Reflect (7.1.3196+) seems to handle EXT4 properly, but I have not tested restoring the ext4 images enough to say I fully trust it. That said, I have made a couple ~2.4GB images and successfully restored them. But it's free and only takes a few minutes to try? Then there is Clonezilla that I have heard can handle it well, but I hate the gui/interface on that, will not use it.

    Also if you clone the install to another PC, it will have the same UUID, user, and computer/host name and all that I may not have thought of. You'll want to change the host name if they are networked and how you do that varies depending on distro. I think this works on *buntu:

    Replace "leafpad" and "new-name" with whatever you use. gedit, xed, mousepad, leafpad, etc.

    (lasts until reboot)
    sudo hostname new-name

    (permanent, edit and save the file)
    **old way pre-18.04: gksudo leafpad /etc/hostname**
    gksu is no longer in ubuntu 18.04 so I guess this (or whatever replacement you may have found) would work:

    sudo -i
    leafpad /etc/hostname

    if you want a Macrium 7.1.3196 boot ISO (WINPE CDROM) to avoid installing it on Windows and creating your own, I can set you up with that. PM me.
  3. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
  4. smallhagrid

    smallhagrid MDL Senior Member

    Sep 14, 2013
    Thanks HUGELY for such a terrific reply Dude Guyman !!
    (I've sent you a message here...)

    I forgot to mention that I've selected EXT3, having heard of some problems with EXT4...

    Also meant to say that I too despise Clonezilla - and not just because of its rotten GUI; it has screwed up on me before & I won't ever trust it again.

    I've used older versions of ATI before & it was pretty good - but I've used none so new as to support EXT3.

    It'd be great if someone would revive Redo because it worked so well when it was current enough to get the job done.

    One thing is certain - for Linux to become more popular as a desktop style OS, things like being able to easily clone it without needing a precise collection of DD commands is very important - if for no other reason than to allow folks like me to roll out PCs for friends who will be delighted with the reliability of Linux.

    As for the identifiers - those could easily be handled or even just ignored as these PCs will be quite distant from each other & on different ISPs for certain.

    Thanks Again Dude Guyman !!

    I tried RDI sometime back - was not impressed & did not buy it.
  5. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. LiteOS

    LiteOS MDL Expert

    Mar 7, 2014
    There a option to disable uuid in grub 2 if im not mistaking
  7. Dude Guyman

    Dude Guyman MDL Junior Member

    Jun 20, 2017
    #8 Dude Guyman, May 30, 2018
    Last edited: May 30, 2018
    You can change uuid too, but as long as he doesn't have two drives with the same uuid in the same pc, I don't think that matters? My concern would have been two PCs on a home network with the same hostname. That's the problem I had once before, it's easily fixed/changed though.

    EDIT: More thoughts. I have had Macrium spit out and error during the creation of an image before about "failed: could not read disk" or some such crap. No idea what causes it but assuming the file system is healthy, which it was, I just shut down, and try again and all worked fine. Go figure.

    It's probably a good idea to run a "fschk" to make sure first. Easiest way I've found to do that is:

    list disks to find the correct one (sda1 = change to whatever your root drive is):
    sudo blkid

    check current "Mount count":
    sudo tune2fs -l /dev/sda1

    Set "Maximum mount count" to whatever "Mount Count" was above (assume it was 30) and reboot (FSCHK will run):
    sudo tune2fs -c 30 /dev/sda1

    then run "sudo tune2fs -c 40 /dev/sda1" again to set it back to whatever frequency (40) you want auto fschk to run in the future, or -1 for never.
  8. smallhagrid

    smallhagrid MDL Senior Member

    Sep 14, 2013
    When doing multiple PCs for offices or business networks with that 'other' OS that was always important & there was at least one very nifty, free utility that did it in a jiffy, but for casual home use with Linux it should be fine & is still easy enough to change.

    Thanks !!
  9. fabre gastro

    fabre gastro MDL Junior Member

    May 29, 2018
    if i were you? i will first make my dream OS dream distro install and configure and modify everything and make sure it works perfectly as i wanted. and then i will copy all the configuration files and permissions associated with those configuration files like apache.conf or sendmail.cf and the file permissions for a hardened system and create a script and copy those over to a new system and run the script which will put the configurations for desired daemons or programs in their respective directory and the permissions script to make a perfect image.
    Even better option will be to copy all those configurations and create a livecd and let the livecd just make an exact image of the original setup.
    I will never clone it like that, it never solves the problem. like what if you are copying from one bigger encrypted hard drive to a smaller encrypted hard drive. the UUID and et al will not match and will result in a non-bootable system, i havent spoken about grub and full disk encryption yet. hehe
    but if i were to apply intelligence, i will set up a git/rsync server in the lan or trusted online location, push/pull all the configurations to it, like, make a skel system and pull/push the files from there.
    i use livecd and git/rsync approach because i work in a really mind confusing various setup environment and i manage way too many systems in thousands, i can not afford to clone all systems, instead i use a combo of git/rsync and livecd to do it for me and lastly you need to be lazy to be intelligent and vice versa.
    here is a pro-bono tip: you may use tcl/tk's expect suite to complete automate the entire setup to even more fine tuned.
    like copying debian/ubuntu system independent files to redhat/suse and vice-versa.
    but then again my method may not suit yours. you need to apply your intelligence to solve your problems intelligently, my method may require intensive research and testing and most importantly "TIME" which you may lack.