CloneZilla 大镜像还原到小磁盘的方法
以前的板子是32G的eMMC做了个备份。
后来厂家换了颗料。容量有所下降,30G左右。
根据官方提示
https://clonezilla.org/clonezilla-live/doc/11_lite_server/advanced/09-advanced-param.php
-k1 + -icds
是不行的。
看log显示
*.
Thu Dec 5 09:12:42 UTC 2024
Writing the partition table...
Create the proportional partition table in /dev/mmcblk0 based on /home/partimag/ps_cn_fahuo_2018-11-21-08-img/mmcblk0-pt.sf and the size of /dev/mmcblk0...
Running: EXTRA_SFDISK_OPT="--force --wipe always" ocs-expand-mbr-pt -icds --batch /home/partimag/ps_cn_fahuo_2018-11-21-08-img/mmcblk0-pt.sf /dev/mmcblk0 2>&1
No initial MBR table on disk /dev/mmcblk0. Create one now by:
LC_ALL=C parted -s /dev/mmcblk0 mklabel msdos
*.
The ratio for target disk size to original disk size is .9924892703.
[1;33mLinux swap partition "type=82" found. Not to expand this partition.
[0;39mThe partition table to write in /dev/mmcblk0:
label: dos
unit: sectors
/dev/mmcblk0p1 : start= 2048, size= 52506589, Id=83, bootable
/dev/mmcblk0p2 : start= 52508637, size= 8102017, Id=5
/dev/mmcblk0p5 : start= 52508639, size= 8163328, Id=82
。。。。。。。。。。。
This was done by EXTRA_SFDISK_OPT="--force --wipe always" ocs-expand-mbr-pt -icds --batch /home/partimag/ps_cn_fahuo_2018-11-21-08-img/mmcblk0-pt.sf /dev/mmcblk0 2>&1
Informing the OS of partition table changes..................................................... done!
*.
The first partition of disk /dev/mmcblk0 starts at .
The hidden space between MBR and 1st partition is "-1" sectors, which is smaller than the hidden data /home/partimag/ps_cn_fahuo_2018-11-21-08-img/mmcblk0-hidden-data-after-mbr) size "2047" sectors.
Skip restoring the hidden data between MBR and 1st partition.
*.
*.
Restoring partition /dev/mmcblk0p1...
Unable to find target partition "mmcblk0p1".
*.
The disk and partition in this system:
major minor #blocks name
179 0 30310400 mmcblk0
179 256 4096 mmcblk0boot0
179 512 4096 mmcblk0boot1
8 0 30031872 sda
8 1 30030832 sda1
7 0 380676 loop0
*.
Check if the partition mmcblk0p1 really exists, otherwise maybe the kernel is too old.
果断修改源文件的-pt.sf
修改前
label: dos
label-id: 0x42edc1ae
device: /dev/mmcblk0
unit: sectors
/dev/mmcblk0p1 : start= 2048, size= 52903936, type=83, bootable
/dev/mmcblk0p2 : start= 52908030, size= 8163330, type=5
/dev/mmcblk0p5 : start= 52908032, size= 8163328, type=82
修改后
label: dos
label-id: 0x42edc1ae
device: /dev/mmcblk0
unit: sectors
/dev/mmcblk0p1 : start= 2048, size= 52903936, type=83, bootable
/dev/mmcblk0p2 : start= 52908030, size= 7712770, type=5
/dev/mmcblk0p5 : start= 52908032, size= 7712768, type=82
解决问题