On Mon, 8 Jan 2001, cmead wrote:

> Hi,
>
> I'm using 6.2, I have a 10GB hard drive which is partitioned in half first 5
> GB is / the other half is /home. The box is our server which i use for DNS,
> Samba, Netatalk, Masq, printing...so for me alot of work went into setting
> this up it runs perfectly :)
>
> My question, is I want to upgrade to a new much bigger hard drive over 40GB.
> Is there a *flawless* way to just plug in the new drive and copy everything
> over and then remove the old drive? So i could use as a back up in case this
> new one ever goes down.

There are a few ways... cp, tar, dump will all do it this for you.  But
there are gotchas.  You want to preserve your permissions and you don't want
to cross partition boundries.  You don't, for instance want to copy the
contents of /proc or get recusive and create /mnt/tmp/mnt/tmp/mnt/tmp ect
ect ect.  (gee this copy is taking an /awful/ long time...)

So you've got your old drive with / and /home.  I'll assume you've used
fdisk or what ever and paritioned your new big drive in a similar way?  If
you're going to just use one huge partition on the new drive things are even
similar.

For these examples we'll assume the old drive is hda with / and /home being
on the first and second paritiion.  We'll assume the new drive is hdb
partitioned in the same way.

mkdir /mnt/tmp
mount /dev/hdb1 /mnt/tmp
cp -ax / /mnt/tmp  # copy everything but don't cross filesystems.
mount /dev/hda2 /mnt/tmp/home # the first cp made the new mount point for us
cp -ax /home /mnt/tmp

... now your complete system has been duplicated under /mnt/tmp.  You should
have a /mnt/tmp/proc directory but it should be empty.

Instead of the copy commands you could use...

tar -cplf - / |  (cd /mnt/tmp && tar -xvpf -)
tar -cplf - /home | (cd /mnt/tmp/home && tar -xvpf -)

... or...

dump -f - / | (cd /mnt/tmp && restore -x -f -)
dump -f - /home | (cd /mnt/tmp/home && restore -x -f -)

.. to do much the same thing.  cp and tar are roughly equivilent for our
purposes here.  Dump is the only one that will preserve hard links across
the copy but I tend to think that's more effort that it is worth.

M.

P.S.  Note that /mnt/tmp/etc/fstab will refere to /dev/hda even though it is
actually now on /dev/hdb.  Of course this doens't matter if you're planning
on yanking the original drive and replacing it once the copy is done.

-- 
WebCentral Pty Ltd           Australia's #1 Internet Web Hosting Company
Level 1, 96 Lytton Road.           Network Operations - Systems Engineer
PO Box 4169, East Brisbane.                       phone: +61 7 3249 2583
Queensland, Australia.                            pgp key id: 0x900E515F




_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to