Menu

Overwrite previous image?

orzcode
2025-08-07
2 days ago
  • orzcode

    orzcode - 2025-08-07

    Clonezilla rocks. Thanks Steven for keeping it updated!

    Just wondering... is there a way to overwrite a previous image? I want to do a monthly image of my system. But currently it seems I have to first manually delete the old image and then create a new one. Whereas it'd be simpler if I could just 'overwrite' the previous image, or if clonezilla itself could ask me if I wish to remove the old image before proceeding.

    Ideally the end result would be a script/single-click kind of function that retains all my settings and overwrites the old image each time.

     
  • Steven Shiau

    Steven Shiau - 2025-08-07

    There is no need to remove the existing image dir. If you use the command line to save it, for example,
    /usr/sbin/ocs-sr -q2 -c -j2 -z9p -i 0 -sfsck -scs -senc -plu -p choose savedisk "2025-08-07-23-img" nvme0n1

    If the image dir "2025-08-07-23-img" exists, it will be removed first and the new "2025-08-07-23-img" will be created, though the name is the same.
    It's only when you use TUI of Clonezilla, it will ask you to confirm if you want to remove it.
    I suggest you have a rotation mechanism. E.g., keep at least previous image by renaming it, i.e., have a script like:

    #!/bin/bash
    mv myimage myimage.1
    /usr/sbin/ocs-sr -q2 -c -j2 -z9p -i 0 -sfsck -scs -senc -plu -p choose savedisk "myimage" nvme0n1
    

    Just like those log files mechanism does.

     
  • Steven Shiau

    Steven Shiau - 2025-08-07

    Oh, forgot to mention, if you want to make it automatically without any confirmation, just replace the option "-c" with "--batch", i.e.,
    /usr/sbin/ocs-sr -q2 --batch -j2 -z9p -i 0 -sfsck -scs -senc -plu -p choose savedisk "myimage" nvme0n1

     
  • orzcode

    orzcode - 2 days ago

    Thanks very much.

    I am sadly not as uhh... 'natively experienced' in the bash/linux environment as I am with windows, so for a neanderthal like me, my brain prefers it simple - I load into Clonezilla from my Ventoy usb, and simply press buttons on the prompts like a caveman instead of having a script/command line execution.

    So for now, since it's only around once a month, I'll just keep doing what I've been doing (deleting in windows before rebooting, then rebooting into CZ, then making the image again.

    Thanks again!

     
    👍
    1

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.