[1360] in RedHat Linux List

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

Re: [Fwd: Re: moving contents of hard drive]

daemon@ATHENA.MIT.EDU (Donnie Barnes)
Sun Oct 27 23:34:32 1996

To: redhat-list@redhat.com
In-reply-to: Your message of "Sun, 27 Oct 1996 08:24:57 EST."
             <327362A9.740D9105@agapesystems.com> 
Date: Sun, 27 Oct 1996 23:32:20 -0500
From: Donnie Barnes <djb@redhat.com>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com


>> The thread that dealt with this issue last summer mentioned cpio as a good
>> tool to use, and there was an article in the Linux Journal (March 1996, pp.
>> 44ff.) which explained how to do this using cpio.
>> 
>> Essentially, the command would be (assuming the target partition is mounted as
>> /mnt/export):
>> 
>> find / -depth -xdev | cpio --pass-through --preserve-modification-times
>> --make-directories --verbose /mnt/export
>> 
>> This gets everything over, but avoids crossing over into mounted partitions,
>> which means the find will not venture to copy your CD contents, your mounted
>> nfs drives, your dos drives you might have mounted--only your root partition,
>> and all the files on it.
> 
>In comparision to "dd if=/dev/XXX of=/dev/XXX" the command structure you
>propose seems very complex.  dd also gets all files with permissions
>down to the bit level and will not cross mount points.  The beauty of
>Unix is that you can dream up ever more complex ways of doing what is
>easily accomplished.  However, the orginal mindset of Unix, other than
>for playing games, was to make small tools that were easy to use and be
>compiled into larger tools when that was necessary.  And just in case
>you want dd to be a more complex command, there are many switches which
>can be set.

I ignored the first suggestion to use dd, but I can't ignore it again.

Using 'dd' to copy the contents of one disk to another is, at best,
a bad idea.  For one, you can *not* copy your /usr tree from a disk
that has /usr on the same disk as your root partition to a disk all
it's own.

For another, well, sheesh, using dd is just bad.  Picture this:

Partition A - 100M
Partition B - 200M

You want to copy all of A to B.  You use dd.  Fine.  Do a 'df' on it.
You now have a 100M partition B.  Oh, don't forget, you'd better umount
the target drive and mount back after you do the dd (or really odd
things could happen).

What happened was you took a raw device 100M in size and did a mke2fs
on it.  You then made a mirror of that onto B.  As far as Linux
is concerned, you now are limited to 100M of filesystem space on B
with no way to increase that (ext2fs can't be dynamically resized).

Using 'dd' to copy whole hard drive devices is a *bad* thing for 
anyone who is not *very* familiar with 'dd' to do.  Very bad.  If you
aren't careful 'dd' can destroy all your data very quickly.

People, please use 'cp -a', or my personal favorite, which is 
to tar to stdout and pipe that through a cd and another tar.  Or,
the cpio tricks as posted will work well, too.

And remember, use *something* that preserves timestamps since the
RPM database will get mad and 'rpm -Va' will report *tons* of 
incorrect times if you more /usr or something.


--Donnie

--
  Donnie Barnes        http://www.redhat.com/~djb      "Bah."
    djb@redhat.com       http://www.turner.com/lazarusman/   
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
_Things You'd NEVER Expect A Southerner To Say_ by Vic Henley:     
**  I hate the long version of ``Free Bird''.


--
  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