Menu

Return to command line after ocs-restore-mdisks

2020-02-19
2020-03-11
  • Brian Balzer

    Brian Balzer - 2020-02-19

    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
  • Steven Shiau

    Steven Shiau - 2020-02-26

    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

     
  • Brian Balzer

    Brian Balzer - 2020-02-26

    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
  • Steven Shiau

    Steven Shiau - 2020-03-03

    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

     
    • Brian Balzer

      Brian Balzer - 2020-03-09

      Boom. That update worked PERFECTLY! As soon as the cloning process completed, it popped right back to my script. Thank you so much!

       
  • Steven Shiau

    Steven Shiau - 2020-03-11

    OK, great. Thanks for confirming that.
    Enjoy!

    Steven

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.