restore_to_raw option test

create raw file floppy.raw

dd if=/dev/zero of=floppy.raw bs=1024 count=262144

262144+0 records in 262144+0 records out 268435456 bytes (268 MB) copied, 1.04331 s, 257 MB/s

format floppy.raw as ext3 raw partition

mkfs.ext3 -F floppy.raw

mke2fs 1.42.8 (20-Jun-2013) Discarding device blocks: 1024/262144 done
Filesystem label= OS type: Linux Block size=1024 (log=0) Fragment size=1024 (log=0) Stride=0 blocks, Stripe width=0 blocks 65536 inodes, 262144 blocks 13107 blocks (5.00%) reserved for the super user First data block=1 Maximum filesystem blocks=67371008 32 block groups 8192 blocks per group, 8192 fragments per group 2048 inodes per group Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185

Allocating group tables: 0/32 done
Writing inode tables: 0/32 done
Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: 0/32 done

clone floppy.raw to floppy.img

../src/partclone.extfs -d -c -s floppy.raw -O floppy.img -F -L test.log

Partclone v0.2.70 http://partclone.org Starting to clone device (floppy.raw) to image (floppy.img) Reading Super Block Calculating bitmap… Please wait… Elapsed: 00:00:01, Remaining: 00:00:00, Completed: 100.00% Total Time: 00:00:01, 100.00% completed! done! File system: EXTFS Device size: 268.4 MB = 262144 Blocks Space in use: 19.0 MB = 18560 Blocks Free Space: 249.4 MB = 243584 Blocks Block size: 1024 Byte Elapsed: 00:00:01, Remaining: 00:01:39, Completed: 1.00%, 0.00byte/min, current block: 0, total block: 262144, Complete: 0.00% Elapsed: 00:00:02, Remaining: 00:00:00, Completed: 100.00%, Rate: 570.16MB/min, current block: 254211, total block: 262144, Complete: 100.00% Total Time: 00:00:02, Ave. Rate: 570.2MB/min, 100.00% completed! Syncing… OK! Partclone successfully cloned the device (floppy.raw) to the image (floppy.img) Cloned successfully.

real 0m2.062s user 0m0.092s sys 0m0.056s

restore floppy.img to floppy.raw file(raw format)

../src/partclone.extfs -r -s floppy.img -o loop_floppy.raw -L test.log --restore_raw_file 

Partclone v0.2.70 http://partclone.org Starting to restore image (floppy.img) to device (loop_floppy.raw) Calculating bitmap… Please wait… done! File system: EXTFS Device size: 268.4 MB = 262144 Blocks Space in use: 19.0 MB = 18560 Blocks Free Space: 249.4 MB = 243584 Blocks Block size: 1024 Byte Elapsed: 00:00:01, Remaining: 00:01:39, Completed: 1.00%, 0.00byte/min, current block: 0, total block: 262144, Complete: 0.00% Elapsed: 00:00:02, Remaining: 00:00:00, Completed: 100.00%, Rate: 570.16MB/min, current block: 254211, total block: 262144, Complete: 100.00% Total Time: 00:00:02, Ave. Rate: 570.2MB/min, 100.00% completed! Syncing… OK! Partclone successfully restored the image (floppy.img) to the device (loop_floppy.raw) Cloned successfully.

test row file by blkid?

blkid floppy.raw

floppy.raw: UUID=“ed875000-98e2-4a85-b579-302f47060b82” SEC_TYPE=“ext2” TYPE=“ext3”

restore to raw test ok

clear tmp files floppy.img floppy.raw test.log