Go Back   TechArena Community > Software > Tips & Tweaks
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How To Clone a disk with ddrescue in Linux

Tips & Tweaks


Reply
 
Thread Tools Search this Thread
  #1  
Old 22-10-2010
Member
 
Join Date: May 2008
Posts: 186
How To Clone a disk with ddrescue in Linux
  

Here is a workaround which I have recently learned how to clone a bad disk in Linux. I just wanted to share this information with the people over here.


1. Use a Linux LiveCD as SystemRescueCd (or the rescue mode on the installation CD for Linux distribution used) to start the system where the disk is connected to clone.
2. Since the terminal is giving access to Shell, run fdisk -l and identify disk (source and target)

Code:
    fdisk-l
3. Launch
Code:
ddrescue -B -v /dev/XXX /dev/YYY /ZZZ/ddrescue_logfile_AAAA-MM-JJ.log
Where:

XXX = name of the complete source disk (NOT the partition.)
YYY = name of the complete target disk (NOT the partition.)
ZZZ = name of the mount point of a disk or a USB key to contain the file 'log' activities ddrescue (not required for dd).

YYYY = 4-digit year.
MM = month on two day.
DD = 2 digit day.

The option -B is to force the expression of numbers using powers binary (1024 instead of 1000 for Kbytes, etc ...)
The -v option is to force ddrescue to be "wordy"(we know about what happens)

When finished, the disk is cloned!

If another 'LiveCD' is used, you may only have to use dd (and not ddrescue). The command line would be:
Code:
dd if=/dev/XXX of=/dev/YYY -BS=16M
The option -BS=16M forces the use of data blocks of 16 MB when the phases of read/write data dd. On the other hand, dd says nothing about what he does so before completing, ddrescue is preferable if disk cloning with "bad sectors" ...

The difference between dd and ddrescue is that it can attempt recovery of bad sectors the disk to clone. But just try. dd stop at the first reading error and will not search if there is anything else to get.

Reply With Quote
  #2  
Old 22-10-2010
Member
 
Join Date: May 2008
Posts: 120
Re: How To Clone a disk with ddrescue in Linux

ddrescue is intended to be copied without being interrupted by a read error, unlike dd.

We will be careful to think
- If the disk has errors, you should consider replacing it;
- If the errors are errors of file system errors and not block, it is advisable to repair the file system,
- If the target is a file, the disk must contain either the greater good
- If the target is a file, it is likely to take another drive and another dd
- Dd (or ddrescue) does not remedy a disk (filesystem), nor that a copy of the same size.

This is a kind of cloning.

Disk cloning may be deployed from the perspective of a master. And there is free tool partimage (and now on SystemRescueCd clonezilla) who knows just what to copy. In addition, we think of parted or gparted to resize partitions (defragmented prior to ntfs or fat32=vfat).
Reply With Quote
  #3  
Old 22-10-2010
Member
 
Join Date: Mar 2009
Posts: 175
Re: How To Clone a disk with ddrescue in Linux

You just forgot a few details about how to use ddrescue. The procedure is as follows:
1 - To recover quickly: the -n parameter does not stress when encountering a bad sector
Code:
ddrescue -B -v -n /dev/XXX /dev/YYY /ZZZ/ddrescue_logfile_AAAA-MM-JJ-HHMM.log
I prefer to add time in log file names: easier if we generate more in one day

2 - We did another pass to try to recover the non-read the first pass. Needless course in the absence of bad sectors:

Code:
ddrescue -B -v -c 16 -r 2  /dev/XXX /dev/YYY /ZZZ/ddrescue_logfile_AAAA-MM-JJ-HHMM.log
Be careful to indicate the same .log file, since it is from there that will identify areas to recover. 16 sectors are treated at once (c-16) and retries is 2 (-r 2).

3 - If needed redo a third passage:

Code:
ddrescue -B -v -c 1 -r 5 /dev/XXX /dev/YYY /ZZZ/ddrescue_logfile_AAAA-MM-JJ-HHMM.log
This time, it does only one sector at a time (-c 1) and the emphasis is heavily (5 retries: r-5).
Reply With Quote
  #4  
Old 22-10-2010
Member
 
Join Date: Feb 2008
Posts: 767
Re: How To Clone a disk with ddrescue in Linux

No, the frequency of writing has nothing to do: ddrescue stores sector by sector that has already been duplicated, and that only explains the size of the log file. Reduce the size, it would mean not only by memorizing clusters, or other group of industries, and suddenly the possibilities of recovery and focus on the bad sectors would be far less accurate which would increase enormously in the time passes by resumed.
Reply With Quote
Reply

  TechArena Community > Software > Tips & Tweaks
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How To Clone a disk with ddrescue in Linux"
Thread Thread Starter Forum Replies Last Post
unable get status display when running Acronis B&R 11 clone disk ChittiBabu Windows Software 1 09-01-2012 05:11 PM
PC Disk Clone Free 8.0 not able to get install Kaufman Operating Systems 5 31-03-2010 06:10 AM
Clone your hard disk with Clonezilla LiveCD SmirnOFF Operating Systems 2 07-04-2009 07:33 PM
Need help to clone Hard disk drive Bracken Windows Software 1 28-02-2009 07:23 PM
How to clone a Hard Disk Drive ? TechyGuy Tips & Tweaks 0 20-11-2008 01:28 PM


All times are GMT +5.5. The time now is 04:38 AM.