clonezilla icon indicating copy to clipboard operation
clonezilla copied to clipboard

Unable to find target partition sda1 clonezilla

Open prisonerr627 opened this issue 8 months ago • 4 comments

I know this is a common problem in my research -icds (ignore original disk size)

-k1 (resize partition table proportionally)

Should solve the problem but for my case it isnt. When i check the image with ocs-chkimg it verifies the image successfully.

Image

prisonerr627 avatar May 06 '25 09:05 prisonerr627

`Starting /usr/sbin/ocs-sr at 2025-05-07 13:10:09 UTC... *****************************************************. Clonezilla image dir: /home/partimag Shutting down the Logical Volume Manager Finished Shutting down the Logical Volume Manager PS. Next time you can run this command directly: /usr/sbin/ocs-sr -g auto -e1 auto -e2 -c -r -icds -j2 -k1 -scr -plu -p true restoredisk backup sdb *****************************************************. Running: task_restoreparts "backup-tmp-cnvted" "sdb1 sdb2" "" *****************************************************. The following step is to restore an image to the hard disk/partition(s) on this machine: "/tmp/backup-tmp-cnvted" -> "sdb sdb1 sdb2" The image was created at: 2025-0504-0622 WARNING. THE EXISTING DATA IN THIS HARDDISK/PARTITION(S) WILL BE OVERWRITTEN! ALL EXISTING DATA WILL BE LOST: *****************************************************. Machine: VirtualBox sdb (107GB|VBOX_HARDDISK_|pci-0000_00_0d_0-ata-2_0||VBc7188192-48ad5f60) *****************************************************. This program is not started by clonezilla server. *****************************************************. Let me ask you again. The following step is to restore an image to the hard disk/partition(s) on this machine: "/tmp/backup-tmp-cnvted" -> "sdb sdb1 sdb2" The image was created at: 2025-0504-0622 WARNING. THE EXISTING DATA IN THIS HARDDISK/PARTITION(S) WILL BE OVERWRITTEN! ALL EXISTING DATA WILL BE LOST: *****************************************************. Machine: VirtualBox sdb (107GB|VBOX_HARDDISK_|pci-0000_00_0d_0-ata-2_0||VBc7188192-48ad5f60) *****************************************************. Shutting down the Logical Volume Manager Finished Shutting down the Logical Volume Manager Creating partition in /dev/sdb... Trying to clean the MBR and GPT partition table on the destination disk first: /dev/sdb Informing the OS of partition table changes... done! Running: dd if=/dev/zero of=/dev/sdb bs=512 count=1 1+0 records in 1+0 records out 512 bytes copied, 0.0133454 s, 38.4 kB/s Create the proportional partition table in /dev/sdb based on /tmp/backup-tmp-cnvted/sdb-pt.sf and the size of /dev/sdb... Running: EXTRA_SFDISK_OPT="--force --wipe always" ocs-expand-gpt-pt -icds --batch /tmp/backup-tmp-cnvted/sdb-pt.sf /dev/sdb 2>&1 No initial MBR table on disk /dev/sdb. Create one now by: LC_ALL=C parted -s /dev/sdb mklabel gpt *****************************************************. Size of original disk: 500118192 sectors. Size of target disk : 209715200 sectors. The ratio for target disk size to original disk size is .4193312767. [1;33m"EFI System partition" found. Not to expand this partition. [0;39m[1;33mLinux swap partition "type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F," found. Not to expand this partition. [0;39mThe partition table to write in /dev/sdb:


label: gpt label-id: BF1C990A-2AAE-C64D-9D63-9791C65F97A3 device: /dev/sdb unit: sectors first-lba: 2048

/dev/sdb1 : start= 4096, size= 614400, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=682AACDC-4C4F-1344-8ACB-4788DD630CD9 /dev/sdb2 : start= 618496, size= 198022905, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=E5E10D2C-537F-964F-A2CD-1744DF919087, name="root" /dev/sdb3 : start= 198641401, size= 26399165, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=95218197-0BD8-C447-AC41-132125F899AE


Running: LC_ALL=C sfdisk --force --wipe always /dev/sdb < /tmp/new_sf.zKZR5u Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors Disk model: VBOX HARDDISK
Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 32B0E43D-DFD1-4418-A675-D30F9B99F1DC

Old situation:

Script header accepted. Script header accepted. Script header accepted. Script header accepted. Script header accepted. Created a new GPT disklabel (GUID: BF1C990A-2AAE-C64D-9D63-9791C65F97A3). /dev/sdb1: Created a new partition 1 of type 'EFI System' and of size 300 MiB. /dev/sdb2: Created a new partition 2 of type 'Linux filesystem' and of size 94.4 GiB. /dev/sdb3: The last usable GPT sector is 209715166, but 225040565 is requested. Failed to add #3 partition: Invalid argument Leaving.

*****************************************************. This was done by EXTRA_SFDISK_OPT="--force --wipe always" ocs-expand-gpt-pt -icds --batch /tmp/backup-tmp-cnvted/sdb-pt.sf /dev/sdb 2>&1 Informing the OS of partition table changes..................................................... done! The disk and partitions in this system now: *****************************************************. Model: ATA VBOX HARDDISK (scsi) Disk /dev/sdb: 107GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:

Number Start End Size File system Name Flags

*****************************************************. Restoring partition /dev/sdb1... Unable to find target partition "sdb1". *****************************************************. The disk and partition in this system: major minor #blocks name

8 0 52428800 sda 8 16 104857600 sdb 11 0 464896 sr0 7 0 393332 loop0 *****************************************************. Check if the partition sdb1 really exists, otherwise maybe the kernel is too old. Program terminated!. `

