Thomas-Tsai / partclone

Partclone provides utilities to backup a partition smartly and it is designed for higher compatibility of the file system by using existing library.
GNU General Public License v2.0
306 stars 104 forks source link

The possibility of restoring an image to a partition smaller than the original partition where the image was created. #240

Open hongyi-zhao opened 8 months ago

hongyi-zhao commented 8 months ago

Dear Partclone Community,

I am seeking guidance on a specific operation involving the restoration of an image file, sda1.img, to a relatively different location - the /dev/sda3 device.

To give you a brief overview, I have previously created an image file, sda1.img, using the Partclone v0.3.17 tool. Here are the specifications of the created image:

$ sudo partclone.info -s sda1.img
Partclone v0.3.17 http://partclone.org
Showing info of image (sda1.img)
File system:  EXTFS
Device size:  209.7 GB = 51199951 Blocks
Space in use:  20.2 GB = 4939090 Blocks
Free Space:   189.5 GB = 46260861 Blocks
Block size:   4096 Byte

image format:    0002
created on a:    64 bits platform
with partclone:  v0.3.23
bitmap mode:     BIT
checksum algo:   CRC32
checksum size:   4
blocks/checksum: 256
reseed checksum: yes

I'm considering the restoration of this image file into /dev/sda3 device. I ran the ‘fdisk -l’ command to obtain the necessary details about this device:

$ sudo fdisk -l /dev/sda3
Disk /dev/sda3: 29.3 GiB, 31457280000 bytes, 61440000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Considering the considerable size gap between the source image and the destination device, I am not certain whether the image restoration would work properly or if it's even a feasible option. Thus, I am inquiring if it's possible to restore the sda1.img file to the /dev/sda3 location without causing any issues?

Any assistance or guidance on this matter would be highly appreciated.

Thank you for your time and assistance.

Best Regards, Zhao