There might be possibly more than one right answer. Having little experience in the area, I'm asking about the best / most reasobable way to manage my tools and resources in this particular task.

The setup

There is a server, accessible remotely by ssh, with no physical access. It has two hard drives:

  • sda is partitioned for boot (sda1), root/user fs (sda2), swap (sda3) and raid (sda4);
  • sdb is perfectly clear and freshly installed.

On sda2 there is, among other files, rather huge disk image made with Clonezilla. Never used this software before, so I hope there is everything in place - it is a folder containing quite a lot of dd-img, .mbr, list, hash sums etc.

The target

I want to have said Clonezilla disk image restored to sdb.


With physical access, this would be easy. However, right now I can identify following obstacles:

  • no way to insert live cd/usb for booting; It is, however, possible to run clonezilla live from iso image on hard disk. I downloaded such image and copied it to sda2;
  • this livehd tutorial says it is needed to prepare single FAT partition for clonezilla to run. I definitely won't touch sda1/3/4 (boot, swap and raid data I wouldn't like to lose) and I'm afraid to partition sda2 having system data on it. So perhaps use sdb (target disk) and let it be overwritten once booted clonezilla goes to RAM? Or use sda4 anyways and restore it from backup later?
  • again, there is remote access only and clonezilla has ssh disabled by default. This answer pointing to this doc sounds like a solution here, although requires PXE setup. Never did that before.

Possible routes?

Right now I'm thinking about setting up PXE server on different machine and pointing my 'target' server to get boot info from it. In this case, on which machine should clonezilla image be located?

Or, since I hope this would be one-time task, perhaps I can simplify something? Edit clonezilla image (can mount it normally, right?) to allow ssh by default, perhaps restricting IP access or changing default password?

Finally, how would you go about running system from this image? Where could I store it, if it indeed needs separate partition? And in case the best answer would be a partition on clear 'target' disk, how to make the system go to RAM at boot? Remember I would only be able to ssh into it once it is fully alive (so, booted, with network up, etc).

I hope this sounds less chaotic than I feel about it :) Situation is quite complicated for me and my previous experiences; I hope someone here can set me straight.


After quite a lot of trial and error I found a way. Hopefully will be helpful for someone, sometime.

Mission accomplished, my disk is restored, and here is how:

  1. Downloaded Clonezilla live as according to this doc, up to configuring GRUB (so, downloaded, unpacked, changed 'live' folder name);
  2. Set up FAT32 partition on sdb (the disk to restore to, 'target' one) using fdisk and mkvfat. Partition size was enough to store live Clonezilla image (200M?) and was set bootable.
  3. Configured GRUB by creating this entry: (explained below)

    menuentry "Clonezilla" {
    set root=(hd1,1)
    linux /live-hd/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_prerun=\"dhclient -v eth0\" ocs_live_run=\"/bin/bash\" ocs_live_extra_param=\"\" keyboard-layouts=NONE ocs_live_batch=no locales=en_US.UTF-8 vga=788 ip= nosplash live-media-path=/live-hd bootfrom=/dev/sdb1 toram usercrypted= ocs_daemonon=\"ssh\" i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.blacklist=yes
    initrd /live-hd/initrd.img
  4. The GRUB configuration was recreated to include this entry (grub2-mkconfig) and boot mode was selected. There are two routes:

    • set this entry as default in /etc/default/grub before creating conf
    • or just add it there and select on startup, if you have KVM IP set up (so kiiiinda like physical access to machine, won't allow BIOS manipulation, but boot entry switching - yep).
  5. Reboot machine, wait for it to boot into Clonezilla and login via ssh as 'user' - it has sudo rights.

  6. Run 'clonezilla' script in command line and follow along the lines of standard tutorial

  7. Go back to terminal and swap boot to your normal system (otherwise it will fail, searching for clonezilla on now-nonexistent partition). Reboot. Enjoy.

What do the grub menu entry do?

It is compiled from two tutorials and some experiments: http://clonezilla.org/livehd.php http://clonezilla.org/show-live-doc-content.php?topic=clonezilla-live/doc/05_Started_with_sshd_on_and_passwd_assigned

Aim is to have it:

  • configure network at startup, thus ocs_prerun=dhclient option
  • run bourne shell (ocs_live_run=/bin/bash)
  • ip=<empty> in order not to mess with dhclient
  • toram with no options in order to put whole system in RAM, so it can overwrite the disk from which it was originally booted This makes it one-time operation, after that your live clonezilla is gone
  • start SSH server (ocs_daemonon=ssh) with [optionally] password set for user ('usercrypted'). The password part works as described in second tutorial linked. Perhaps (untested) you can leave it empty and have access as 'user' with no password - in such case it's probably good idea to change password immediately after login.

Phew, that's it. I'm really glad I have this puzzle solved and at the same time I have nagging feeling that someone more experienced would just do it in a minute or two...

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.