From 7744c24a452942be23ed4ab693b3252e253720d6 Mon Sep 17 00:00:00 2001 From: Andreas Brodbeck Date: Fri, 1 Aug 2025 17:01:07 +0200 Subject: [PATCH 1/7] Rename config file to something more obvious --- README.md | 18 ++++++++++-------- ....conf => clonezilla-autobackup.conf.sample} | 3 ++- 2 files changed, 12 insertions(+), 9 deletions(-) rename target_pc/{backup-sample.conf => clonezilla-autobackup.conf.sample} (91%) diff --git a/README.md b/README.md index d6a8296..f69b32d 100644 --- a/README.md +++ b/README.md @@ -23,9 +23,9 @@ The only user intervention is to boot the target computer into Clonezilla bootab - Automatically start Custom backup option -- Inspect local partitions looking for `backup.conf` configuration file in the root folder +- Inspect local partitions looking for `clonezilla-autobackup.conf` configuration file in the root folder -- Compare hardware ID of the target hardware to the hardware ID in the `backup.conf` (correct backup configuration check) +- Compare hardware ID of the target hardware to the hardware ID in the `clonezilla-autobackup.conf` (correct backup configuration check) - Determine backup target partition (backup folder is created in the root folder on that partition) @@ -37,7 +37,7 @@ The only user intervention is to boot the target computer into Clonezilla bootab ### Outcome -The resulting backup is created in a folder (folder name is supplied in the `backup.conf` file) on the backup partition (partition is supplied in the `backup.conf` file). Backup parameters are also supplied in the `backup.conf` file. Those are passed to Clonezilla engine at runtime. +The resulting backup is created in a folder (folder name is supplied in the `clonezilla-autobackup.conf` file) on the backup partition (partition is supplied in the `backup.conf` file). Backup parameters are also supplied in the `backup.conf` file. Those are passed to Clonezilla engine at runtime. ## Bill of Materials @@ -123,11 +123,11 @@ The autobackup setup of Clonezilla is now complete. ### Prepare target computer -#### Backup configuration file -Backup configuration file tells automatic Clonezilla what kind of backup needs to be performed. +#### clonezilla-autobackup.configuration file +clonezilla-autobackup.configuration file tells automatic Clonezilla what kind of backup needs to be performed. It should be localed in the root folder on one of the drives of the target computer: - /backup.conf + /clonezilla-autobackup.conf A sample backup file is below: @@ -148,9 +148,10 @@ This ID could be looked up with this command: `sudo lshw -quiet -class system | configuration: boot=normal chassis=desktop family=Default string sku=Default string uuid=00020003-0004-0005-0006-000700080009 -The easiest way to build `backup.conf` file is to boot into interactive Clonezilla, drop into shell instead of starting the backup and look it up there. +The easiest way to build `clonezilla-autobackup.conf` file is to boot into interactive Clonezilla, drop into shell instead of starting the backup and look it up there. Clonezilla checks if correct configuration file has been found and ignores the ones with unmatched hardware IDs +Alternative command: `sudo cat /sys/class/dmi/id/product_uuid` ##### Line 2 - UUID of the partition to store back up file on @@ -161,6 +162,7 @@ Typically this is the partition UUID of the DATA partition of the 2TB backup dri Note that `7B0DFCE74B228860` is UUID of an exFAT partition (windows). Linux ext4 partition UUID will look like `38d9e8cd-deda-4735-ad97-a795665e77fe` You can look up partition UUIDs using `sudo blkid` command. +Alternative command: `lsblk -f` ##### Line 3 - Clonezilla command line arguments @@ -177,7 +179,7 @@ One by one: - `savedisk` is command to backup the entire drive (`saveparts` saves individual partitions). - `xps15dev_system` is the name of the target folder for the backup. -The esiest way to build this line is to run an interactive Clonezilla session, select all desired parameters and save the resulting command line. +The easiest way to build this line is to run an interactive Clonezilla session, select all desired parameters and save the resulting command line. There is also a command line reference here: [Man page of ocs-sr](https://clonezilla.org/fine-print-live-doc.php?path=./clonezilla-live/doc/98_ocs_related_command_manpages/01-ocs-sr.doc#google_vignette) ##### Line 4, 5, 6 and so on diff --git a/target_pc/backup-sample.conf b/target_pc/clonezilla-autobackup.conf.sample similarity index 91% rename from target_pc/backup-sample.conf rename to target_pc/clonezilla-autobackup.conf.sample index 55973db..343598b 100644 --- a/target_pc/backup-sample.conf +++ b/target_pc/clonezilla-autobackup.conf.sample @@ -1,5 +1,6 @@ # Backup configuration file -# DELETE ALL COMMENTS IN THE REAL FILE +# Comments start with a hash sign, like these lines here +# Empty lines are ignored # should be available in the root of /home/config (mounted from the kernel startup parameters). # Format # line 1: Machine_UUID From dcb70edecef40f7db77f494e8c51a500384268b5 Mon Sep 17 00:00:00 2001 From: Andreas Brodbeck Date: Fri, 1 Aug 2025 17:32:09 +0200 Subject: [PATCH 2/7] renamed config file and allow comments/blanklines --- clonezilla/live/custom-ocs | 195 +++++++++++++++++++------------------ 1 file changed, 100 insertions(+), 95 deletions(-) diff --git a/clonezilla/live/custom-ocs b/clonezilla/live/custom-ocs index a5fa12e..45910fc 100644 --- a/clonezilla/live/custom-ocs +++ b/clonezilla/live/custom-ocs @@ -1,10 +1,9 @@ #!/usr/bin/perl -# Find and read the backup configuration file my $TRUE = (1==1); my $FALSE = !$TRUE; -my $configFile = "/home/config/backup.conf"; +my $configFile = "/home/config/clonezilla-autobackup.conf"; my $backupFolder = "/home/partimag"; my $failed = $FALSE; my $failedMsg = ""; @@ -17,117 +16,123 @@ my $backupDisk; printf "Clonezilla backup by local backup configuration file\n"; printf "====================================================\n"; -printf "Inspecting hardware configration... "; +printf "Inspecting hardware configuration... "; @uuids = `sudo blkid`; my $hw = `sudo lshw -quiet -class system | grep configuration | grep uuid`; $hw =~ /uuid=([0-9|a-f]{8}-[0-9|a-f]{4}-[0-9|a-f]{4}-[0-9|a-f]{4}-[0-9|a-f]{12})/i; my $machine = $1; printf "done\nHardware uuid=$machine\n"; -system("sudo mkdir /home/config >> /dev/null 2>&1"); +system("sudo mkdir /home/config > /dev/null 2>&1"); +# Find and read the backup configuration file foreach $uuid (@uuids) { - $uuid =~ /^(\/dev\/.+):/i; - $disk = $1; - printf "Inspecting partition: $disk..."; - system("sudo umount /home/config >> /dev/null 2>&1"); - system("sudo umount $disk >> /dev/null 2>&1"); - if (system("sudo mount $disk /home/config >> /dev/null 2>&1") == 0) { - if (-e $configFile ) { - printf " found backup configration file\n"; - unless ( open(FILE, "<", $configFile) ) { - printf "Error opening backup configration file: $!\n"; - } else { - @config = ; - close FILE; - - chomp $config[0]; - $backupDisk = $config[0]; - if ($backupDisk =~ /^$machine/i || $uuid =~ /$backupDisk/i) { - printf "Backup uuid matches this hardware or disk: $backupDisk\n"; - system("sudo umount /home/config >> /dev/null 2>&1"); - $found = $TRUE; - last; - } - else { - printf "Backup uuid=$backupDisk\nDoes not match that of this hardware..."; - } - } + $uuid =~ /^(\/dev\/.+):/i; + $disk = $1; + printf "Inspecting partition: $disk..."; + system("sudo umount /home/config > /dev/null 2>&1"); + system("sudo umount $disk > /dev/null 2>&1"); + if (system("sudo mount $disk /home/config > /dev/null 2>&1") == 0) { + if (-e $configFile ) { + printf " found backup configuration file\n"; + unless ( open(FILE, "<", $configFile) ) { + printf "Error opening backup configration file: $!\n"; + } else { + @config = ; + close FILE; + + # Remove all comments starting with # + @config = grep { !/^#/ } @config; + + # Remove all blank lines + @config = grep { /\S/ } @config; + + # Remove all trailing newlines + chomp @config; + + $backupDisk = $config[0]; + if ($backupDisk =~ /^$machine/i || $uuid =~ /$backupDisk/i) { + printf "Backup uuid matches this hardware or disk: $backupDisk\n"; + system("sudo umount /home/config > /dev/null 2>&1"); + $found = $TRUE; + last; + } + else { + printf "Backup uuid=$backupDisk\nDoes not match that of this hardware..."; } + } } - print " skipped.\n"; + } + print " skipped.\n"; } if ($found) { - if (-d $backupFolder) { - $tmp = `mount | grep $backupFolder`; - if ($tmp =~ $backupFolder) { - system("sudo umount $backupFolder >> /dev/null 2>&1"); - } - } else { - system("sudo mkdir $backupFolder >> /dev/null 2>&1"); + if (-d $backupFolder) { + $tmp = `mount | grep $backupFolder`; + if ($tmp =~ $backupFolder) { + system("sudo umount $backupFolder > /dev/null 2>&1"); } - chomp $config[1]; - if (system("sudo mount -U $config[1] $backupFolder") == 0) { - printf "Mounted $backupFolder: "; - printf `sudo mount | grep $backupFolder`; - chomp $config[2]; - my $params = $config[2]; - if ($params =~ "savedisk") { - $saveDisk = $TRUE; - } elsif ($params =~ "saveparts") { - $saveDisk = $FALSE; - } else { - $failed = $TRUE; - $failedMsg = "Unable to determine type of backup: disk or partition"; - } + } else { + system("sudo mkdir $backupFolder > /dev/null 2>&1"); + } + if (system("sudo mount -U $config[1] $backupFolder") == 0) { + printf "Mounted $backupFolder: "; + printf `sudo mount | grep $backupFolder`; + my $params = $config[2]; + if ($params =~ "savedisk") { + $saveDisk = $TRUE; + } elsif ($params =~ "saveparts") { + $saveDisk = $FALSE; } else { - $failed = $TRUE; - $failedMsg = "Unable to mount $backupFolder"; + $failed = $TRUE; + $failedMsg = "Unable to determine type of backup: disk or partition"; + } + } else { + $failed = $TRUE; + $failedMsg = "Unable to mount $backupFolder"; + } + unless ($failed) { + for ($i = 3; $i <= $#config; $i++) { + $uuid = $config[$i]; + #printf "looking at partition=$uuid\n"; + $disk = ""; + $tmp = `ls -l /dev/disk/by-uuid/ | grep -i $uuid`; + #printf "by uuid returned $tmp\n"; + $tmp =~ /\.\.\/\.\.\/(.+)/i; + $disk = $1; + if ($saveDisk && length $disk) { + $lspath = `ls -l /dev/disk/by-path/ | grep -i $disk`; + $lspath =~ /.*:\d\d (.+)-part.*/; + $pth = $1; + $disk = ""; + #printf "by path = $pth\n"; + if (length $pth) { + $lspath = `ls -l /dev/disk/by-path/ | grep -i $pth`; + $lspath =~ /.* -> \.\.\/\.\.\/(.+)/; + $disk = $1; + } + } + #printf "source disk=$disk\n"; + if (length $disk) { + printf "uuid $uuid points to $disk\n"; + $target .= ' ' . $disk; + } } - unless ($failed) { - for ($i = 3; $i <= $#config; $i++) { - chomp $config[$i]; - $uuid = $config[$i]; -#printf "looking at partition=$uuid\n"; - $disk = ""; - $tmp = `ls -l /dev/disk/by-uuid/ | grep -i $uuid`; -#printf "by uuid returned $tmp\n"; - $tmp =~ /\.\.\/\.\.\/(.+)/i; - $disk = $1; - if ($saveDisk && length $disk) { - $lspath = `ls -l /dev/disk/by-path/ | grep -i $disk`; - $lspath =~ /.*:\d\d (.+)-part.*/; - $pth = $1; - $disk = ""; -#printf "by path = $pth\n"; - if (length $pth) { - $lspath = `ls -l /dev/disk/by-path/ | grep -i $pth`; - $lspath =~ /.* -> \.\.\/\.\.\/(.+)/; - $disk = $1; - } - } -#printf "source disk=$disk\n"; - if (length $disk) { - printf "uuid $uuid points to $disk\n"; - $target .= ' ' . $disk; - } - } - if (length $target) { - $cmd = "ocs-sr " . $config[2] . $target; - printf "Running Clonezilla with '$cmd'\n"; - exec($cmd); - } - $failed = $TRUE; - $failedMsg = "Unable to determine backup target partition(s)"; + if (length $target) { + $cmd = "ocs-sr " . $config[2] . $target; + printf "Running Clonezilla with '$cmd'\n"; + exec($cmd); # Does not return from this call to clonezilla } -} else { $failed = $TRUE; - $failedMsg = "Backup configration file was not found"; + $failedMsg = "Unable to determine backup target partition(s)"; + } +} else { + $failed = $TRUE; + $failedMsg = "Backup configration file was not found"; } if ($failed) { - printf "%s\n", $failedMsg; - printf "\nLaunching Interactive Clonezilla in 10 seconds...\n"; - system("sleep 10"); - exec("ocs-live-general"); + printf "%s\n", $failedMsg; + printf "\nLaunching Interactive Clonezilla in 10 seconds...\n"; + system("sleep 10"); + exec("ocs-live-general"); } From 8da95cd9025b98b6b2ec38eae642653dd11ffe7d Mon Sep 17 00:00:00 2001 From: Andreas Brodbeck Date: Fri, 1 Aug 2025 17:52:30 +0200 Subject: [PATCH 3/7] README fix --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f69b32d..4fe4aaa 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ The only user intervention is to boot the target computer into Clonezilla bootab ### Outcome -The resulting backup is created in a folder (folder name is supplied in the `clonezilla-autobackup.conf` file) on the backup partition (partition is supplied in the `backup.conf` file). Backup parameters are also supplied in the `backup.conf` file. Those are passed to Clonezilla engine at runtime. +The resulting backup is created in a folder (folder name is supplied in the `clonezilla-autobackup.conf` file) on the backup partition (partition is supplied in the `clonezilla-autobackup.conf` file). Backup parameters are also supplied in the `clonezilla-autobackup.conf` file. Those are passed to Clonezilla engine at runtime. ## Bill of Materials @@ -123,19 +123,22 @@ The autobackup setup of Clonezilla is now complete. ### Prepare target computer -#### clonezilla-autobackup.configuration file -clonezilla-autobackup.configuration file tells automatic Clonezilla what kind of backup needs to be performed. +#### clonezilla-autobackup.conf configuration file +clonezilla-autobackup.conf configuration file tells automatic Clonezilla what kind of backup needs to be performed. It should be localed in the root folder on one of the drives of the target computer: /clonezilla-autobackup.conf A sample backup file is below: - + + ``` + # This is a comment, and is ignored 4c4c4544-0054-3610-804a-c7c04f444b33 7B0DFCE74B228860 -q2 -j2 -nogui -z1p -i 2000000 -p poweroff savedisk xps15dev_system D2DE19FADE19D815 - + ``` + Let's review it line by line ##### Line 1 - hardware ID of the target machine: @@ -143,6 +146,7 @@ Let's review it line by line 00020003-0004-0005-0006-000700080009 This ID could be looked up with this command: `sudo lshw -quiet -class system | grep configuration | grep uuid` +(Alternative command: `sudo cat /sys/class/dmi/id/product_uuid`) $ sudo lshw -quiet -class system | grep configuration | grep uuid configuration: boot=normal chassis=desktop family=Default string sku=Default string uuid=00020003-0004-0005-0006-000700080009 @@ -151,7 +155,6 @@ This ID could be looked up with this command: `sudo lshw -quiet -class system | The easiest way to build `clonezilla-autobackup.conf` file is to boot into interactive Clonezilla, drop into shell instead of starting the backup and look it up there. Clonezilla checks if correct configuration file has been found and ignores the ones with unmatched hardware IDs -Alternative command: `sudo cat /sys/class/dmi/id/product_uuid` ##### Line 2 - UUID of the partition to store back up file on @@ -160,9 +163,7 @@ Alternative command: `sudo cat /sys/class/dmi/id/product_uuid` If the target computer has mulitple disk drives, you can specify on of the partitions on the drives that are not part of the backup. Typically this is the partition UUID of the DATA partition of the 2TB backup drive we are building. Note that `7B0DFCE74B228860` is UUID of an exFAT partition (windows). Linux ext4 partition UUID will look like `38d9e8cd-deda-4735-ad97-a795665e77fe` -You can look up partition UUIDs using `sudo blkid` command. - -Alternative command: `lsblk -f` +You can look up partition UUIDs using `sudo blkid` command (Alternative command: `lsblk -f`). ##### Line 3 - Clonezilla command line arguments From da90bcd5da35baed1872e3d04131878ae590a5a7 Mon Sep 17 00:00:00 2001 From: Andreas Brodbeck Date: Fri, 1 Aug 2025 17:55:04 +0200 Subject: [PATCH 4/7] README --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4fe4aaa..7d5bb43 100644 --- a/README.md +++ b/README.md @@ -131,13 +131,13 @@ It should be localed in the root folder on one of the drives of the target compu A sample backup file is below: - ``` - # This is a comment, and is ignored - 4c4c4544-0054-3610-804a-c7c04f444b33 - 7B0DFCE74B228860 - -q2 -j2 -nogui -z1p -i 2000000 -p poweroff savedisk xps15dev_system - D2DE19FADE19D815 - ``` +``` +# This is a comment, and is ignored +4c4c4544-0054-3610-804a-c7c04f444b33 +7B0DFCE74B228860 +-q2 -j2 -nogui -z1p -i 2000000 -p poweroff savedisk xps15dev_system +D2DE19FADE19D815 +``` Let's review it line by line From fbe9c066359e81346e3a5916d3c92f32fbec9dcf Mon Sep 17 00:00:00 2001 From: Andreas Brodbeck Date: Fri, 2 Jan 2026 16:23:53 +0100 Subject: [PATCH 5/7] message typos --- clonezilla/live/custom-ocs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clonezilla/live/custom-ocs b/clonezilla/live/custom-ocs index 45910fc..533bf79 100644 --- a/clonezilla/live/custom-ocs +++ b/clonezilla/live/custom-ocs @@ -35,7 +35,7 @@ foreach $uuid (@uuids) { if (-e $configFile ) { printf " found backup configuration file\n"; unless ( open(FILE, "<", $configFile) ) { - printf "Error opening backup configration file: $!\n"; + printf "Error opening backup configuration file: $!\n"; } else { @config = ; close FILE; @@ -57,7 +57,7 @@ foreach $uuid (@uuids) { last; } else { - printf "Backup uuid=$backupDisk\nDoes not match that of this hardware..."; + printf "Backup uuid=$backupDisk\ndoes not match that of this hardware..."; } } } @@ -127,12 +127,12 @@ if ($found) { } } else { $failed = $TRUE; - $failedMsg = "Backup configration file was not found"; + $failedMsg = "Backup configuration file was not found"; } if ($failed) { printf "%s\n", $failedMsg; - printf "\nLaunching Interactive Clonezilla in 10 seconds...\n"; + printf "\nLaunching interactive Clonezilla in 10 seconds...\n"; system("sleep 10"); exec("ocs-live-general"); } From 38ee35f658010a962f8375a0e4614f7314e529c9 Mon Sep 17 00:00:00 2001 From: Andreas Brodbeck Date: Fri, 2 Jan 2026 18:37:13 +0100 Subject: [PATCH 6/7] retab and better grub essential info --- README.md | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 7d5bb43..a986f61 100644 --- a/README.md +++ b/README.md @@ -95,28 +95,31 @@ Relevant fdisk output for this disk is: 1. Set timeout to 5 seconds (default is 30): - set timeout = "5" + set timeout = "5" 2. Location this line (usually the first Clonezilla menu item): - menuentry --hotkey=r "Clonezilla live (VGA 800x600 & To RAM)" --id live-toram { + menuentry --hotkey=r "Clonezilla live (VGA 800x600 & To RAM)" --id live-toram { 3. Copy the entire `menuentry` block ahead of the first menublock - the default menu item is 0 (first on the list) - menuentry --hotkey=r "Clonezilla live (VGA 800x600 & To RAM)" --id live-toram { - search --set -f /live/vmlinuz - $linux_cmd /live/vmlinuz boot=live union=overlay username=user hostname=noble config quiet loglevel=0 noswap edd=on nomodeset enforcing=0 noeject locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=788 toram=live,syslinux,EFI,boot,.disk,utils net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 - $initrd_cmd /live/initrd.img - } + menuentry --hotkey=r "Clonezilla live (VGA 800x600 & To RAM)" --id live-toram { + search --set -f /live/vmlinuz + $linux_cmd /live/vmlinuz boot=live union=overlay username=user hostname=noble config quiet loglevel=0 noswap edd=on nomodeset enforcing=0 noeject locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=788 toram=live,syslinux,EFI,boot,.disk,utils net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 + $initrd_cmd /live/initrd.img + } 4. In the new block, modify the menuitem description and the boot command according to the following: - menuentry --hotkey=r "Clonezilla Autobackup (VGA 800x600 & To RAM)" --id live-autobackup { - search --set -f /live/vmlinuz - $linux_cmd /live/vmlinuz boot=live union=overlay username=user hostname=noble config quiet loglevel=0 noswap edd=on nomodeset enforcing=0 noeject locales=locales=en_EN.UTF-8 keyboard-layouts=NONE ocs_live_run="/lib/live/mount/medium/live/custom-ocs" ocs_live_extra_param="" ocs_live_batch="no" vga=788 toram=live,syslinux,EFI,boot,.disk,utils net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 - $initrd_cmd /live/initrd.img - } + menuentry --hotkey=r "Clonezilla Autobackup (VGA 800x600 & To RAM)" --id live-autobackup { + search --set -f /live/vmlinuz + $linux_cmd /live/vmlinuz boot=live union=overlay username=user hostname=noble config quiet loglevel=0 noswap edd=on nomodeset enforcing=0 noeject locales=locales=en_EN.UTF-8 keyboard-layouts=NONE ocs_live_run="/run/live/medium/live/custom-ocs" ocs_live_extra_param="" ocs_live_batch="no" vga=788 toram=live,syslinux,EFI,boot,.disk,utils net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 + $initrd_cmd /live/initrd.img + } + ... which is essentially this overwritten partial: + locales=locales=en_EN.UTF-8 keyboard-layouts=NONE ocs_live_run="/run/live/medium/live/custom-ocs" + 5. Save `grub.cfg` file The autobackup setup of Clonezilla is now complete. @@ -127,7 +130,7 @@ The autobackup setup of Clonezilla is now complete. clonezilla-autobackup.conf configuration file tells automatic Clonezilla what kind of backup needs to be performed. It should be localed in the root folder on one of the drives of the target computer: - /clonezilla-autobackup.conf + /clonezilla-autobackup.conf A sample backup file is below: @@ -143,13 +146,13 @@ Let's review it line by line ##### Line 1 - hardware ID of the target machine: - 00020003-0004-0005-0006-000700080009 + 00020003-0004-0005-0006-000700080009 This ID could be looked up with this command: `sudo lshw -quiet -class system | grep configuration | grep uuid` (Alternative command: `sudo cat /sys/class/dmi/id/product_uuid`) - $ sudo lshw -quiet -class system | grep configuration | grep uuid - configuration: boot=normal chassis=desktop family=Default string sku=Default string uuid=00020003-0004-0005-0006-000700080009 + $ sudo lshw -quiet -class system | grep configuration | grep uuid + configuration: boot=normal chassis=desktop family=Default string sku=Default string uuid=00020003-0004-0005-0006-000700080009 The easiest way to build `clonezilla-autobackup.conf` file is to boot into interactive Clonezilla, drop into shell instead of starting the backup and look it up there. @@ -158,7 +161,7 @@ Clonezilla checks if correct configuration file has been found and ignores the o ##### Line 2 - UUID of the partition to store back up file on - 7B0DFCE74B228860 + 7B0DFCE74B228860 If the target computer has mulitple disk drives, you can specify on of the partitions on the drives that are not part of the backup. Typically this is the partition UUID of the DATA partition of the 2TB backup drive we are building. @@ -167,7 +170,7 @@ You can look up partition UUIDs using `sudo blkid` command (Alternative command: ##### Line 3 - Clonezilla command line arguments - -q2 -j2 -nogui -z1p -i 2000000 -p poweroff savedisk xps15dev_system + -q2 -j2 -nogui -z1p -i 2000000 -p poweroff savedisk xps15dev_system One by one: @@ -185,7 +188,7 @@ There is also a command line reference here: [Man page of ocs-sr](https://clone ##### Line 4, 5, 6 and so on - D2DE19FADE19D815 + D2DE19FADE19D815 Lines 4 onward list UUID of partitions being backed up. If you are using `savedisk` command - any partion on a disk will make Clonezilla backup the entire disk. From ec47618f4ade9b20752ea5c436e7a50f7a80803f Mon Sep 17 00:00:00 2001 From: Andreas Brodbeck Date: Tue, 16 Jun 2026 09:52:05 +0200 Subject: [PATCH 7/7] better documentation --- README.md | 15 ++++++++++----- target_pc/clonezilla-autobackup.conf.sample | 14 ++++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a986f61..454c047 100644 --- a/README.md +++ b/README.md @@ -97,28 +97,33 @@ Relevant fdisk output for this disk is: set timeout = "5" - 2. Location this line (usually the first Clonezilla menu item): + 2. Locate this line (usually the first Clonezilla menu item): menuentry --hotkey=r "Clonezilla live (VGA 800x600 & To RAM)" --id live-toram { 3. Copy the entire `menuentry` block ahead of the first menublock - the default menu item is 0 (first on the list) +`` menuentry --hotkey=r "Clonezilla live (VGA 800x600 & To RAM)" --id live-toram { search --set -f /live/vmlinuz $linux_cmd /live/vmlinuz boot=live union=overlay username=user hostname=noble config quiet loglevel=0 noswap edd=on nomodeset enforcing=0 noeject locales= keyboard-layouts= ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_batch="no" vga=788 toram=live,syslinux,EFI,boot,.disk,utils net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 $initrd_cmd /live/initrd.img } +`` + 4. In the new block, modify the menuitem description and the boot command according to the following: +`` menuentry --hotkey=r "Clonezilla Autobackup (VGA 800x600 & To RAM)" --id live-autobackup { search --set -f /live/vmlinuz - $linux_cmd /live/vmlinuz boot=live union=overlay username=user hostname=noble config quiet loglevel=0 noswap edd=on nomodeset enforcing=0 noeject locales=locales=en_EN.UTF-8 keyboard-layouts=NONE ocs_live_run="/run/live/medium/live/custom-ocs" ocs_live_extra_param="" ocs_live_batch="no" vga=788 toram=live,syslinux,EFI,boot,.disk,utils net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 + $linux_cmd /live/vmlinuz boot=live union=overlay username=user hostname=noble config quiet loglevel=0 noswap edd=on nomodeset enforcing=0 noeject locales=en_EN.UTF-8 keyboard-layouts=NONE ocs_live_run="/run/live/medium/live/custom-ocs" ocs_live_extra_param="" ocs_live_batch="no" vga=788 toram=live,syslinux,EFI,boot,.disk,utils net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 $initrd_cmd /live/initrd.img } - - ... which is essentially this overwritten partial: - locales=locales=en_EN.UTF-8 keyboard-layouts=NONE ocs_live_run="/run/live/medium/live/custom-ocs" +`` + ... which is essentially this overwritten partials: + `--id live-autobackup` + `locales=en_EN.UTF-8 keyboard-layouts=NONE ocs_live_run="/run/live/medium/live/custom-ocs"` 5. Save `grub.cfg` file diff --git a/target_pc/clonezilla-autobackup.conf.sample b/target_pc/clonezilla-autobackup.conf.sample index 343598b..4aa8382 100644 --- a/target_pc/clonezilla-autobackup.conf.sample +++ b/target_pc/clonezilla-autobackup.conf.sample @@ -11,13 +11,19 @@ # line N: target_uuidN # # Where -# Machine_UUID is the uuid obtained via 'lshw -quiet | grep configuration | grep uuid -# home_partimag_partition_uuid is UUID of the partition which is going to be mounted to /home/partimag for backup -# target_uuidN is uuid of the partition to be backed up (in case of saveparts), or disk to be backed up (in case of savedisk) +# Machine_UUID is the uuid obtained via 'lshw -quiet | grep configuration | grep uuid +# home_partimag_partition_uuid is UUID of the partition which is going to be mounted to /home/partimag for backup +# target_uuidN is uuid of the partition to be backed up (in case of saveparts), or disk to be backed up (in case of savedisk) -# Server +# Server PC 00000000-0000-0000-0000-001FD081B7C9 + +# Target disk UUID 38d9e8cd-deda-4735-ad97-a795665e77fe + +# clonezilla options -q2 -j2 -nogui -z1p -i 2000000 -p poweroff saveparts main_system_partition + +# Source disk/partition UUID 406f5967-271b-4b89-8f37-cdf1ec21a69a