[KLUG Members] Re: Members digest, Vol 1 #273 - 2 msgs

Bryan J. Smith members@kalamazoolinux.org
Wed, 09 Jan 2002 13:52:10 -0500


Larry Kopenkoskey wrote:
> I would like to purchase a new hard drive (20 - 40 GB)
> physically install it in his computer, and copy the
> contents from his old hard drive (~8 GB) to the new one.

Maxtor 60GB, 5400rpm drives are the "best buy per GB" right now for
under $90 on-line.

> Are the following steps viable:
> 1) FDISK and format the drive under windows.

Dual-booting on drives >33.8GB can get tricky.  Especially with Windows
9x/ME interpreting things differently (usually based on the BIOS) where
as Linux bypasses the BIOS (2000/XP do much better, and usually don't
take issue with Linux fdisk partitioned drives).  If you know the
geometry that Windows will see, then you can feed that to Linux's fdisk
(under eXpert mode).  Otherwise, I install Windows first, although there
is a caveat.

For Windows 9x/ME, I boot the 9x/ME CD, but not into the installer.  I
just get to a command-line, and then run fdisk.  I create a 24-30GB
drive, something under the 32GB "barrier" that most BIOSes interpret
differently (especially when running 9x/ME), leaving 1-2GB for a Linux /
(root).  I don't install Windows just yet, because I boot a Linux
installer just to partition the rest.

I want to make sure that installing Windows won't dork up the partition
table before I spend any more time.  To further check this, I'll boot
the Windows Rescue Floppy/CD and run "format c: /s" (it's in the ./win9x
directory on the CD).  Sometimes it dorks up the partition table (stupid
MS-DOS 7.x!).

> 2) Boot from a rescue floppy disk or cdrom.
> 3) Mark the new drive as bootable using linux fdisk.

Why not do that when you Windows partition?  Even if the partition is
marked "bootable" (aka "active"), its just a "dumb flag" that
Microsoft's MBR looks at.  So if it's not on BIOS disk 0x80 (i.e. the
first hard drive the BIOS sees), it is ignored.  So you _can_ have it
set on multiple drives.

> 4) Mount both drives under linux.
> 5) Use 'cp -a' to move the contents of the old HD to
> the new HD.

This works _much_better_:
   cd /mnt/oldfat
   find . -mount -print | cpio -pmdv /mnt/newfat

It doesn't matter too much with Windows/FAT, but it is the _only_way_ to
guarantee _all_ UNIX meta-data is preserved (for NTFS too???).  This
works _perfectly_ for all my Linux copying too (note the -mount option,
do this for each source filesystem).

> 6) Copy the boot sector from the old HD to the new HD;
>    example: dd if=/dev/hda of=/dev/hdd bs=512 count=1

Yepper.  Although that only works for Windows 9x/ME.  I haven't found a
reliable way to copy NT/2000/XP bootstraps.  Anyone?

BTW, it's also a "safe move" to copy "io.sys" _right_afterwards_ (but
before you do the above find|copy to copy all other files).  I don't
think MS-DOS 7.x requires it be first in the FAT allocation table
anymore, but it can't hurt.

> 7) Jumper the new HD as the primary HD, remove the old HD.

Er, don't jumper.  Put the new HD on the _secondary_ IDE.  Most ATA
controllers don't perform well copying between master/slave.

> 8) Boot Windows

If you haven't installed Linux (or Windows) yet, you'll need an MBR. 
Either run "fdisk /mbr" from your 9x/ME CD, or run LILO from your Linux
CD/rescue.

> Has anyone done something like this?

All the time.

> Am I missing any steps?

Not so much steps, just lots of details, options and issues.

-- Bryan

-- 
Bryan J. Smith, Engineer        mailto:b.j.smith@ieee.org   
AbsoluteValue Systems, Inc.     http://www.linux-wlan.org
SmithConcepts, Inc.          http://www.SmithConcepts.com