The Home Page of 
C. LeBlanc

Linux & Windows 2000 Dual Boot Lab

Like many people, I run my home x86 PC on Linux. However, there sometimes exists a need to run certain programs on the Microsoft Windows platform (games, office suites, certain proprietary media formats, etc.). For this reason I have created a capability to boot my PC either into Linux by default or optionally into Windows 2000 Professional.

Over time, unlike Linux, the Windows 2000 operating system can suffer from well known performance degradation issues, viruses, accumulation of unwanted data, overwriting of important files, and other such troubles. Installation of programs (especially such malicious programs of the "spyware" type, surreptitiously downloaded and installed from the Internet) can cause great problems.

This lab will describe how to first create a dual boot environment for Linux and W2K (Windows 2000), and then how to completely backup the W2K environment in its ideal state. With this pristine archive, it is possible to restore the W2K environment to that state at will, while also possibly improving W2K performance. To keep things simple, we will use a commonly available Linux distribution. Due to differences in particular interfaces and tools amongst Linux distributions, I have had to somewhat necessarily gloss over some specific details.

Commercial programs such as Norton Ghost are indeed available to backup and restore W2K environments, but this lab offers similar and additional benefits at no cost to non-commercial users.

You will need the following:

  • a PC (NOTE: all previous OS, disk partitioning, or data will be completely overwritten)
  • the installation media for your favourite modern Linux distribution
  • the installation media for Windows 2000
  • two unused diskettes
  • a second PC running Windows 95/98 with Internet connectivity (this PC will not be changed by this lab in any way)

Getting Started with Clean OS Installations

In this lab we will first perform a clean installation of both Linux and W2K, overwriting any previous OS or data on the disk(s).

  • insert Linux installation CD (and diskette if needed) and reboot
  • install Linux:
    • create Linux partition(s) using provided interface or tool
    • create and format a separate FAT32 partition for W2K to use
      • Linux presently cannot properly mount an NTFS file system, so FAT32 must be used
      • be aware that FAT32 is not suitable for partitions of over 50GB
      • future Linux kernels will be able to properly mount an NTFS file system

    • Example of partitioning an 18GB hard disk during Linux installation:
      • first primary partition is assigned as swap space and gets 512MB using Linux Swap
      • second primary partition is assigned to / (root file system) and gets 4GB using reiserfs
      • third primary partition is assigned to /home and gets 10GB using reiserfs
      • fourth primary partition is assigned to /c and gets 3.5GB using FAT32

  • if prompted to select a boot loader program during the installation, select LILO
  • create a Linux emergency boot diskette when prompted to do so during the installation
  • on completion of installation, run three tests:
    • ability to boot into Linux using LILO
    • ability to boot into Linux using emergency boot diskette
    • presence of a Windows option at the LILO prompt or interface (of course it will fail since there is no W2K OS at this point)
      • if not, consult LILO documentation on editing the lilo.conf file on how to add a Windows FAT32 entry
  • insert the W2K installation Diskette 1 and CD, then reboot
  • install W2K into the previously created FAT32 partition
  • load and configure all Windows 2000 apps, updates, anti-virus, etc.
  • completely personalize and customize the entire W2K environment to your liking
  • reboot into Linux
    • if the W2K installation has removed the LILO boot loader program and you are unable to boot into Linux:
      • use the Linux emergency boot diskette to boot into Linux
      • restore LILO (as root) with this command:

          lilo -v

      • test ability to boot into Linux
  • completely personalize and customize the entire Linux environment to your liking
  • leave the PC booted into Linux for the next lab

Congratulations, you can now boot into your Linux or your Windows 2000 environment.

Creating a Custom Windows 2000 Emergency Restore Diskette with Linux and Windows 9X

The purpose of this ERD (Emergency Restore Diskette) is to boot the system into a temporary Windows 9X environment and install critical W2K boot files into a reformatted partition, thus preparing it for the Linux-based restoration process discussed in a lab further below.

