On Wed, Aug 27, 2003 at 11:39:44AM +0200, Sasa Stupar wrote:
> Hi!
> 
> I have for a while installed redhat 8.0. Now I am experiencing some 
> problems with my hard disk so what I want to do is to copy entire hard 
> disk to a new one. I don't want to reinstall the system from scratch. 
> How can I do that ? It is an EIDE HDD.
> 
> Sasa

You want to do the copy partition-by-partition. Mount one of the new
partitions at some mount point and copy the data from the old to the
new. The main trick is to use the "-ax" options on the copy commands.
These options cause the copy to...

        not follow symlinks (copy the link as a link -- don't copy the
        linked-to file.

        preserve original files' ownerships, permissions, etc.

        recursively copy subdirectories

        *not* recursively copy subdirectories that are mounts of other
        filesystems (e.g. proc!)

So for example if you originally have the following partitions:

        /dev/hda1       /
        /dev/hda2       swap
        /dev/hda3       /boot
        /dev/hda4       /home

Do the following:

        1. Make a similar partitioning scheme on the new hard drive
        (e.g. /dev/hdb).

        2. Use mkswap to create the new swapper.

        3. Mount and copy the other file systems. For example:

                mount /dev/hdb1 /mnt
                cp -ax /* /mnt/
                umount /mnt
                mount /dev/hdb3 /mnt
                cp -ax /boot/* /mnt/
                umount /mnt
                mount /dev/hdb4 /mnt
                cp -ax /home/* /mnt/
                umount /mnt

        4. Fix up the new fstab to point to the new partitions.

        5. Fix up either lilo.conf or grub.conf (on the new drive). You
        may need to look up how to configure whichever of these you are
        using. Now comes the tricky part -- you need to install the
        lilo/grub boot loader. The simplest way may be to use chroot.
        Here is an example for grub:

                mount /dev/hdb1 /mnt
                mount /dev/hdb3 /mnt/boot
                chroot /mnt
                grub-install

        Both lilo and grub have command line options that do the
        equivalent of the chroot for you. I routinely use this with
        lilo, but for some reason feel more comfortable with the chroot
        when using grub -- don't know why.

WARNING!!! Although I have done the above successfully several times,
the above steps are from memory and may be a little off. Read the man
pages!

Others recommend other techiques using things like cpio/tar.

-- 
Robert C. Paulsen, Jr.
[EMAIL PROTECTED]


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to