1. Mount the new hard drive into the computer as the primary EIDE
master
2. Step 1 requires the original hard drive (which is to be cloned) be
moved to slave on the primary IDE, or master or slave on the secondar
IDE (depending on what's available, since this procedure will use the
CD drive).
3. Boot the Fedora Core Linux box from the Disk 1 of the install in
"rescue mode". This is accomplished by typing "linux rescue" at the
boot loader prompt of the Disk1 CD, where you might normally type
"text" or hit enter or just stare at the pretty screen until it goes
away.
4. Once booted in rescue mode, you can either let the Fedora Core
rescue mode mount the hard drive partitions, but doing it yourself is
the safest way:
# these steps require you to have the new hard drive partitioned
# see the partitioning section below if you need to know how to do this
#
cd /mnt
#
mkdir a
#
# /dev/hda1 is the blank root partition of the new hard drive
#
mount /dev/hda1 /mnt/a
#
mkdir b
#
# /dev/hdd1 is the root partition of the original hard drive
#
mount /dev/hdd1 /mnt/b
#
#
#
# copy the files
#
cp -rp /mnt/b /mnt/a
#
# Another way to do this is a long tar command line:
# (cd /mnt/b; tar cvplf - --atime-preserve --same-owner *) | (cd
/mnt/b; tar xplf - --atime-preserve --same-owner)
#
#
# make the label of the old hard drive the same as for the new hard
drive
#
e2label /dev/hdd1
#
# output will probably be "/"
#
e2label /dev/hda1 /
# the last "/" slash above represents the output of the previous
command
# a different way to do the same two steps:
# e2label /dev/hda1 `e2label /dev/hdd1`
# this is a vital step getting the label right for the boot loader grub
#
#
#
grub-install --root-directory=/mnt/a --grub-shell=/mnt/b/sbin/grub
/dev/hda
# this grub-install command assumes that "/boot" is not a separate
partition from root "/"
################################ FDISK ################################
A quick word on partitioning with fdisk for those who do not know how.
(Why isn't disk druid available on the command line after install?)
Here's what it looks like:
# fdisk /dev/hda
The number of cylinders for this disk is set to 7297.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-7297, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-7297, default 7297):
+somesizedigitsM
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (4510-7297, default 4510):
Using default value 4510
Last cylinder or +size or +sizeM or +sizeK (4510-7297, default 7297):
Using default value 7297
# change partition 2 to swap type
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap / Solaris)
# activate bootable on partition 1
Command (m for help): a
Partition number (1-4): 1
Command (m for help): p
Disk /dev/hda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 7174 57625123+ 83 Linux
/dev/hda2 7175 7297 987997+ 82 Linux swap /
Solaris
Command (m for help): w
################################ FDISK ################################
Send me questions if you want. - Kevin, BSEE
Email to bachcottage "a t" gmail.com
aka topic Duplicating a Linux hard drive to a new hard drive
aka topic Duplicating a Linux hard drive to a replacement hard drive
aka topic Copying a Linux hard drive to a new hard drive
aka topic Copying a Linux hard drive to a replacement hard drive