[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: hd to hd copy?



tf wrote:
> 
> hey guys,
> 
> I might put in a 6 gig drive in place of the 1.6 gig drive I'm using
> now.  My current installation works fine (its me thats "broken"!). is
> there a way that I can copy this hd to the new one?  I only have a swap
> and a root partition on this drive, and will probably want to partion
> the 6 gig drive further...
> 
> or should I just bite the bullet, and do a fresh install?  (I am getting
> some good practice....)

I was surprised by all the responses to this - I've done it a few times
without problems.

Get your rescue floppy disk out and keep it handy. Connect the new hard disk
somewhere on your machine somwhere other than /dev/hda. Run fdisk on it and
create the partition structure you want. Make the appropriate partition
bootable (first, generally). Reboot - its safer to always reboot after
running fdisk. Make the file systems. If any are large, make the swaps first
and "swapon" by hand as mke2fs eats memory. Mount your nominated root
partiton as /mnt. Go there. Create any directories where you will mount
other partitions on the same drive. Mount those other partitions. Create the
proc, mnt, tmp and cdrom directories too. Then from /mnt try something like
# ( cd / ; tar cf - bin boot dev lib sbin usr var ) | tar xf -
This takes a while.
(If your linux image is lying around in / instead of being in /boot, you
need to copy that too.)
Change your future /etc/fstab (currently /mnt/etc/fstab) to mention your new
partitions, all relative to /dev/hda. Shut down. Reconnect the new disk as
/dev/hda, boot using the rescue floppy; rescue root=/dev/hda, run lilo,
shutdown, eject the floppy, boot.

However, a reinstall will probably bring less crud with it.

Andrew

http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=45690


Reply to: