I'm struggling with creating a grub2 menu item. I want to create a rescue disk for our servers which runs a particular bit of software with some custom settings, the idea being once it's built we capture it onto the MicroSD card on the motherboard and then can have a Deploy image (or restore system) menu item.
Here is what I have so far, but I was hoping someone might have something prepepared which does this:
This kind of works, but it create the image on the incorrect device. The machine has the following:
sda - system drive
sdb - drive for record train
sdc - 64GB SD card running Clonezilla and Grub on the onboard sd reader on the motherboard
as it stands, it looks like it will clone SDA to SDB and I can't find a way to tell it to only clone to SDC
Thanks for the help so far,
Last edit: Christopher Frankland-Wright 2024-03-19
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That's true. Actually sda, sdb, sdc are random...
You might be able to use PTUUID or SERIALNO (short format), e.g., PTUUID=03c8b280-47aa-4881-aca5-9b9c66fe28c7 to assign that. Please use "sudo ocs-sr --help" to show the help messages, or you can refer to https://clonezilla.org/advanced/reserved-word-ocs-sr.php
Steven
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wonder if I search for a known file on each device, so for the system disk we look for the hidden folder $SysReset and the SD card we find the Clonezilla-Live-Version file at it's root. Then using that we grab the PTUUID.
I'm still struggling with finding the part that defines the source and target for the clone.
I can see that we define the source at the end of the ocs-sr string, but no where does it define where to write the image file to. Currently it tries to write to the wrong place that isn't running the Clonezilla.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think the issue I've encountered is that running this it can't write to the SD card because it is mounted. I've been playing with trying to run the clonezilla to toram but it's not successfully parsing the line through, it just loads clonezilla in the RAM
Since you have put "toram=live,syslinux,EFI,boot,.disk,utils", what did you mean by "it just loads clonezilla in the RAM"? That's the correct behavior as the toram's mechanism I believe.
If you want to mount your SD card, in addition to the toram, you need to put something like the following in the boot parameters:
ocs_prerun="mount /dev/mmcblk0p1 /home/partimag"
or
ocs_repository="dev:///dev/mmcblk0p1"
Ref: https://drbl.org/fine-print.php?path=./faq/2_System/120_image_repository_on_same_usb_stick.faq#120_image_repository_on_same_usb_stick.faq
Hi there,
I'm struggling with creating a grub2 menu item. I want to create a rescue disk for our servers which runs a particular bit of software with some custom settings, the idea being once it's built we capture it onto the MicroSD card on the motherboard and then can have a Deploy image (or restore system) menu item.
Here is what I have so far, but I was hoping someone might have something prepepared which does this:
This currently errors and I'm not sure why it does it.
So what were the error messages? Please take some photos then post them.
BTW, you'd better to use "ocs_live_run" for your ocs-sr command.
You can refer to these docs:
https://clonezilla.org//fine-print-live-doc.php?path=clonezilla-live/doc/05_Preseed_options_to_do_job_after_booting
https://clonezilla.org//fine-print-live-doc.php?path=./clonezilla-live/doc/99_Misc/00_live-boot-parameters.doc#00_live-boot-parameters.doc
Steven
Here is the error message I am getting, I'm getting all rather lost in this.
These are the lines that clonezilla give me to use for future capture/restore, is there a way to create a gub entry using it?
/usr/sbin/ocs-sr -q2 -c-j2 -zp9 -i 4096 -sfsck -senc -p reboot savedisk mRes-Recover sda
/usr/sbin/ocs-sr -g auto -e1 auto -e2 -r -j2 -c -k0 -p reboot restoredisk mRes-Recover sda
This is the current grub entry I am using for capture:
menuentry "Clone from sda to Clonezilla device" {
search --set -f /live/vmlinuz
linux ($root)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 ocs_live_run="/usr/sbin/ocs-sr -q2 -c -j2 -zp9 -i 4096 -sfsck -senc -p reboot savedisk mRes-Recover sda" keyboard-layouts=NONE locales=en_US.UTF-8 vga=788 ip= nosplash net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
$initrd_cmd /live/initrd.img
}
This kind of works, but it create the image on the incorrect device. The machine has the following:
sda - system drive
sdb - drive for record train
sdc - 64GB SD card running Clonezilla and Grub on the onboard sd reader on the motherboard
as it stands, it looks like it will clone SDA to SDB and I can't find a way to tell it to only clone to SDC
Thanks for the help so far,
Last edit: Christopher Frankland-Wright 2024-03-19
That's true. Actually sda, sdb, sdc are random...
You might be able to use PTUUID or SERIALNO (short format), e.g., PTUUID=03c8b280-47aa-4881-aca5-9b9c66fe28c7 to assign that. Please use "sudo ocs-sr --help" to show the help messages, or you can refer to
https://clonezilla.org/advanced/reserved-word-ocs-sr.php
Steven
I wonder if I search for a known file on each device, so for the system disk we look for the hidden folder $SysReset and the SD card we find the Clonezilla-Live-Version file at it's root. Then using that we grab the PTUUID.
I'm still struggling with finding the part that defines the source and target for the clone.
menuentry "Clone from sda to Clonezilla device" {
search --set -f /live/vmlinuz
linux ($root)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 ocs_live_run="/usr/sbin/ocs-sr -q2 -c -j2 -zp9 -i 4096 -sfsck -senc -p reboot savedisk mRes-Recover sda" keyboard-layouts=NONE locales=en_US.UTF-8 vga=788 ip= nosplash net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
$initrd_cmd /live/initrd.img
}
I can see that we define the source at the end of the ocs-sr string, but no where does it define where to write the image file to. Currently it tries to write to the wrong place that isn't running the Clonezilla.
I think the issue I've encountered is that running this it can't write to the SD card because it is mounted. I've been playing with trying to run the clonezilla to toram but it's not successfully parsing the line through, it just loads clonezilla in the RAM
Current entry is:
menuentry "MRES Create Recovery" --id live-toram {
search --set -f /live/vmlinuz
linux ($root)/live/vmlinuz boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 ocs_live_run="/usr/sbin/ocs-sr -q2 -c -j2 -zp9 -i 4096 -sfsck -senc -p reboot savedisk mRes-Recover sda ocs_repository=\"dev:///LABEL=MRESRECOVER\"" keyboard-layouts=NONE locales=en_US.UTF-8 vga=788 toram=live,syslinux,EFI,boot,.disk,utils ip= nosplash net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1
$initrd_cmd /live/initrd.img
}
@steven_shiau - can you see what might be wrong here please?
Last edit: Christopher Frankland-Wright 2024-03-21
Since you have put "toram=live,syslinux,EFI,boot,.disk,utils", what did you mean by "it just loads clonezilla in the RAM"? That's the correct behavior as the toram's mechanism I believe.
If you want to mount your SD card, in addition to the toram, you need to put something like the following in the boot parameters:
ocs_prerun="mount /dev/mmcblk0p1 /home/partimag"
or
ocs_repository="dev:///dev/mmcblk0p1"
Ref:
https://drbl.org/fine-print.php?path=./faq/2_System/120_image_repository_on_same_usb_stick.faq#120_image_repository_on_same_usb_stick.faq
https://clonezilla.org//fine-print-live-doc.php?path=./clonezilla-live/doc/99_Misc/00_live-boot-parameters.doc#00_live-boot-parameters.doc
Steven