In this lab it will be necessary to build our custom ERD out of non-traditional tools:

  • insert an unused diskette into the Windows 9X PC
  • format the diskette and transfer the Windows 9X system files to it:

      format a:
      sys a:

  • copy the Windows format program to the diskette:

      copy c:\windows\command\ a:

  • download/unzip the free (to non-commercial users) XXCOPY.ZIP program into the c:\windows\temp directory (program info at the XXCopy web site)
  • download/unzip the free BOOTPA22.ZIP program into the c:\windows\temp directory (program info at the Bootpart web site)
  • copy two important files to the diskette:

      copy c:\windows\temp\XXCOPY16.EXE a:
      copy c:\windows\temp\BOOTPART.EXE a:

  • Edit a new file on the diskette called ntboot.bat and put the following into it exactly as this appears (spacing is critical)

      @ECHO OFF
      XXCOPY16 NTLDR          C:\   /H
      XXCOPY16 NTDETECT.COM   C:\   /H
      XXCOPY16 BOOT.INI       C:\

    • Optional:
      • Edit a new file on the diskette called autoexec.bat and put the following into it:

          @ECHO OFF
          set temp=c:\
          set tmp=c:\

      • Edit a new file on the diskette called config.sys and put the following into it:


  • remove the diskette from the Windows 9X PC
  • insert it into the Linux-booted PC
  • some Linux distributions will automatically mount the diskette into the Linux file system
    • usually found under /mnt/floppy
    • if not automatically mounted, run this command to mount it under the Linux file system:

        mkdir /floppy
        mount -t vfat -o iocharset=iso8859-1,umask=0,codepage=850 /dev/fd0 /floppy

  • copy three critical W2K boot files from the W2K partition onto the diskette:

      cd /c
      cp ntldr boot.ini /floppy

Congratulations, you have created a custom W2K Emergency Restore Diskette. It will be used in a following lab, but this diskette should also be placed in a safe location for future recovery purposes.

How to Completely Backup the Windows 2000 Environment

In this lab we will create an "ideal", pristine W2K environment, store it safely away for future use, then restore from it as needed. As a side benefit, we will also add a W2K performance-enhancing feature.
  • boot into Linux
  • login as root superuser
  • if the installation process above has not already insured that the W2K FAT32 partition will be mounted into the Linux file system at each Linux bootup, mount it using one of these steps:
    • Permanent (always available) access:
      • add a line like this to the /etc/fstab file to make it available under the Linux /c directory at every bootup:

          /dev/hda4 /c vfat iocharset=iso8859-1,umask=0,codepage=850 0 0

    • Temporary (as needed) access:
      • run this command to mount it under the Linux /c directory: (this method does not make the W2K FAT32 partition available at every Linux bootup)

          mount -t vfat -o iocharset=iso8859-1,umask=0,codepage=850 /dev/hda4 /c

  • on the Linux command line, tar the W2K partition for safekeeping
    • Storing into a Linux directory:
      • determine which Linux partition is large enough to store the W2K contents:

          df -k

      • in the case of the installation above, we would archive the W2K directory into the /home directory

          tar cvf /home/c.tar /c

    • Storing onto tape:

        tar cvf /dev/st0 /c

    • Optional:
      • The Linux tar command can be directed to store specific files and/or directories in the order of your choice:

          tar cvf /home/c.tar /c/pagefile.sys /c/winnt /c/"Program Files" (specify remaining contents here)

      • Thus, when we extract the W2K archive in the future into an empty partition, the most performance-sensitive files and directories will therefore be placed first into the part of that disk partition with the fastest electromechanical access
Congratulations, you have archived your ideal W2K environment for future recovery.

How to Completely Restore the Windows 2000 Environment

In the future, a corrupted or sluggish W2K environment can be totally restored to its ideal state in just a few minutes. If you opted to have Linux tar save W2K's pagefile.sys file first and other files and directories in a specific order, this will extract the swap file first, therefore placing it onto the fastest part of the partition, followed by the other items you specified, in that order. Your W2K performance will thus be improved, and the entire extraction process will also serve to defragment the W2K partition, giving an additional performance benefit.

To restore your ideal W2K environment, take the following steps:

  • boot into Linux
  • make sure that the W2K partition is not presently mounted
    • if it is, you must unmount it:

        cd /
        umount /c

  • use Linux to reformat the W2K FAT32 partition
    • Most modern Linux distributions have an easy to use GUI that will do this
    • if not, use the mkfs.vfat tool:

        mkfs.vfat /dev/hda4

    • if neither means are available, skip to the next step
  • insert the Emergency Restore Diskette and reboot the PC
    • if you were unable to reformat the W2K partition using Linux, you can now use the much, much slower Windows 9X format program to do that:

        format c:
  • restore the critical, hidden boot files onto the reformatted W2K partition using the ntboot.bat batch file:


  • remove the diskette and reboot into Linux
  • make sure that the W2K partition is mounted into the Linux file system

      df -k

  • untar the W2K archive onto the W2K partition

      cd /c
      tar xvf /home/c.tar

  • reboot into W2K
Congratulations, you will see that you have restored your ideal W2K environment.

Copyright © 2002 by Jon C. LeBlanc

This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at
Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder.

Click Here to jump to my Custom Solaris and UNIX/Linux System Administration Labs web page.