Plug in the new drive as well as the old one.
I assume the new drive will be /dev/sdc. And I assume you are running
RedHat 6.2 with LILO.
If you statically set the IDs on your disks, just make sure that the
new disk has a higher ID than the two others, then it will be /dev/sdc.
>
> I know if I reboot and replace the HDD, it will give problem while
> booting, any Idea to struggle with this?
# Create partitions on the new disk
sfdisk -d /dev/sda | sfdisk /dev/sdc
# Create filesystems
mke2fs /dev/sdc1
mke2fs /dev/sdc5
mke2fs /dev/sdc6
mke2fs /dev/sdc7
# Mount new filesystems
mkdir /mnt/boot
mount /dev/sdc1 /mnt/boot
mkdir /mnt/home
mount /dev/sdc5 /mnt/home
mkdir /mnt/www
mount /dev/sdc6 /mnt/www
mkdir /mnt/software
mount /dev/sdc7 /mnt/software
# Copy the boot filesystem
umask 0
tar cf - /boot | tar xCfp /mnt -
# Now, edit /etc/lilo.conf so that it
# contains something like:
boot=/dev/sdc
disk=0x80
map=/mnt/boot/map
# The boot and map lines are to be replaced, the
# disk line is to be inserted.
# Make the disk bootable - if this command
# complains, then I've overlooked something.
# Mail me back with the error message
lilo
# Now copy the other filesystems. Note, these
# copy commands may fail horribly when you run
# into the bad blocks !!! Don't worry, you have
# a backup...
tar cf - /home | tar xCfp /mnt -
tar cf - /www | tar xCfp /mnt -
tar cf - /software | tar xCfp /mnt -
# Now, your box may have died during the copying,
# or it may still be more or less alive. We
# don't care, it's time to lose the old drive.
# Now, power down, and unplug /dev/sda
# Move /dev/sdc so that it will be recognized as
# /dev/sda on boot.
That should be it ! (in theory at least)
You probably want to change back your lilo.conf, and
check the files you (possibly) copied from the broken
disk.
-- ................................................................ : jakob@unthought.net : And I see the elder races, : :.........................: putrid forms of man : : Jakob Østergaard : See him rise and claim the earth, : : OZ9ABN : his downfall is at hand. : :.........................:............{Konkhra}...............: - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/