Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partclone.btrfs / size mismatch and error #262

Open
limbo127 opened this issue Jan 23, 2025 · 2 comments
Open

partclone.btrfs / size mismatch and error #262

limbo127 opened this issue Jan 23, 2025 · 2 comments

Comments

@limbo127
Copy link

Hello,
system.img is a raw file , create lot of data on it, then delete data
=> virtual size if 88G ( sparse file ) , physical size is 28G
on it I've a btrfs filesystem, the data on it is 347M ( after delete the 28G of data test)
so :

npRouen>ls -lash system.img
28G -rw-r--r-- 1 root root 88G Jan 23 16:32 system.img

npRouen>partclone.btrfs -c -d1 -s system.img -O system.clone
Partclone v0.3.32 http://partclone.org
Starting to clone device (system.img) to image (system.clone)
Reading Super Block
Calculating bitmap... Please wait...
done!
File system: BTRFS
Device size: 94.4 GB = 5761841 Blocks
Space in use: 347.1 MB = 21184 Blocks
Free Space: 94.1 GB = 5740657 Blocks
Block size: 16384 Byte
Elapsed: 00:00:02, Remaining: 00:00:00, Completed: 100.00%, Rate: 10.41GB/min,
Current block: 3487913, Total block: 5761841, Complete: 100.00%
Total Time: 00:00:02, Ave. Rate: 10.41GB/min, 100.00% completed!
Syncing... OK!
Partclone successfully cloned the device (system.img) to the image (system.clone)
Cloned successfully.

Now i restore the clone :

npRouen>partclone.btrfs -r -s system.clone -O system.afterclone
Partclone v0.3.32 http://partclone.org
Starting to restore image (system.clone) to device (system.afterclone)
Calculating bitmap... Please wait...
Target partition size(0 MB) is smaller than source(94403 MB). Use option -C to disable size checking(Dangerous).
Partclone fail, please check /var/log/partclone.log !

if i use -C the btrfs is not mountable on system.afterclone

Regards,
Nicolas

@Thomas-Tsai
Copy link
Owner

Hi,

Could you try option -W to restore an image to a raw file?

or

fallocate -l 100G simulation_partition
losetup /dev/loop0 simulation_partition
partclone.restore -s YOURIMAGE -o /dev/loop0
mount /dev/loop0 /mnt

@limbo127
Copy link
Author

Hello,
you're right,
thanks.
Is it possible that -W create a raw sparse file in place of raw flat ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants