Duplicating disks

Richard van Hees (R.M.vanHees@fys.ruu.nl)
Mon, 11 Mar 1996 10:19:24 +0100


After some probably not very helpfull aswers, I will give it a try:

The first step is to let Linux detect your new disk!!! (see startup message)
- check all the disk parameters....
- decide how you want to use your disk, before you are going to use fdisk...
- create partitions on the disk (fdisk man-pages): required are the root
partition, but you probably also want to create a home, swap and /usr/local
partition. And these are only your Linux partitions (what about DOS, OS/2,
etc.)
- now you can start mounting these partition. I prefere to mount them one by
one, but it has the disadvantage that you can not use cp -a / /mnt, because
this would copy your whole disk to the root partition. The advantage is that
you can carefully select what to copy to your new root directory. I also
prefere not to copy the contents of /dev, but just copy MAKEDEV to /mnt/dev
and use this script to create the devices you really need.

An Example (just as a gide line!):
The partition table of your new disk
/dev/hdb1 100Mb (your new root partition)
/dev/hdb2 16Mb (your new swap partiton)
/dev/hdb3 150Mb (your new /usr/local partition)
/dev/hdb5 600Mb (your new home partition)

mount /dev/hdb1 as /mnt
cp -a /usr /mnt/.
rm -rf /mnt/usr/local
cp /sbin /mnt/.
cp /bin /mnt/.
cp -a /etc /mnt/.
cp -a /var /mnt/.
cd /mnt
mkdir /proc /dev /usr/local /home /mnt /floppy
<< give them the right permisions >>
cp /vmlinuz .
cd dev
cp /dev/MAKEDEV .
<< use MAKEDEV >>
cd /
umount
mount /dev/hdb3 as /mnt
umount
cp /usr/local /mnt/.
mount /dev/hdb5 as /mnt
cp /home /mnt
umount

NOTE THAT I JUST WRITE THIS DOWN SITTING BEHIND MY POWERMAC AT WORK, I CAN
NOT CHECK ANYTHING, BUT THIS IS MORE OR LESS THE WAY I DID IT.

Create your swap partition, see man-pages
I assume that you want to use your 1.2 GB disk as boot disk. Then this disk
will probably become your first disk. (not necessary, you can tell LILO to
boot LINUX from an other drive or you can use a boot floppy).

--> But what you MUST do is CAREFULLY CHECK /etc/fdisk on your boot disk!!!

--> AND NEVER NEVER NEVER distroy your data on your old disk before you kow
that you can boot from your new disk!!!

--> Also make boot floppys, as well for your old disk as for your new disk!!!
(see man-pages of rdev, or do rdev -?)
Did you change the boot partition of the kernel on you new disk?

I did change my old disk to my second drive and my new disk to my first drive.
Thus: rdev /mnt/vmlinuz /dev/hda1 (NOT /dev/hdb1)
same is true for /etc/fdisk

After booting from your new disk check all you links. Find can be very help
full.

I hope that this will help you...

Richard

-----
/==================================================================\
| Richard M. van Hees | email : R.M.vanHees@fys.ruu.nl |
| p/a IMAU | phone : +31 (0)30 2532291 |
| Princetonplein 5 | fax : +31 (0)30 2543164 |
| NL-3584 CC Utrecht | |
| The Netherlands | |
\==================================================================/