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!
dd / ddrescue Question
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
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
Re: dd / ddrescue Question
I think I have the answer from the Arch linux wiki:
and to restore,
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
# dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz
Code: Select all
# fdisk -l /dev/hda > /mnt/sda1/hda_fdisk.info
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