Re: Duplicating a disk

"jdow" <[email protected]>
Newsgroups gmane.linux.redhat.release.enigma
Message-ID <[email protected]>
Um, it sounds like you don't want to duplicate a disk so much as migrate to
a new, larger disk. I'll presume this is the situation, otherwise a simple
"dd if=/dev/hda of=/dev/hdb" when booted from the install CDROM would
suffice to create an exact duplicate, regardless of OSs involved, too.
(Although I have, in the past, found it was safest to use several "dd"
sessions to copy disks, particularly SCSI disks. On many manufacturer's
SCSI disks writing to more than one block at block zero is "fatal" You
must low level format to recover. Fortunately "dd" has means of handling
these needs. "man dd" is your friend in that case.)

Suppose hda is your source disk with several partitions and hdb is your
destination disk with a slightly different partitioning structure. Again,
it is best to work from the install CDROM (or "telinit 1" mode) rather
than on a live active system. I mount the source file structure one
section at a time. And I do much the same for the destination file
structure. Then as I mount say hda's /var to /1 and hdb's /var to /2
I perform a "cp -a /1 /2", sit back, and relax. Then I dismount /var
on both drives and work on say /home. I found it easiest to keep track
of what I am doing if I work from the "inside out". That is to say if
/usr/local/large is a separate partition I copy it first, then /usr/local
if it has its own partition, and finally /usr. The last thing I copy is
generally the two disk's root partitions. Of course, when copying the /
structure it may pay to copy much of it individually with / still
mounted as /. "cp -a /etc /1" to copy over the /etc contents, and so
forth. Skipping /proc is probably a good thing. {^_-}

The chief reason I work in this order is that my mind goes numb watching
paint dry er partitions copy and its easier to remember what I am doing.

Then before I swap the disks around and reboot I "cheat fate". I use
a /2 mountpoint to mount the entire (former) /dev/hda file system
in the newly created /dev/hdb's /etc/fstab structure using the NEW
intended /dev/hda and /dev/hdb references, of course. Then I swap
A and B on the cable (I use cable select on drives these days) and
boot. Having the original present is a boon when you discover some
critical file was not copied over for some silly reason.

{^_^}
----- Original Message ----- 
From: "Phil" <[email protected]>

> Hi All,
>   Does anybody know if it's possible and if so how difficult it is to
> duplicate the hard drive? I want to switch over to a larger disk on my
> system and I guess copy all my partitions from the 3 disks I have now onto
> one bigger disk.
>   I guess the hardest thing is to get the boot, root, var and tmp so the
new
> disk will bootup by itself and just copy the other partitions with the cp
> command.
>   It wouldn't hurt to have a backup disk either.
>
>   Another thing I was thinking was just installing RH 8 on the new disk
and
> mounting the 7.2 disk for archive purposes. Can I do that? HAving a RH8
boot
> disk and mount my 7.2 disks and just copy their data to the 8.0 disk?
>
>  Thanks in advance.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.