Subject: Re: OT: copying a WinXP disk
To: None <port-i386@netbsd.org>
From: David Lord <david@lordynet.org>
List: port-i386
Date: 12/17/2006 22:21:27
On 17 Dec 2006, at 0:27, Steven M. Bellovin wrote:

> I'm going through the usual pain trying to upgrade my laptop.  Copying
> NetBSD worked flawlessly (of course), but I'm having a lot of trouble
> trying to get Windows copied over.  A simple image copy (from NetBSD) of
> the partition wouldn't finish booting, even though the BIOS geometry is
> the same.  Partition Magic appeared to work, but some essential service
> crapped out during initialization (SVC mumble, XYZZY is a Pure Virtual
> Function, or some such, so no windows would open); besides, Partition
> Magic gets very concerned that some partitions have a different
> geometry.  I believe that -- after zeroing the first 8K blocks of the
> disk, I get:
> 
> # fdisk wd1
> fdisk: primary partition table invalid, no magic in sector 0
> Disk: /dev/rwd1d
> NetBSD disklabel disk geometry:
> cylinders: 193821, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
> total sectors: 195371568
> 
> BIOS disk geometry:
> cylinders: 1023, heads: 240, sectors/track: 63 (15120 sectors/cylinder)
> total sectors: 195371568
> 
> OTOH, wd0 also shows different geometries, without apparent trouble for
> the last two years:
> 
> # fdisk wd0
> Disk: /dev/rwd0d
> NetBSD disklabel disk geometry:
> cylinders: 116280, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
> total sectors: 117210240
> 
> BIOS disk geometry:
> cylinders: 1023, heads: 240, sectors/track: 63 (15120 sectors/cylinder)
> total sectors: 117210240
> 
> I could simply try Select All/Copy/Paste, but I have no idea then how
> to make the partition bootable into XP.
> 
> I'm on the verge of simply reinstalling Windows on the new drive, using
> the recovery disks; while there's not much application software (and no
> application data...) on that partition, I don't really feel like
> spending the time downloading \aleph_0 critical security patches.
> 
> Any suggestions?

A few weeks ago I replaced a 30 GB hdd of a Celeron 2800 notebook 
with one of 80 GB. I couldn't face a possible reinstall of XP due to 
pain I had previously with SP2 update and all of setting up of apps.

An image copy of partition wasn't wanted as I was increasing size 
given to XP and also was using bsd fdisk partition 2 rather than 
partition 3 on the 30 GB hdd. I used a floppy boot install with 
Novell dos7 to create first partition. I hid that partition using a 
Linux rip cd. After several failed attempts at getting XP, Ubuntu and 
NetBSD to coexist I finished up with DOS and NetBSD in place and used 
XP cd boot to create extended partition 1 and XP partition 2 which 
was formatted NTFS in the process. I'd earlier downloaded eval 
Acronis TrueImage and backed up XP to a server but restored partition 
wasn't bootable. This last time I had the extra information needed. 
From XP cd boot use 'bootcfg' command to change the boot.ini file to 
point to the different partition 2 instead of 3. I could probably 
have done so from NetBSD or Linux but was pretty pissed off with the 
process by then. That was almost it and I installed Lilo as soon as I 
had Ubuntu installed. I'm not familiar with Grub but suspect that 
would have been a better choice as update of Ubuntu often sneaks in a 
new kernel which is then unbootable as it requires Lilo to be 
reinstalled.

I then had even more trouble when attempting to use the 30 GB hdd to 
upgrade a Dell Inspiron Celeron 366. I didn't realise the bios would 
not accept the 255 head geometry and consistently caused some 
utilities to use 240 heads whilst others picked up the 255 heads from 
the mbr. I gave in to this and reinstalled 240 head partitioning, 0: 
DOS7, 1: extended with Ubuntu , 2: Win98 and 3: NetBSD. Dos7 isn't 
yet bootable due to geometry change and having no bootable media (no 
fdd), Ubuntu lacks chipset graphics sound and touchpad support so is 
very slow, Win98 is fully functional but still needs all updates to 
be installed, and NetBSD 4.0-beta2 has reasonable graphics speed 
(78fps from glxgears), audio works ok, cardbus networking is broken, 
and I'm in process of seeing if there any show stoppers with non 
functional packages. I've had several fail to compile and another few 
fail to run or hang the system. I've installed 248 so far and another 
110 to go.

David

# fdisk
Disk: /dev/rwd0d
NetBSD disklabel disk geometry:
cylinders: 155061, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 156301488

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 156301488

