Page 1 of 1

Bash Script to make Partimg into Diskimager - any interest?

Posted: Tue Sep 11, 2007 6:08 pm
by rickyrockrat
I am building a script to convert partimage into a disk imager, where it grabs the partition table and MBR, then has partimage generate images for each partition. It then tars these files up and saves them as a complete disk image.

I have the save part working. I will make this script more civilized if anyone is interested.

Posted: Fri Oct 12, 2007 9:56 am
by rickyrockrat
It is under GPL. A link to it is here and the static compiled x86 partimage binary (for dsl-3.4.4) is here.

Diskimage 1.11 is ready (note: these are CVS versions). I have changed the verify to only do it on a per-disk image. I've come to realize that Acronis and others DO NOT verify your write. They assume that if there were no write errors, the data is good. This script does a verify, but of course it takes much longer since the data must be handled 3x:

save:
1) Zero unused data
2) Save used data
3) MD5 sum whole partition
restore:
1) Zero partition
2) Restore partition
3) MD5 partition

It currently handles Fat, Fat32, and Ext2. I do not have a need for NTFS, but it should be trivial to add - just add the partition type(s) in two case statments (save and restore), then make sure you have NTFS fsck tools installed.

Of course, everything is configurable. You can choose to just save unused data, w/ no verify.

I've even created a script that extracts the DSL live CD, rips some things out of it, fixes some of the scripts (USB PNP doesn't work - just put exit 0 at the top of scanpartitions), then adds a little disk imager interface. When it is done, it re-builds the live CD - though that script is not here and not available. I'll be glad to answer any questions on how it's done - it's really fairly simple once you figure it all out..

Enjoy