dd / ddrescue Question

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Post Reply
Message
Author
Ryon
Posts: 10
Joined: 29 Dec 2013, 04:16

dd / ddrescue Question

#1 Post by Ryon » 29 Dec 2013, 04:35

I would like to backup/clone/copy a failed partition to a file under Linux, and be able to reverse the process if needed. Reading the ddrescue documentation, it seems that partitions can only be copied to other partitions, and the dd documentation is ambiguous on this as well. Will this create a good backup of a my partition to a file?

>dd bs=512K if=/dev/sda /home/me/bup.dd conv=noerror

or this?

>dd bs=512K if=/dev/sda2 /home/me/bup.dd conv=noerror

Also, will it do any damage if I get the block size wrong? Thanks!

Sponsored links

Ryon
Posts: 10
Joined: 29 Dec 2013, 04:16

Re: dd / ddrescue Question

#2 Post by Ryon » 31 Dec 2013, 19:36

I think I have the answer from the Arch linux wiki:

Code: Select all

 # dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c  > /mnt/sda1/hda.img.gz
and to restore,

Code: Select all

 # fdisk -l /dev/hda > /mnt/sda1/hda_fdisk.info
Basic stuff. It allows us to backup to a normal zipped file instead of buying another hard disk to clone to directly.

EDIT: Cut and pasted the wrong line! That second should be

Code: Select all

# gunzip -c /mnt/sda1/hda.img.gz | dd of=/dev/hda

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest