Re: dd

Bill Strosberg <[email protected]>
Newsgroups gmane.user-groups.linux.ottawa.general
Message-ID <[email protected]>
On 12-05-12 08:34 PM, Allan wrote:
> I hope someone can shed some light on using the command dd.  I've been backing
> up my system using dd if=/dev/sda of=/dev/sdx bs=some multiple of 512.  This
> has been very useful when I have had to repair a broken partition and has
> proven very satisfactory since one drive is essentially a clone of the other.
>
> I know that dd does a bit by bit copy.  What I don't know is if I can use dd
> to copy a partition to a different location on the same drive or to a
> differently numbered partition on another drive.
>
> In case this is not clear, I'd like to know if the following commands will
> work.
>
> dd if=/dev/sda1 of=/dev/sda5 or
>
> dd if=/dev/sda1 of=/dev/sdc9.
>
> Can someone give me some guidance on this?  Thanks in advance.
>
> Allan
Yes, both commands will work, providing the partitions exist, are of 
proper type, the block size matches and the target is of adequate size.

dd copies everything, including errors so you should perform fsck.ext3 
-f -c -y -v /dev/sda1 on the infile prior to copying and on the outfile 
after copying to verify the integrity of the filesystem, superblocks 
etc.  Your do have to match the filesystem type to the filesystem check 
program you are using, so fsck is for ext2/ext3 systems.

I've used GNU ddrescue quite happily on dead or dying disks  - it is 
worth reading and trying.   I prefer it to dd on disks where errors 
start to become noticed.

--
Bill Strosberg
-- 
OCLUG general discussion list
[email protected]
http://oclug.on.ca/mailman/listinfo/oclug
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.