Menu

how ocs_prerun works

Help
Sainthol
2024-09-24
2024-10-10
  • Sainthol

    Sainthol - 2024-09-24

    Hello,
    I would like to run nwipe on the client workstations before restoring the image. I did not understand in which file I should add the command ocs_prerun=""nwipe --autonuke --nogui /dev/nvme0n1". I added it in the file /syslinux/syslinux.cfg, but nwipe does not launch. Thanks in advance. Best regards.

     
  • Sainthol

    Sainthol - 2024-09-27

    Hello,

    With Clonezilla Live Lite Server, after configuring the restore and before starting the client workstations in PXE, I open another terminal on Clonezilla and I modified the file /tftpboot/nbi_img/grub/grub.cfg. I add in the command line of my restore ocs-prerun="nwipe ...". As I try to automate the process, I would like to be able to make a script that after configuring Clonezilla (it already works) would modify the grub.cfg file.

    Thanks in advance.
    Best regards.

     
  • Steven Shiau

    Steven Shiau - 2024-09-27

    So you want to run nwipe in your PXE client before the image is restored?

    Steven

     
  • Sainthol

    Sainthol - 2024-09-27

    Yes, that's right.
    Thank you

     
  • Steven Shiau

    Steven Shiau - 2024-09-28

    OK, you can hack the file "/usr/sbin/ocs-live-feed-img" in the Clonezilla lite server.
    Right after you boot Clonezilla live lite server, enter command line prompt.
    Edit the file "/usr/sbin/ocs-live-feed-img", in the line around 1610 in the function "task_start_feed_img_for_cast", add these two lines like:

    add_opt_in_pxelinux_cfg_block -n Clonezilla-live ocs_prerun "\"nwipe --autonuke --nogui /dev/nvme0n1\""
    add_opt_in_grub_efi_cfg_block -n "clonezilla-live-client" ocs_prerun "\"nwipe --autonuke --nogui /dev/nvme0n1\""
    

    Then back to Clonezilla menu by running "exit" in the console 1.
    The generated /tftpboot/nbi_img/grub/grub.cfg and /tftpboot/nbi_img/pxelinux.cfg/default now should contain what you want.
    Thanks for asking this. Maybe we can add a customized option in "ocs-live-feed-img" so that it's easier to add that. We will think about it.

    Steven

     

    Last edit: Steven Shiau 2024-09-28
  • Sainthol

    Sainthol - 2024-09-30

    Hello Steven,

    Your solution works very well. Thank you for your help. Kind regards.

     
    👍
    1
  • Sainthol

    Sainthol - 2024-10-07

    Hello,

    I tried with other versions of Clonezilla as well as past versions but I still have the same problem. On the other hand, I have no problem restoring with the DBRL / Clonezilla server (it's surprising that I suppose there must not be much difference with the Clonezilla Live for restoring...). Moreover, when I want to use the -edio option (in expert mode), I have an error message: "ocs-live-general" fisnished with error!

    Thanks in advance.

     
  • Sainthol

    Sainthol - 2024-10-07

    I would like to point out that the -edio option returns an error with Clonezilla Live / Lite Server

     
  • Sainthol

    Sainthol - 2024-10-07

    one last info to report that with the edio option, the restoration works with the Clonezilla Live USB key. Now it should work with the Clonezilla Live USB key in Lite Server (maybe in this mode the edio option is not accepted...)
    Thanks

     
  • Sainthol

    Sainthol - 2024-10-10

    Hello,

    Can someone confirm if the edio option is accepted when restoring with the clonezilla USB key to Lite Server?

    Thanks in advance.

     
  • Steven Shiau

    Steven Shiau - 2024-10-10

    Thanks for your feedback. This is a bug, and was fixed in the testing Clonezilla live, i.e., >= 3.2.0-5 and 20241010-*:
    https://clonezilla.org//downloads.php
    Please give it a try and let us know the results.

    Steven

     
  • Sainthol

    Sainthol - 2024-10-10

    Hello Stephen,

    Many thanks for the 3.2.0-5 release. The edio option works and I finally managed to restore my image with the Clonezilla Lite Server USB stick. Thanks again for the work you do.

    Best regards.

     
    👍
    1
  • Steven Shiau

    Steven Shiau - 2024-10-10

    Great. Thanks for confirming that.
    Enjoy Clonezilla!

    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.