I'm trying to automate a restore process and I'm stuck! What I want to do is this:
1) Boot into sda3 (via GRUB)
2) Have that partition do the following automatically:
- load Clonezilla
- restore a specified partition image to sda2
- reboot
The problem is that I don't know how I can get Clonezilla to run automatically from sda3 (which is currently blank). Is it possible to install Clonezilla to a hard drive and auto-start it this way? If not, is it possible to install a very small version of Linux and then make that load Clonezilla, do the restore job, then reboot.
Ultimately, I just want to be able to select an option in grub, then walk away and when I come back sda2 will have been restored.
Any ideas?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used the first link to successfully install Clonezilla to sda3. However, that simply enables me to boot the interactive Clonezilla from the hard drive. I don't understand how I can configure that install to a) run non-interactively, b) restore a pre-specified image to sda2, then c) reboot.
I checked the second link but I don't see how that relates to the hard drive version of Clonezilla that I now have.
Can you help?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The 2nd link is about your question (2):
2) Have that partition do the following automatically:
- load Clonezilla
- restore a specified partition image to sda2
- reboot
With those parameters, you can make clonezilla run "automatically". Therefore if you put those ocs_* parameter in the boot parameters, clonezilla will respect those parameters.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks. I found the file I needed to change. I didn't realize that I had to expand filesystem.squashfs, change /etc/ocs/ocs-live.conf, then rebuild it.
One last question. My auto-restore works great except for one thing: at the end of the restore job I'm prompted to remove disks and press enter and then it reboots. Is there a way to remove that prompt so that as soon as the restore finished it just reboots?
If those ocs_* do not provide the function you need, yes, you have to modify filesystem.squashfs.
As for your question, yes, put "noprompt" in your boot parameter. //NOTE//, it's not for ocs_live_extra_param. It's something like:
--------------------
label Clonezilla Live
MENU LABEL Clonezilla Live
MENU DEFAULT
kernel vmlinuz1
append initrd=initrd1.img boot=live union=aufs noswap noprompt vga=788 ...
--------------------
However, I think I just discovered a pretty major bug!
I followed your linked instructions to install Clonezilla live (version 1.2.0-25) to the hard drive, which worked great. I got everything set up to automate my restore to sda2 task and this also worked great. Then I made some changes to my sda2 partition and wanted to save an image of that disk, so I used my Clonezilla Live CD (version 1.1.0-8). However, instead of loading the interactive Clonezilla as normal, the live CD booted up Clonezilla from the hard drive, which immediately started the restore job, which of course wiped out my sda2 install!!
To test, I moved the hard drive version of Clonezilla to sda4, leaving the GRUB boot files on sda3. The same thing happened.
Basically, what I think it happening is that the boot process in the live CD scans the hard drive and if it finds a /live folder on any partition it tries to load the filesystem.squashfs from there instead of from the CD! As a result, any custom commands, scripts, etc., from the Clonezilla installation on the hard drive get activated.
Pretty scary! Is there any way to fix this? Is this a known issue with a bug fix, maybe?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You should not test this kind of automatically restoring function in a real machine. Test it in a virtual machine first.
Also, you should post more info, including clonezilla version, your grub config file... as much as possible. Otherwise others do not have any way to reproduce this problem, or to check if anything you did is wrong.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to automate a restore process and I'm stuck! What I want to do is this:
1) Boot into sda3 (via GRUB)
2) Have that partition do the following automatically:
- load Clonezilla
- restore a specified partition image to sda2
- reboot
The problem is that I don't know how I can get Clonezilla to run automatically from sda3 (which is currently blank). Is it possible to install Clonezilla to a hard drive and auto-start it this way? If not, is it possible to install a very small version of Linux and then make that load Clonezilla, do the restore job, then reboot.
Ultimately, I just want to be able to select an option in grub, then walk away and when I come back sda2 will have been restored.
Any ideas?
You may refer to these:
http://drbl.sourceforge.net/faq/fine-print.php?path=./2_System/45_clonezilla_in_harddrive.faq#45_clonezilla_in_harddrive.faq
and
http://clonezilla.org/clonezilla-live/doc/fine-print.php?path=./99_Misc/00_live-initramfs-manual.doc#00_live-initramfs-manual.doc
Thanks for the links.
I used the first link to successfully install Clonezilla to sda3. However, that simply enables me to boot the interactive Clonezilla from the hard drive. I don't understand how I can configure that install to a) run non-interactively, b) restore a pre-specified image to sda2, then c) reboot.
I checked the second link but I don't see how that relates to the hard drive version of Clonezilla that I now have.
Can you help?
The 2nd link is about your question (2):
2) Have that partition do the following automatically:
- load Clonezilla
- restore a specified partition image to sda2
- reboot
With those parameters, you can make clonezilla run "automatically". Therefore if you put those ocs_* parameter in the boot parameters, clonezilla will respect those parameters.
Thanks. I found the file I needed to change. I didn't realize that I had to expand filesystem.squashfs, change /etc/ocs/ocs-live.conf, then rebuild it.
One last question. My auto-restore works great except for one thing: at the end of the restore job I'm prompted to remove disks and press enter and then it reboots. Is there a way to remove that prompt so that as soon as the restore finished it just reboots?
The current line I have in ocs-live.conf is:
ocs_live_extra_param="-k -t -b -p reboot restoreparts myImage-img sda2"
I guess I need to add a switch to that?
If those ocs_* do not provide the function you need, yes, you have to modify filesystem.squashfs.
As for your question, yes, put "noprompt" in your boot parameter. //NOTE//, it's not for ocs_live_extra_param. It's something like:
--------------------
label Clonezilla Live
MENU LABEL Clonezilla Live
MENU DEFAULT
kernel vmlinuz1
append initrd=initrd1.img boot=live union=aufs noswap noprompt vga=788 ...
--------------------
It's shown in this url here:
http://clonezilla.org/clonezilla-live/doc/fine-print.php?path=./99_Misc/00_live-initramfs-manual.doc#00_live-initramfs-manual.doc
The same page I mentioned in the previous post.
Okay, that seems to work.
However, I think I just discovered a pretty major bug!
I followed your linked instructions to install Clonezilla live (version 1.2.0-25) to the hard drive, which worked great. I got everything set up to automate my restore to sda2 task and this also worked great. Then I made some changes to my sda2 partition and wanted to save an image of that disk, so I used my Clonezilla Live CD (version 1.1.0-8). However, instead of loading the interactive Clonezilla as normal, the live CD booted up Clonezilla from the hard drive, which immediately started the restore job, which of course wiped out my sda2 install!!
To test, I moved the hard drive version of Clonezilla to sda4, leaving the GRUB boot files on sda3. The same thing happened.
Basically, what I think it happening is that the boot process in the live CD scans the hard drive and if it finds a /live folder on any partition it tries to load the filesystem.squashfs from there instead of from the CD! As a result, any custom commands, scripts, etc., from the Clonezilla installation on the hard drive get activated.
Pretty scary! Is there any way to fix this? Is this a known issue with a bug fix, maybe?
You should not test this kind of automatically restoring function in a real machine. Test it in a virtual machine first.
Also, you should post more info, including clonezilla version, your grub config file... as much as possible. Otherwise others do not have any way to reproduce this problem, or to check if anything you did is wrong.
I know I should've used a VM, but time was short! I managed to work around it though, so no harm done in the long run.
I'll do some more testing when I get some free time and post the results in the bug tracker area.