I am attempting to use Clonezilla to restore an image to multiple disks. I am running the "ocs-restore-mdisks" command from a custom bash script run from the Clonezilla command line. Once the image has been restored to the disks, I would prefer to have the Clonezilla "mdisks" command end at a command prompt (or, ideally, return to my script). But no matter what I enter for the "-p" option, the command always ends with the "Choose mode" dialog menu. If I use "-p command" in the single-disk command, ocs-sr, it works fine, and ends at the command prompt. But the "mdisks" command always ends with the Choose menu. Is there something I'm missing in my command?
Multiple Disk Command (which ends at Choose menu):
/usr/bin/ocs-restore-mdisks -b -p "-g auto -e1 auto -e2 -r -j2 -c -scr -p command" my_image_name sda sdb sdc
Single Disk Command (which ends at command prompt):
/usr/bin/ocs-sr -g auto -e2 -r -j2 -c -scr -p command restoredisk my_image_name sda
The Clonezilla version I'm using is Disco amd64 20190903.
Last edit: Brian Balzer 2020-02-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The option -p of ocs-restore-mdisks is about the command for ocs-sr to run, i.e., the "-p command" is for ocs-sr, not for ocs-restore-mdisks.
You can put the boot parameter when booting clonezilla live:
ocs_postmode_prompt="cmd"
or edit the file /etc/ocs/ocs-live.conf, append the above line.
Then cos-restore-mdisks will honor this setting.
Yes, we should have an option for ocs-restore-mdisks to force to that, so we will try to add that in the future.
Steven
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Steven, thank you very much for your response. Your suggestion almost gets me there. When I add ocs_postmode_prompt="cmd" to /etc/ocs/ocs-live.conf, once the "mdisks" command ends, it essentially finishes at a command line version of the dialog menu asking the user which choice to make (poweroff, reboot, command line, start over, etc.) with "Enter command line prompt" as the default value. But it doesn't quite get to the command prompt. The attached screen shot is what I'm seeing. Now, all it takes is a quick stroke of the Enter key to exit to the command prompt (and thus, back to my script), which is certainly easy enough. But is there any way to give it that last little nudge to the command prompt?
Please give testing Clonezilla live 2.6.5-21 or 20200302-* a try. We have improved ocs-restore-mdisks with a new option "-a". You can follow the same step to use the TUI to run it, and the prompts in green will show you the whole picture. Remember to choose "-p cmd" so that you can get a command that will enter command line when ocs-restore-mdisks is finished.
Please let us know the results. Thanks.
Steven
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am attempting to use Clonezilla to restore an image to multiple disks. I am running the "ocs-restore-mdisks" command from a custom bash script run from the Clonezilla command line. Once the image has been restored to the disks, I would prefer to have the Clonezilla "mdisks" command end at a command prompt (or, ideally, return to my script). But no matter what I enter for the "-p" option, the command always ends with the "Choose mode" dialog menu. If I use "-p command" in the single-disk command, ocs-sr, it works fine, and ends at the command prompt. But the "mdisks" command always ends with the Choose menu. Is there something I'm missing in my command?
Multiple Disk Command (which ends at Choose menu):
/usr/bin/ocs-restore-mdisks -b -p "-g auto -e1 auto -e2 -r -j2 -c -scr -p command" my_image_name sda sdb sdc
Single Disk Command (which ends at command prompt):
/usr/bin/ocs-sr -g auto -e2 -r -j2 -c -scr -p command restoredisk my_image_name sda
The Clonezilla version I'm using is Disco amd64 20190903.
Last edit: Brian Balzer 2020-02-19
The option -p of ocs-restore-mdisks is about the command for ocs-sr to run, i.e., the "-p command" is for ocs-sr, not for ocs-restore-mdisks.
You can put the boot parameter when booting clonezilla live:
ocs_postmode_prompt="cmd"
or edit the file /etc/ocs/ocs-live.conf, append the above line.
Then cos-restore-mdisks will honor this setting.
Yes, we should have an option for ocs-restore-mdisks to force to that, so we will try to add that in the future.
Steven
Steven, thank you very much for your response. Your suggestion almost gets me there. When I add ocs_postmode_prompt="cmd" to /etc/ocs/ocs-live.conf, once the "mdisks" command ends, it essentially finishes at a command line version of the dialog menu asking the user which choice to make (poweroff, reboot, command line, start over, etc.) with "Enter command line prompt" as the default value. But it doesn't quite get to the command prompt. The attached screen shot is what I'm seeing. Now, all it takes is a quick stroke of the Enter key to exit to the command prompt (and thus, back to my script), which is certainly easy enough. But is there any way to give it that last little nudge to the command prompt?
Last edit: Brian Balzer 2020-02-26
Please give testing Clonezilla live 2.6.5-21 or 20200302-* a try. We have improved ocs-restore-mdisks with a new option "-a". You can follow the same step to use the TUI to run it, and the prompts in green will show you the whole picture. Remember to choose "-p cmd" so that you can get a command that will enter command line when ocs-restore-mdisks is finished.
Please let us know the results. Thanks.
Steven
Boom. That update worked PERFECTLY! As soon as the cloning process completed, it popped right back to my script. Thank you so much!
OK, great. Thanks for confirming that.
Enjoy!
Steven