Copying partitions

Jim Conner jconner
Mon Feb 19 03:35:08 PST 2007


On Sunday, February 18, 2007 10:53 pm, David Bandel wrote:
> On 2/18/07, Jim Conner <jconner at insightbb.com> wrote:
> > I'm looking to get a new hard drive(320GB) to replace my current hard
> > drive(20GB).  I have four partitions on the currend hard drive:
> > /
> > /home
> > /data
> > /usr/local/games
> > I'm looking to move all the files in these to the new drive, make the
> > drive primary master and rerun lilo.  I don't really want to reinstall my
> > OS. The question I'm asking is how to copy these partitions and keep all
> > the permissions and ownership about them.  Would dd work?  And would the
> > command be: dd if=/dev/hda? of=/dev/hdb?  Does the respective partitions
> > have to be the same size?  Or would I have to tarball up each partition
> > and untar them in the correct place?  I've had problems with this with
> > the length of file name.
> > Thanks in advance for any and all help.
>
> The best way to do this is to use cpio, second best is rsync.
>
> cpio needs a list of files fed to it, so something like:
>
> find / -print | cpio -o | cpio -idm
>
> dd is for duplicating disk information -- not really what you need.
> cp -a is not really appropriate for this type of backup
> tar does not handle device files or special files
> cpio handles all files, but does not recurse directories, needs to be
> told what to archive, etc.  It is, however, a little more hateful to
> use than tar.  Redirection is required for both input and output.
> cpio takes more getting used to.
>
> rsync will do you better for copying across.  cpio looks at file size
> and mtime to decide if it needs to copy a file (unless you specify
> -u), rsync looks at the two files' data to determine if copying and/or
> modifying is necessary.
>
> Which you use just depends.  But if you don't have a backup, I suggest
> you use something like mindi/mondo to make a CD backup and restore
> from that to your new disk.  That way, you will have a backup.
>
> Ciao,
>
> David A. Bandel
Thank you for your advice.  I'll look in to cpio and mindi/mondo.  Does 
mindi/mondo backup to DVD-R?

Jim
-- 
 
 06:01:01 up 7 days, 21:53,  1 user,  load average: 0.00, 0.00, 0.00
------------------------------------------------------------------------
Running Mandriva 2007 - Linux - because life is too short for reboots...
Registered Linux User: 181038      --        http://counter.li.org



More information about the Linux-users mailing list