LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-21-2008, 04:15 PM   #1
carlos_vcan
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
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?
 
Old 05-21-2008, 04:24 PM   #2
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 533

Rep: Reputation: 79
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.
 
Old 05-22-2008, 09:13 AM   #3
carlos_vcan
LQ Newbie
 
Registered: May 2008
Posts: 4

Original Poster
Rep: Reputation: 0
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.

Last edited by carlos_vcan; 05-22-2008 at 12:13 PM.
 
Old 05-22-2008, 09:22 AM   #4
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
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.
 
Old 05-22-2008, 10:14 AM   #5
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 43
if you just want a corrupted HD I have several laying around that you could play with!
 
Old 05-22-2008, 10:33 AM   #6
Stin
LQ Newbie
 
Registered: Feb 2008
Distribution: Redhat 7.3 Valhalla, Solaris 8, HP Tru64
Posts: 25

Rep: Reputation: 15
Quote:
Originally Posted by carlos_vcan View Post
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?
 
Old 05-23-2008, 02:58 PM   #7
carlos_vcan
LQ Newbie
 
Registered: May 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jiml8 View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicating a Linux System Disk rapidly (ie. ghosting a HDD) richearle Linux - General 1 08-02-2006 03:56 AM
duplicating linux installs ozzy_cow Linux - General 3 04-26-2004 10:39 PM
duplicating contents of a HD peterhf Linux - Hardware 9 08-12-2003 04:30 PM
corrupted bz2's .... hdd problem? SiQDiZ Slackware 7 06-04-2003 01:47 AM
duplicating a webserver jasoncngo Linux - Software 6 04-07-2003 01:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration