Page 1 of 5 123 ... LastLast
Results 1 to 10 of 42

Thread: How To Limit ddrescue to a Partition?

  1. #1
    Join Date
    Aug 2007
    Beans
    66

    How To Limit ddrescue to a Partition?

    hi

    this image from gparted shows the first sector and last sector of the partition i want to recover.

    how can i translate those numbers into ddrescue parameters -s and -i? do i need to divide by 8 (a byte) or by 512 (sector size)?

    thx!

    gparted2.png

    ddrescue.png
    Last edited by johny why; March 22nd, 2015 at 12:54 PM.

  2. #2
    Join Date
    Mar 2015
    Location
    europe
    Beans
    Hidden!
    Distro
    Ubuntu Gnome

    Re: How To Limit ddrescue to a Partition?

    good question. answer (from man ddrescue): <in bytes>
    whereas parted gives sectors, which used to be 512 bytes in the old days, more and more advances format drives are in use, where a sector has 4096 bytes. so no dividing... more like multiplier necessary

    As a side note: since you are comfortable using RAID, why not make the output file sparse?
    Last edited by bardo2; March 23rd, 2015 at 10:46 PM.

  3. #3
    Join Date
    Mar 2015
    Location
    europe
    Beans
    Hidden!
    Distro
    Ubuntu Gnome

    Re: How To Limit ddrescue to a Partition?

    Sorry, i missed to answer your question: just use the partition (sda4) instead of the whole disk as input to ddrescue. In linux, everything is seen as a file, even those block devices can be regarded as being files.

  4. #4
    Join Date
    Aug 2007
    Beans
    66

    Re: How To Limit ddrescue to a Partition?

    Quote Originally Posted by bardo2 View Post
    use the partition (sda4) instead of the whole disk as input to ddrescue.
    tried already, didn't work. i think the partition is too damaged. Plz see the gparted screenshot in the OP.

    that's exactly why i want to enter the specific locations using ddrescue start-position option.
    Last edited by johny why; March 24th, 2015 at 01:10 AM.

  5. #5
    Join Date
    Aug 2007
    Beans
    66

    Re: How To Limit ddrescue to a Partition?

    Quote Originally Posted by bardo2 View Post
    good question. answer (from man ddrescue): <in bytes>
    whereas parted gives sectors... so no dividing... more like multiplier necessary
    my drive is 512 sector size. Therefor, 512 x 2721792 = 1393557504

    and for the ddrescue -s option: 512 x 580456448 = 297193701376

    If the above is correct, we'd do:

    ddrescue -i 1393557504 -s 297193701376 /dev/sda /mnt/sdc1/recovered.img /mnt/sdc1/recovered.log

    Is -s the correct parameter to specify input size? The ddrescue manual says "Maximum size of the rescue domain, in bytes. It limits the amount of input data to be copied." So i'm not sure if that means number of bytes to TRY to copy, or number of bytes to ACTUALLY copy (minus the bad data that could not be copied).

    As a side note: since you are comfortable using RAID, why not make the output file sparse?
    My understanding of ddrescue -S sparse is that it skips contiguous 0's, to avoid loading the output file with empty data. I understand RAID to be a scheme for preventing data-loss, by combining multiple hard-disks. Is that correct? How is 'sparse' related to RAID?

    thx!

  6. #6
    Join Date
    Apr 2012
    Beans
    Hidden!

    Re: How To Limit ddrescue to a Partition?

    Hi, here is a nice link to tips and tricks with dd rescue.
    http://www.linuxquestions.org/questi...ommand-362506/
    have fun !
    Craving anchovy, herring and squid pizza.....with clam sauce

  7. #7
    Join Date
    Aug 2007
    Beans
    66

    Re: How To Limit ddrescue to a Partition?

    Quote Originally Posted by Hadaka View Post
    Hi, here is a nice link to tips and tricks with dd rescue.
    http://www.linuxquestions.org/questi...ommand-362506/
    have fun !
    That's not the same command. Thx anyway.

  8. #8
    Join Date
    Mar 2015
    Location
    europe
    Beans
    Hidden!
    Distro
    Ubuntu Gnome

    Re: How To Limit ddrescue to a Partition?

    Quote Originally Posted by johny why View Post
    my drive is 512 sector size. Therefor, 512 x 2721792 = 1393557504

    How is 'sparse' related to RAID?
    It isn't. (Sorry, still new in here and learning my ways, missed your reply.)
    I am using RAID myself and consider that to be somewhat advanced technology, just as understanding sparse files. Here, i use zfs, which has raidz & compression, just saving space while copying huge amounts of data. And you are hinting to be an experienced user - to say the least - . Could i "help" someone like you? - I guess not much.
    My conclusion was: there may not be a need to preserve each and every byte from ddrescue, depending on the input of course.

    Yup, but damaged drives are a pain, been there myself. And ddrescue would have been my choice as well.
    Last edited by bardo2; March 24th, 2015 at 02:40 AM.

  9. #9
    Join Date
    Aug 2007
    Beans
    66

    Re: How To Limit ddrescue to a Partition?

    thx for information, tho' not related to my OP.

    i'm not 'advanced'. I do not know the answer to the question in my OP-- just trying to solve that!

    i appreciate any info about my question-- unrelated stuff just confuses me!

    thx

  10. #10
    Join Date
    Feb 2015
    Beans
    121
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How To Limit ddrescue to a Partition?

    If I understand what u r trying to do (and I apologise in advance if I dont)

    then

    the command above will not limit the size of the image file to exactly that of your partition. In other words, the image file will not be the same as using /dev/sda4. It will be bigger.

    To put it another way, this (hilite is the difference in the two commands):

    ddrescue -i 1393557504 -s 297193701376 /dev/sda /mnt/sdc1/recovered.img /mnt/sdc1/recovered.log

    will not give you the same image file as this:

    ddrescue /dev/sda4 /mnt/sdc1/recovered.img /mnt/sdc1/recovered.log

Page 1 of 5 123 ... LastLast

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
  •