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.
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.
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.
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.