Partition table:
0: OS/2 BM: hidden DOS 16-bit FAT >=32M (sysid 22)
    start 63, size 2024127 (988 MB, Cyls 0-126)
1: Extended partition (sysid 5)
    start 2024190, size 74172105 (36217 MB, Cyls 126-4743)
2: OS/2 BM: hidden IFS (sysid 23)
    start 76196295, size 32033610 (15641 MB, Cyls 4743-6737), Active
3: NetBSD (sysid 169)
    start 108229905, size 48066480 (23470 MB, Cyls 6737-9729)
Extended partition table:
E0: Primary 'big' DOS, 16-bit FAT (> 32MB) (sysid 6)
    start 2024253, size 2088387 (1020 MB, Cyls 126-256)
E1: Primary 'big' DOS, 16-bit FAT (> 32MB) (sysid 6)
    start 4112703, size 1044162 (510 MB, Cyls 256-321)
E2: Linux native (sysid 131)
    start 5156928, size 128457 (63 MB, Cyls 321-329)
E3: Linux native (sysid 131)
    start 5285448, size 128457 (63 MB, Cyls 329-337)
E4: Linux native (sysid 131)
    start 5413968, size 4192902 (2047 MB, Cyls 337-598)
E5: Linux swap or Prime or Solaris (sysid 130)
    start 9606933, size 2088387 (1020 MB, Cyls 598-728)
E6: Linux native (sysid 131)
    start 11695383, size 46122552 (22521 MB, Cyls 728-3599)
E7: Primary DOS with 32 bit FAT - LBA (sysid 12)
    start 57817998, size 16771797 (8189 MB, Cyls 3599-4643)
E8: Primary DOS with 32 bit FAT - LBA (sysid 12)
    start 74589858, size 1606437 (784 MB, Cyls 4643-4743)

# disklabel wd0a
# /dev/rwd0a:
type: unknown
disk: WDC WD800UE-22H
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 155061
total sectors: 156301488
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:    374976 108229905     4.2BSD   1024  8192 37504  # (Cyl. 107370*- 107742*)
 b:   1573488 108604881       swap                     # (Cyl. 107742*- 109303*)
 c:  48066480 108229905     unused      0     0        # (Cyl. 107370*- 155055*)
 d: 156301488         0     unused      0     0        # (Cyl.      0 - 155060)
 e:   2024127        63      MSDOS                     # (Cyl.      0*-   2008*)
 f:  32033610  76196295       NTFS                     # (Cyl.  75591*- 107370*)
 g:   2088387   2024253      MSDOS                     # (Cyl.   2008*-   4079)
 h:   1044162   4112703      MSDOS                     # (Cyl.   4080*-   5115*)
 i:  16771797  57817998      MSDOS                     # (Cyl.  57359*-  73997*)
 j:   4192902   5413968 Linux Ext2      0     0        # (Cyl.   5371 -   9530*)
 k:  46122552  11695383 Linux Ext2      0     0        # (Cyl.  11602*-  57359*)
 l:   1571472 110178432     4.2BSD   1024  8192 46224  # (Cyl. 109304 - 110862)
 m:  35958384 111749904     4.2BSD   2048 16384 28112  # (Cyl. 110863 - 146535)
 n:   8588097 147708288     4.2BSD   1024  8192 46176  # (Cyl. 146536 - 155055*)

# /etc/fstab
/dev/wd0a / ffs rw 1 1
/dev/wd0b none swap sw 0 0
/dev/wd0m /var ffs rw,softdep 1 2
/dev/wd0l /var/tmp ffs rw,softdep 1 2
/dev/wd0n /usr ffs rw,softdep 1 2
kernfs /kern kernfs rw
procfs /proc procfs rw,noauto
/dev/wd0e /mnt_l/wd0e_nd7_c    msdos rw 0 0
/dev/wd0f /mnt_l/wd0f_winxp_c  ntfs ro 0 0
/dev/wd0g /mnt_l/wd0g_dos_d    msdos rw 0 0
/dev/wd0h /mnt_l/wd0h_dos_e    msdos rw 0 0
/dev/wd0i /mnt_l/wd0i_vfat_f   msdos rw 0 0
/dev/wd0j /mnt_l/wd0j_rsq      ext2fs ro 0 0
/dev/wd0k /mnt_l/wd0k_ubuntu   ext2fs ro 0 0
/dev/cd0a /mnt_l/cd0a_cdrom    cd9660  rw,noauto 0 0