prisonerr627 avatar May 07 '25 13:05 prisonerr627

As you can see, sfdisk failed: Created a new GPT disklabel (GUID: BF1C990A-2AAE-C64D-9D63-9791C65F97A3). /dev/sdb1: Created a new partition 1 of type 'EFI System' and of size 300 MiB. /dev/sdb2: Created a new partition 2 of type 'Linux filesystem' and of size 94.4 GiB. /dev/sdb3: The last usable GPT sector is 209715166, but 225040565 is requested. Failed to add https://github.com/stevenshiau/clonezilla/issues/3 partition: Invalid argument

The method by using "-k1" + "-icds" does not always work. Please refer to this: https://drbl.org/fine-print.php?path=./faq/2_System/119_larger_to_smaller_disk_restore_clone.faq#119_larger_to_smaller_disk_restore_clone.faq

stevenshiau avatar May 10 '25 09:05 stevenshiau

As you can see, sfdisk failed: Created a new GPT disklabel (GUID: BF1C990A-2AAE-C64D-9D63-9791C65F97A3). /dev/sdb1: Created a new partition 1 of type 'EFI System' and of size 300 MiB. /dev/sdb2: Created a new partition 2 of type 'Linux filesystem' and of size 94.4 GiB. /dev/sdb3: The last usable GPT sector is 209715166, but 225040565 is requested. Failed to add #3 partition: Invalid argument

The method by using "-k1" + "-icds" does not always work. Please refer to this: https://drbl.org/fine-print.php?path=./faq/2_System/119_larger_to_smaller_disk_restore_clone.faq#119_larger_to_smaller_disk_restore_clone.faq

From the link method 2 might not be solution for me because i dont have the source disk now. I only have the image now is there any chance i can somehow resize the clonezilla image to fit into my destination disk size

prisonerr627 avatar May 11 '25 15:05 prisonerr627

Well, maybe you can try to have a virtual machine (virtualbox or VMWare WS) to do that.

  1. Create a big enough disk to restore your image.
  2. Then follow the method 2 to do that.

stevenshiau avatar May 14 '25 13:05 stevenshiau