<quote who="Voytek Eymont">
> I'd like to transfer the whole thing to another drive, a 6GB IDE
>
> if I plug the 2nd HD into the system,
>
> how do I 'xcopy /dev/hda /dev/hdb' ?
First, shift the second drive onto the secondary IDE bus so it appears as
hdc instead of hdb. That will be a hell of a lot faster than copying from
the master to the slave on the same bus. :-)
Start your machine and type 'linux single' at the LILO prompt. This will
boot you into single user mode, which makes life much easier (no daemons
and such hanging around, writing to the drive, etc).
Partition (cfdisk) and format (mkfs.ext2 or whichever filesytem you prefer)
the second disk. Mount it under /mnt.
Use cp -a to copy files from the partitions on the first drive to the ones
on the second. I generally just use a single partition on my desktop
machines, so it's easy as:
cp -ax / /mnt/
The x stops cp traversing other filesystems (such as /mnt/, which is where
your second disk is mounted -> it would recursively copy everything if it
kept going into /mnt/).
Then you'll need to swap the drives, and re-LILO the new drive so it will
boot correctly.
> and, how do I image & un-image the entire /dev/hda ?
Imaging is a bit different, and I didn't explain it above because you
mentioned that you had two disks of differing size. If you end up creating a
partition on your new disk that is exactly the same size as one on your old
disk, you can do this:
dd if=/dev/hda2 of=/dev/hdc2 bs=8M
This 'disk duplicates' the second partition on the first disk to the second
partition on the second disk (using an 8M block size, which makes it
faster). You can duplicate the entire disk, but because they're different
sizes, it won't help you much (it copies the entire partition structure,
everything). Here's how you'd do it for disks that were the same size:
dd if=/dev/hda of=/dev/hdc bs=8M
This won't be useful in your situation.
> any reason why I shouldn't do it ('xcopy' and image) on a in-use system ?
Yeah (explained above), but if you boot into single user mode, it's
generally okay. You could boot with a recovery CD like LNX-BBC, but I
wouldn't bother.
- Jeff
--
GDK (acronym): GNU's Not Unix Image Manipulation Program Tool-Kit
Drawing-Kit.
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug