LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Duplicating a corrupted HDD (https://www.linuxquestions.org/questions/linux-newbie-8/duplicating-a-corrupted-hdd-643876/)

carlos_vcan 05-21-2008 04:15 PM

Duplicating a corrupted HDD
 
For some tests I need to duplicate a corrupted hard drive (the filesystem is corrupted according to reiserfsck). I do not need to repair it but to clone the BAD filesystem structure into other identical HDDs several times. I don't even care about the contents of the files.

This is the problem:
using dd takes hours for a 250GB HDD
using clonemaxx or other software takes hours too

if i duplicate the MBR and the boot record using dd and then run reiserfsck I get as a response that the filesystem is healthy.

Any ideas to have a good supply of identical corrupted hdds without waiting for hours?

angel115 05-21-2008 04:24 PM

Well I'm not sure of what do you want to do exactly but if you want to duplicate (clone) your Hard drive "dd" will do the job fairly well.

if you do not want to clone your HD can you please clarify?

Regards,

Angel.

carlos_vcan 05-22-2008 09:13 AM

Clarification
 
Well, I'll try to make it as clear as possible.... I'm not really familiar with filesystems so, I don't know if what I want to do is possible.

STEP 1
I have a corrupted HDD (according to the results of reiserfsck)

STEP 2
I am testing an equipment that runs reiserfsck --rebuild-tree automatically. So, I get a functional HDD after the test.

STEP 3
I'd like to restore the HDD to the original condition (corrupted)in order to run similar tests in different equipments.
__

This is what I did thinking that it would help me avoid the three hours of cloning:

dd if=/dev/hda of=/dev/hdb bs=512 count=1
dd if=/dev/hda1 of=/dev/hdb1 bs=512 count=1

hdb is the one that had been repaired.
hda is a corrupted clone.
I ran again reiserfsck on hdb1 and I got a "healthy" result.

Is the tree information saved in the partition table? If not, how can I duplicate it?

Other possibility. How can I manually edit and corrupt the filesystem?

First time I have problems to make something malfunction! Usually it comes naturally...

Thanks.

jiml8 05-22-2008 09:22 AM

dd is a wonderful tool for corrupting filesystems.

for instance dd if=/dev/random of=/my/output/device seek=someoffsetvalue

will make a real mess, particularly if the offset is into the filesystem header.

ncsuapex 05-22-2008 10:14 AM

if you just want a corrupted HD I have several laying around that you could play with!

Stin 05-22-2008 10:33 AM

Quote:

Originally Posted by carlos_vcan (Post 3160732)
For some tests I need to duplicate a corrupted hard drive (the filesystem is corrupted according to reiserfsck). I do not need to repair it but to clone the BAD filesystem structure into other identical HDDs several times. I don't even care about the contents of the files.

This is the problem:
using dd takes hours for a 250GB HDD
using clonemaxx or other software takes hours too

if i duplicate the MBR and the boot record using dd and then run reiserfsck I get as a response that the filesystem is healthy.

Any ideas to have a good supply of identical corrupted hdds without waiting for hours?


I think dd is the tool you need as it is a byte-by-byte copy.

If it can wait a while, why don't you leave it running overnight and come back to it in the morning?

carlos_vcan 05-23-2008 02:58 PM

Quote:

Originally Posted by jiml8 (Post 3161417)
dd is a wonderful tool for corrupting filesystems.

for instance dd if=/dev/random of=/my/output/device seek=someoffsetvalue

will make a real mess, particularly if the offset is into the filesystem header.

Hey thanks for the idea, I did this:

>sudo dd if=/dev/sda1 of=/dev/sdb1 skip=0 count=9000 bs=4096

For reiserfsck they are now identically corrupted. According to what I've read today, I think I copied the superblock, the journal and some of the data... and only took 1 minute. It's going to save me 2h59min per disk.


All times are GMT -5. The time now is 06:27 PM.