On Fri, 14 Jul 2000, Link World wrote:

> Dear Mr. Till Kamppeter,
> 
> Your Solution appears fine for a networked environment. But How do I do a
> DiskCopy? In Windows, I set up a secondary master, format it, and use
> Diskcopy c: d: /e/c/q/h/r/y from dos box. The resulting disk when installed
> in the new system does not boot, so I set the bootable patron from Fdisk and
> the system is fully replicated. All program files & settings work. Is there
> any such DISKDUMP facility from hda to hdb in LINUX?

There are several different ways to do this.

If the partitions are the same size, the 'dd' command usually works best:

dd if=/dev/hda1 of=/dev/hdb1
dd if=/dev/hda2 of=/dev/hdb2

"if" means "in file" "of" means "out file", in this case the devices you
want to copy from/to.  There are several other options, see the "man
dd" command for more info.

Another way, much better for different size partitions, is to use "cp
-a /usr /mnt/disk" or "cp -av /usr /mnt/disk"  Throwing the "v" in causes
every file to be printed out as it is copied, possibly slowing things down
a bit depending on your display speed but shows you what's going on.  Keep
in mind that if a directory called "/usr" doesn't exist, it will be
created on your mount point.  If you don't want this, cd into the
directory you want to copy then do "cp -a . /mnt/disk/"  You can use the
"x" option to keep the cp on one file system if you are moving your
system, for example if you have /usr mounted on a separate filesystem from
/ and don't want to copy it all at once, "cp -avx / /mnt/disk/" would copy
everything residing on the / partition to /mnt/dsisk.  The important thing
here is that the mount points themselves will not be
created.../mnt/disk/usr or /mnt/disk/mnt/disk would have to be created in
order to have a working system afterward.

Another thing to be careful of is "cp -a / /mnt/disk"  You will recurse
into /mnt/disk and end up with /mnt/disk/mnt/disk/mnt/disk... ... until
the destination parttion runs out of space.

The last step in either process is to mount the root filesysem somewhere
and do  /mnt/disk/sbin/lilo -r /mnt/disk after changing
/mnt/disk/lilo.conf to update the boot line in lilo.conf.  The best thing
to do is make a boot floppy if you're physically changing anything...it's
a bit tricky getting lilo to work on hdb if you are going to move it to
hda, for example...it's better to setup a boot floppy with your new root
partition then run lilo once you've booted from there.

-dwild

Reply via email to