intertwingly

It’s just data

Preparing for Dual Boot


Now that I am comfortable with Ubuntu on my borrowed hard drive, thoughts turn to the endgame.  What I want to do is to reinstall Windows XP from the predesktop area, shrink the partition significantly, and then set up a dual boot arrangement.  Note: at no time do I plan on running this version of Windows XP on any system other than the one for which it is licensed.

The thoughts of reinstalling are scary, but combining predesktop area and offline backups is giving me the confidence to explore.  All of this is made possible by virtue of having access to a live CD.

First, I copy the area to another machine:

# fdisk -l /dev/hda
 
Disk /dev/hda: 80.0 GB, 80026361856 bytes
240 heads, 63 sectors/track, 10337 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        9928    75055648+   7  HPFS/NTFS
 
# dd if=/dev/hda bs=7741440 skip=9928 | ssh 192.168.1.100 dd of=/home/rubys/hidden.img
Password:
409+1 records in
409+1 records out
3169345536 bytes transferred in 490.754376 seconds (6458110 bytes/sec)
6189989+305 records in
6190128+0 records out
3169345536 bytes transferred in 482.220468 seconds (6572399 bytes/sec)

Now I write a small script to automate my scanning of the image:

import os
image=open('hidden.img')
sectors=os.stat('hidden.img').st_size/512
start=part=0
 
for i in range(0,sectors):
  sector=image.read(512)
  if sector[3:10]=="IBM  7.":
    if part:
      print "dd if=hidden.img of=hidden%d.img bs=512 skip=%d count=%d" % (
        part, start, i-start)
    part=part+1
    start=i

Here’s the output produced:

dd if=hidden.img of=hidden1.img bs=512 skip=3362 count=15063
dd if=hidden.img of=hidden2.img bs=512 skip=18425 count=15060
dd if=hidden.img of=hidden3.img bs=512 skip=33485 count=6
dd if=hidden.img of=hidden4.img bs=512 skip=33491 count=5946062
dd if=hidden.img of=hidden5.img bs=512 skip=5979553 count=1243

Note hidden4 is actually a false match, better results are obtained by combining the hidden3 and hidden4 images:

Filesystem           1K-blocks      Used Available Use% Mounted on
/home/rubys/hidden1.img
                          7504      7504         0 100% /home/rubys/mp1
/home/rubys/hidden2.img
                          7504      7504         0 100% /home/rubys/mp2
/home/rubys/hidden3a.img
                       2940270   2709308    230962  93% /home/rubys/mp3
/home/rubys/hidden5.img
                          1424       882       542  62% /home/rubys/mp5

And here is the file systems on each:

# ls mp1
autoexec.bat  finddrv.bat   plnrchk.bat  tpdiag2.exe  tpplgd5.exe  tpplgw4.exe
command.com   ibmbio.com    rexx.exe     tpplga4.exe  tpplgm2.exe  tpplgw5.exe
config.sys    ibmdos.com    rxdinfo.rx   tpplga6.exe  tpplgt1.exe  tptools
dos           launchit.bat  subst.exe    tpplgd3.exe  tpplgw2.exe  version.id
filler.txt    pcycle.exe    tpdiag.exe   tpplgd4.exe  tpplgw3.exe

# ls mp2
autoexec.bat  disk_02.exe  finddrv.bat  ibmdos.com    rexx.exe    zapflop.com
command.com   disk_03.exe  format.com   launchit.bat  rxdinfo.rx
config.sys    disk_04.exe  himem.sys    pcycle.exe    scri
disk_01.exe   filler.txt   ibmbio.com   ramdrive.sys  subst.exe

# ls mp3
bootcat.bin  bootimg.bin  country  ibmwork  recovery

# ls mp5
InstChek.exe  chmod.exe     getuuid.exe   pcr_rest.bat  rxdinfo.rx
Subst.exe     command.com   himem.sys     pcr_rest.exe  setram.bat
anykey.exe    config.sys    ibmbio.com    pcrec.ini     spcopy.bat
autoexec.bat  copyhd.exe    ibmdos.com    psautil.exe   spvol.exe
autoexec.bbb  cwsdpmi.exe   image.exe     ramdrive.sys  uninst.exe
autoexec.ccc  dsr_init.bat  lastboot.exe  rbmsg.exe     xpshell.exe
bmgr.exe      dsr_init.exe  mgr.dat       reboot.exe
boot12.dat    finddrv.bat   param.y       recrtsp.exe
boot32.dat    finddrv.rex   part411.exe   rexx.exe

At this point, my results don’t exactly match Fabrice’s.  I have fewer partitions and partition 3a doesn’t have any executables in the recovery directory.  I’ll email him and ask for advice before proceeding.