[1379] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: dd to copy

daemon@ATHENA.MIT.EDU (Paul Anderson)
Mon Oct 28 07:17:26 1996

Date: Mon, 28 Oct 1996 07:31:43 -0500
From: Paul Anderson <andersop@agapesystems.com>
To: redhat-list@redhat.com
CC: Mike Sangrey <mike@sojurn.lns.pa.us>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

redhat-digest-request@redhat.com wrote:
 
> Subject: Re: dd to copy
> Date: Sun, 27 Oct 1996 19:35:44 -0500
> From: Mike Sangrey <mike@sojurn.lns.pa.us>
> To: redhat-list@redhat.com
> 
> William T Wilson wrote:
> > > This statement is inaccurate.  The drives do not need to be the same
> > > size and have the exact same geometry.  dd is a copy at the bit level
> >
> > Okay, perhaps they do not need the same geometry.  They do however have to
> > be the same size.  Suppose the destination drive is SMALLER than the
> > source drive.  Then when dd tries to write out the data, it will write
> > past the end of the device.  If the destination drive is LARGER, then the
> > filesystem which is created will think it is smaller than it is, which
> > will drive everything nuts.
> 
> Yep!  For amusement, try
>    dd if=/dev/fd0 of=/dev/hda1
> 
> where /dev/fd0 has a filesystem on it.  You now have a 1.4M filesystem (less
> overhead) on /dev/hda1.  This extreme example makes the problem obvious.  Hard
> drives that are nearly the same could easily produce disastrous results; the
> problem not being obvious till it's too late.
> 
> Using dd in this way is just too dangerous -- there is just too much
> non-intuitive affects that could cause something to go wrong when using this
> as a general purpose solution.  Best to just stick with tar or cpio.  dd
> should be thought of as making a physical image copy.  Not for copying files
> or even a filesystem.
> 
> It might be useful after a mkisofs.  Has anyone tried using dd to copy the
> CDROM image to a CDROM writer?  This is a case of physical image copy and this
> is where dd shines.
> 
> --
>   Mike Sangrey  <mike@sojurn.lns.pa.us> (Home)
>                 <Mike.Sangrey@specmarkmet.com>(Work)
>         "I've trademarked `William Della Croce, Jr.(tm)'.
>                   Anyone using this name owes me $1,000,000."
> 
OK, I guess I did forget to mention that with any Unix based command,
including dd, one has to be less than brain dead in order to use it. 
Your example would denote a brain dead condition to even try it.  I
really don't have a problem with cpio or tar, although personally I tend
to use cpio.  The example I first responded to was to copy the partition
of a filesystem on one disk to the partition of a newly formatted disk. 
In this situation I believe my statements to be correct.  I did not
formulate the thesis that all copies should be made by using dd, and
certainly the situtaion you propose was never a part of this thread.

Paul Anderson


--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post