December 1st, 2012, 7:14
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# deinterlace.py
#
# INTENT = This is a script for deinterlacing two raw dd images
# taken from a failed RAID 0 array into one "valid" image file
# that we hope to be able to recover data from.
#
# This is strictly experimental.
#
# Thursday, May 1, 2008 -Simón A. Ruiz
#
inputFiles = [open("dd1.img","rb"),open("dd2.img","rb")]
outputFile = open("alldd.img","wb")
chunkSize = 262144
# And, so as not to have to figure this out every time through the loop...
numFiles = len(inputFiles)
i = 0
while True:
nextChunk = inputFiles[i%numFiles].read(chunkSize)
if not nextChunk:
print 'Done! No more data.'
break
outputFile.write(nextChunk)
i += 1
outputFile.close()
for file in inputFiles:
file.close()
kpartx -d alldd.imgDecember 1st, 2012, 9:12
December 1st, 2012, 9:56
December 1st, 2012, 19:24
December 1st, 2012, 19:29
Powered by phpBB © phpBB Group.