Results 1 to 4 of 4

Thread: How To Clone a disk with ddrescue in Linux

  1. #1
    Join Date
    May 2008
    Posts
    188

    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.

  2. #2
    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).

  3. #3
    Join Date
    Mar 2009
    Posts
    176

    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).

  4. #4
    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.

Similar Threads

  1. Replies: 1
    Last Post: 09-01-2012, 06:11 PM
  2. PC Disk Clone Free 8.0 not able to get install
    By Kaufman in forum Operating Systems
    Replies: 5
    Last Post: 31-03-2010, 06:10 AM
  3. Clone your hard disk with Clonezilla LiveCD
    By SmirnOFF in forum Operating Systems
    Replies: 2
    Last Post: 07-04-2009, 07:33 PM
  4. Need help to clone Hard disk drive
    By Bracken in forum Windows Software
    Replies: 1
    Last Post: 28-02-2009, 08:23 PM
  5. How to clone a Hard Disk Drive ?
    By TechyGuy in forum Tips & Tweaks
    Replies: 0
    Last Post: 20-11-2008, 02:28 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,658,344.30070 seconds with 17 queries