Configuring Multi-Boot Personal Computers
This document was originally written nearly ten years ago. For now I am reproducing it here without any significant updates. Most of what I have written still applies, although modern BIOSes no linger have the 2GB boot restriction nor do they seem to have any issues with booting from logical partitions.
One restriction I have encountered recently is that you must install Windows XP before Linux. If you want to install XP on a computer that has Linux partitions, you must delete those partitions (or disconnect the disk) during the install. Once the install has completed you can reconnect the disk or restore the partitions. I don't know why XP install should be so intolerant of Linux.
The PC operating system war is far from over. The Microsoft PC hegemony is under challenge from a variety of Unix flavours, particularly (but not exclusively) Linux. As technologists it is important that we understand the features and capabilities of a range of platforms - and the best way to do this is to try them out for ourselves.
What is not widely known is that it is possible (although not straightforward) to install several operating systems onto the same PC, each in its own partition, and select between these partitions at boot time. With some restrictions, it is possible to exchange information between them and even run cross-platform software.
This technical article addresses the first challenge, that is how to install, configure and manage a PC so that it can boot up into any of several different operating systems.
The article discusses disk partitioning, the boot process, boot managers and file system sharing. It focusses on Windows 9x, Windows NT 4, Windows 2000, Linux and (to a limited extent) Solaris/Intel, although most of the principles should apply to your O/S of choice. (It's only a lack of primary partitions that has so far prevented me from also installing Plan 9 from Bell Labs and BeOS from Be Inc.)
It is aimed at home or laptop PC usage, rather than at servers.
(I wouldn't recommend multiple-operating system booting on servers unless you are very courageous.)
Copyright and Disclaimer
This article is Copyright (C) 1996-2000 Nick Rozanski.
It is provided on an 'as-is' basis, in the hope that it will be useful, but without any warranty. Whilst best endeavours have been made to ensure its accuracy, no guarantees of this can be given nor any responsibility accepted for the consequences of any inaccuracies.
My legal department makes me say that.)
|Microsoft Windows 95||Service Pack 1|
|Microsoft Windows NT 4||Service Pack 6a|
|Microsoft Windows 2000||1st Release (Build 2195)|
|Linux||Red Hat 6.2|
Note also that most of the comments about Windows NT apply to Windows 2000 also.
This article is a revised version of one I first wrote in 1996.
I have most recently (July 2000) updated it for Windows 2000.
I'll start by explaining the relevant terminology.
Physical disks in a PC (from now on, I'll just call these "disks") are numbered from zero. The first disk is called disk 0, the second disk 1, and so on.
There are a number of interface protocols and architectures used to attach disks to PCs. The two main protocol families are IDE and SCSI. (You can find more information about IDE vs SCSI in , but you don't need to understand these in detail in order to manage multiple operating systems on them.)
- IDE (Integrated Drive Electronics)
IDE disks are based on a standard introduced by Compaq and Western Digital in 1986. The EIDE (Extended IDE) standard offers faster transfer rates and larger disk capacity, while retaining backwards compatibility with IDE. The new Ultra DMA standard doubles EIDE transfer speeds and enhances data integrity. Most PC disks are IDE, EIDE or some variant thereof. I refer to these generically as "IDE" in this article.
- SCSI (Small Systems Computer Interface)
SCSI (pronounced 'scuzzy') is a more generic interface for attaching peripherals to a computer. SCSI interfaces are generally faster, more generic and support more attached devices, but are more expensive so are more often found in high-end systems or those with multimedia support. As well as hard disks, SCSI interfaces can attach CD-ROMs, tape drivers, scanners and many other types of peripheral. SCSI interfaces are also used in many non-PC computers.
Wherever I say "disk" in this article, I mean "IDE or SCSI fixed hard disk". (I don't consider removable disks (eg ZIP) or bootable CD-ROMS.)
Most of the information in this document is applicable to both IDE and SCSI disks, as far as I am aware;
I have tried to indicate where there are differences.
Having said that, I do not have any SCSI hardware at present so I can't actually verify this!
If you have any experiences with SCSI disks which are relevant to this article, please email me.
Partitions and Logical Drives
A partition is a physically contiguous portion of a disk which is treated as a unit by operating systems. On the PC, there are two types of partition, known as primary and extended. Extended partitions can be further subdivided into logical drives. I explain these concepts below.
- Primary Partition
A primary partition is an area of disk storage used to boot operating systems. (A primary partition does not have to be bootable, although because the number of primary partitions is limited to three or four per disk, it usually is.) A primary partition appears as a separate drive under Windows (C:, D: etc) and can be mounted under Linux (/mnt/mydir). It cannot be subdivided into logical drives.
- Extended Partition
The extended partition (there can only be one per disk) is used to manage that portion of the disk which is not in any primary partition. The extended partition (if present) occupies space not occupied by the primary partitions. (Remember that is has to be contiguous, though.) The extended partition does not, in itself, offer any storage capability and does not appear as drive letters under Windows. It does appear as a device under Linux, though (/dev/xxx). The extended partition is subdivided into one or more logical drives.
- Logical Drive
A logical drive is a physically contiguous area of disk storage, which is a portion of the extended partition. A logical drive appears as a separate drive under Windows (C:, D: etc) and can be mounted under Linux (/mnt/mydir). It cannot be further subdivided. It cannot be used to boot DOS/Windows, although it can be used to boot some other operating systems.
This bizarre way of managing disk space arose, like much else in the PC world,
out of the limitations of the original PC architecture,
which could not address disks larger than 32MB in size.
This problem was resolved by creating the concept of an extended partition which
could hold data above the 32MB "mark".
Unfortunately, although the world has moved on much since those days,
the PC architecture hasn't,
although thankfully the size restrictions have been eased (considerably).
A filesystem is the means by which data on disk is physically organised and catalogued into files, directories and so on. The following PC filesystems are of interest to us.
- FAT (File Allocation Table)
This is the original filesystem used by DOS and Windows 3.x. It allows 8.3 file names only, and has no security features and limited recoverability. "FAT" is often used generically to refer to the family of FAT filesystems and their extensions. A particular weakness of the FAT family is that it is very wasteful of disk space (see ). On the other hand, it is much easier to recover data from FAT drives if Windows becomes unbootable. NTFS data recovery is much harder (see  if you need help).
This is the filesystem used by (most releases of) Windows 95. It is an extension to FAT which allows Windows 95 "long filenames" (which it stores in an invisible area on disk). Like FAT it has no security features and limited recoverability. It used to be called VFAT (Virtual FAT).
This is the filesystem used by the "OSR2" version of Windows 95. (This is a version of Windows 95 shipped preinstalled on some PCs after the initial launch of Windows 95. You can't buy it or upgrade to it.) FAT32 supports hard disks of up to 2 terabytes (2,048GB), a thousand-fold increase on FAT16. FAT32 also greatly increases the number of clusters on a logical drive, providing greater storage efficiency (wasting much less cluster space). DOS, "Ordinary" Windows 95 and Windows NT cannot read FAT32 drives.
- NTFS (NT File System)
This is the filesystem used by Windows NT. It has many efficiency, security and recovery features.
Warning! A new version of NTFS (version 5) has been developed for Windows 2000. NTFS 5 is not totally compatible with Windows NT 4. Windows 2000 installation upgrades all NTFS volumes to NTFS 5 without prompting. (See below for further details.)
- HPFS (High-Performance File System)
This is the file system used by OS/2. It has the same historical origins as NTFS so has many similar features. Windows NT version 4 does not support it and I do not consider it further.
- ext2 (Extended-2 File System)
This is the most popular filesystem used with Linux. It has many of the features of commercial Unices, although is not quite as powerful as NTFS (yet).
Partition System Types
Every primary partition and logical drive has a partition system type which is a value stored in the partition table. The partition system type tells the system what type of filesystem is installed on that partition. A list of common partition system types is given in the Appendix.
This value is ignored by Linux.
The PC expects one partition to be active before it will boot (unless a boot loader like Boot Magic is used to override this process). The active flag is a bit in the partition table entry for each primary, extended or logical partition. (It is only really meaningful for a primary partition as far as I can see.) Setting the active flag tells the computer that this is the partition into which it should boot during the standard boot process.
Setting the active flag is a separate operation from, and independent of, installing bootable files on the partition (eg running FORMAT /S under DOS). Both steps are required.
Most preconfigured PCs have one disk with one partition. Partitioning your hard drive helps you to organise data, can provide some protection against disk failure and can improve performance (eg using a swap partition on a separate drive). Using partitions is pretty much essential if you want to run multiple operating systems on one PC. (The alternative is to install multiple operating systems in the same partition - for example, Windows 95 and Windows NT, or Windows 95 and Linux. This is messy and I do not consider it here.)
Partitioning a disk is a potentially destructive activity, however, and should only be undertaken once you understand after careful planning. Resizing, moving or copying partitions can only be done using commercial utilities such as Partition Magic. Mistakes cannot usually be rectified and data loss is permanent.
It goes without saying, really, but: back up your important work before messing around with partitions.
Partition Configuration Constraints
PC hardware and software architectures impose constraints on partition size, placement and configuration,
which you must take into account when planning your disk configuration.
The important ones are described in this section.
Disk Architecture Limitations
Most PCs will support up to four attached EIDE devices, grouped in pairs called channels. Each EIDE channel manages two devices, one called a master, the other called a slave.
It is not a good idea to mix fixed disks and other ATAPI storage devices (eg CD-ROMs) on the same EIDE channel. For this reason, a typical PC IDE disk configuration is one or two IDE disks on the primary IDE channel, and one or two non-disk peripherals on the secondary IDE channel.
SCSI is more scalable, supporting up to seven heterogeneous devices (disk, CD) per SCSI host adaptor.
An IDE disk can have up to 64 partitions; a SCSI disk can have up to 16 partitions.
PC BIOS Limitations
The BIOS (Basic Input-Output System) is code which is stored permanently in the PC's ROM.
It is used to start up the PC and boot it into an operating system.
Early BIOS decisions also impose some limitations on your partitioning choices.
Numbers of Partitions
Because of BIOS restrictions one physical disk can either contain:
- one extended partition and up to three primary partitions, or
- no extended partition and up to four primary partitions.
This restriction fundamentally constrains your partition architecture.
The 1024-Cylinder Rule
Many BIOSes can only directly address up to 1024 disk "cylinders" (see  for a definition of this an other terms). Since it is the BIOS which boots up the computer, this means that any bootable partition must be physically located within the first 1024 cylinders.
Warning! If this rule is broken, a boot sequence may appear to work, but may fail subsequently and disastrously. It applies to all operating systems.
Note that some operating systems (NT, Linux) can be set up with a minimal set of boot files in one partition,
and the rest of the system files on another.
And in any case, you will typically have a number of other partitions containing data, programs etc.
In these cases, it is only the initial boot partition which must lie within the 1024-cylinder boundary.
Old BIOSes may have trouble accessing larger drives.
The original IDE standard, for example, only envisaged drives up to 504MB in size. This is resolved using a technique called LBA (Logical Block Addressing) which provides the necessary BIOS address conversion to support drives up to 8.4GB. BIOSs after mid 1994, which are sometimes called Enhanced BIOSs, generally have LBA support. (Check on your manufacturer's website if in doubt).
Upgrading the BIOS is usually a matter of running a special BIOS-burning program.
Upgrade with great care - a failed upgrade can render your PC unuseable.
Some BIOSes will only boot from partitions on drive zero (ie the master disk on the primary EIDE channel).
Operating System Limitations
In addition to the above limitations, operating system impose limitations of their own. Note that these limitations change regularly with new releases of operating systems, so always refer to your operating system documentation.
- DOS/Windows and Windows NT/2000 are limited to 26 drive letters (A-Z). Once you have taken floppy drives, CD-ROMS and other peripherals into account, plus shared drives if you have a network, this does not leave you much headroom.
- DOS/Windows is generally unhappy if a disk contains more than one primary partition. (This does not apply to Windows NT/2000, nor to the "OSR2" version of Windows 95 as far as I can tell.) You can get around this limitation by "hiding" primary partitions, using Boot Magic for example.
- Windows NT will not boot into a partition which extends above the 2GB mark (see  for details), irrespective of cylinder numbering. (Note - this restriction appears to have been superseded by a maximum size of 7.8GB for the system partition - see . It seems to apply to ordinary Windows 95 - not OSR2 - but not to the more recent members of the Windows family.)
- Linux expects boot partitions to exist under the 1024-cylinder limit. Refer to the excellent Large Disk HOWTO at the Linux Documentation Project () for details.
Partitioning Rules of Thumb
So what rules of thumb can we define for partitioning disk drives?
- Where possible, place operating system boot partitions on disk zero (master disk of the primary EIDE channel). If your BIOS allows it (modern ones do), you may place bootable partitions on disk 1 also.
- In general, the optimal partition configuration for multiple operating systems is three primary partitions for booting, plus an extended partition, with multiple logical drives, for programs and data.
- Size your partitions carefully. If they fill up it is difficult to reconfigure them (impossible without a utility such as Partition Magic).
- When sizing partitions, allow plenty of space (100-200MB at least) for temporary files (C:\TEMP\ or /tmp).
- But - make the bootable primary partitions relatively small (500MB to 1GB) to avoid addressing problems. If you have multiple primary partitions, then they should all total less than 2GB in size (eg 600MB + 600MB + 800MB).
- Do not define too many partitions. You will run out of DOS/Windows/NT drive letters and they will be hard to manage.
- You can use Windows 2000 release points to reduce the number of drive letters you need (this facility allows you to "mount" partitions as directories rather than drive letters). Warning! If you use release points then Windows 2000 does not report total available disk space correctly (it only takes into account the disk space on the "root" drive, not the mounted sub-drives). This can cause problems when installing software which checks for available disk space.
- If you have two disks, you can place paging files on the second disk to improve performance. These will typically live in a separate partition.
Partitions and logical drives are internally numbered between 0 and 63.
Operating systems address partitions or logical drive by a "logical" name.
You need to understand the conventions in order to install and manage partitions.
DOS/Windows Partition Addressing
DOS, Windows 3.x and Windows 95 refer to partitions using drive letters, so that each partition appears to DOS/Windows as a separate drive. Letters A and B are reserved for floppy disks, leaving C to Z available for partitions. Note that drive letters are also required for other peripherals, such as CD-ROM drives and Zip drives, and for any mounted network shares.
Unfortunately, DOS/Windows allocates most drive letters dynamically when it boots. This means that the letter used for a partition or logical drive may change depending on how the PC was booted. It may also change if you change your partition configuration (eg adding a primary partition to disk 1).
DOS/Windows allocates drive letters to partitions and logical drives as follows (see ).
- The partition from which DOS/Windows is booted (which must be on disk 0) is always called C:.
- If there is a disk 1, its first primary partition is called D:.
- If there are disks 2, 3 and so on, the first primary partition on each is assigned the next available letter (E:, F: etc.) in turn.
- If there are any logical drives on disk 0 which are (V)FAT, ie of type 6 (see Partition System Types), these are assigned the next available letters, in order of partition number.
- The above step is repeated for disk 1, and then for disks 2, 3 and so on (if present).
- If there are any other primary partitions on disk 0 which are FAT, these are assigned the next available letters, in order of partition number.
- The above steps are repeated for disk 1, and then for disks 2, 3 and so on (if present).
Extended partitions are not allocated drive letters (although the logical drives within them obviously are).
Thankfully, Windows 95 allows you to fix the letters used for CD-ROM drives.
(Select Control Panel | System and click the Devices tab.
Click on the CD-ROM branch and select Properties.)
Windows NT/2000 Partition Addressing
Windows NT/2000 uses drive letters for partitions just as DOS/Windows does. In its default setup, NT assigns drive letters in the same way as DOS/Windows. Fortunately you can override the default drive assignment in Windows NT using the Disk Administrator or Partition Magic.
If you have a lot of partitions you can group them into volume sets (Windows NT) or use release points (Windows 2000).
- A volume set is a collection of partitions which you address using a single drive letter. Windows NT manages the positioning of files on the volume set partitions for you - it fills the first partition first, then the next one, and so on. Using volume sets can provide obvious performance benefits.
- With release points in Windows 2000 you can, for example, create a directory like c:\Home and map it to another partition. This feature is analogous to NFS mount points supported by Unix (although not as powerful).
Another feature of NT/2000 is that you don't have to assign a drive letter to every partition of interest. You can assign a drive letter only if and when you need to use that partition.
Re-create your Windows NT Emergency Repair Disk (ERD) after changing your disk configuration
Linux Partition Addressing
Linux, like other Unix flavours, has a single unified filesystem. All partitions are accessed under the root directory /. Partitions are made accessible using the mount command. (Type man mount for details of this command.)
The device names that Linux understands are as follows.
This represents all of the first IDE fixed disk (the master disk on the primary IDE channel). The way you can tell it is disk zero is by the letter a. Disk one uses the letter b.
- /dev/hdan (n =1,2,3,4)
This represents the nth primary or extended partition on IDE disk zero. The first primary or extended partition is /dev/hda1, the second is /dev/hda2, and so on. ("First" means "with lowest partition number".)
- /dev/hdan (n =5,6,7, ...)
This represents the first, second etc. logical drive within the extended partition on IDE disk zero. The first logical drive is /dev/hda5, the second is /dev/hda6, and so on. This numbering is independent of the number of the extended partition itself.
- /dev/hdb, /dev/hdbn, (n =1,2,3,...)
These are the corresponding device names for partitions and logical drives on the second IDE disk (disk 1). /dev/hdbn has the same meaning as the corresponding /dev/hdan.
These are the corresponding device names for SCSI disks. x is a for SCSI disk 1, b for SCSI disk 2, and so on. n has the same meaning as for IDE. So, for example, /dev/sdb6 is the second logical drive on the second SCSI drive (drive 1).
These are the device names for the floppy drives. n is 0 (zero) for the first floppy drive (A: under DOS), and 1 for the second floppy drive (B: under DOS), if present.
This section describes native operating system commands for partition management,
as well as a commercial utility, Partition Magic,
which is much more fully-featured.
Creating and Deleting Partitions Using Native Utilities
Each operating system has its own utility for managing partitions. In DOS/Windows, the utility is called FDISK. In Windows NT, it is called the Disk Administrator. In Windows 2000, it is part of the Computer Management Administrative tool. In Linux, the utility is called fdisk. Of these, the easiest to use is the Computer Management tool (which has a nice graphical user interface) while Linux fdisk is the most powerful.
When you create a partition, it is best to use the utility for the operating system which is going to reside on that partition. For example, always use Disk Administrator to create a Windows NT partition. You can create partitions using another operating system's utilities, but this sometimes causes strange and subtle problems (particularly, in my experience, on laptops).
Once you have created a partition, you cannot modify it, other than deleting it, using these native utilities. Also, if you create and delete partitions or logical drives of different sizes, your disk may become fragmented. (Remember that a partition or logical drive always occupies a physically contiguous area on disk.)
It should be obvious from the above that it is vital to plan your disk configuration before you start. Partitioning a disk is a potentially destructive activity. Of course, you will remember to back up anything important before you mess with partitions.
Always reboot your PC after modifying partitions.
(If you want to see how important this is, create a small partition under DOS, format it,
and watch DOS trash the rest of your disk.)
Formatting Disks and Partitions Using Native Utilities
Once you have created a partition, you must format it to make it useable by the target operating system. Always reboot your PC between creating a partition and formatting it.
In DOS/Windows, use the FORMAT command or File Manager. In Windows NT, use the FORMAT command, Explorer or Disk Administrator.
In Linux, use mkfs or mkswap (for an ordinary partition and swap partition respectively),
followed by mount or swapon respectively.
Disk Management Using Partition Magic
Partition Magic is an extremely useful disk management utility from Powerquest. (I have no connection with this company other than as a user of its software.)
As well as providing the functionality of the native utilities described above (to create, delete and format partitions), Partition Magic can:
- resize, move and copy partitions
- convert partitions from one filesystem to another
- analyse and report on disk usage
- update the Windows Registry as a result of drive letter changes.
Partition Magic supports FATxx, NTFS, HPFS and the Linux ext2 filesystems (not Solaris/Intel). It runs under DOS, Windows 95 and Windows NT (not Linux, unfortunately) and has an easy-to-use graphical interface.
I have found Partition Magic to be very reliable on desktop machines. (This perception is confirmed by all of the reviews of it I have come across.) I have never experienced any data loss using Partition Magic on desktops.
Warning! I have found Partition Magic to be slightly less reliable on laptops (I have tried it on about half a dozen so far). I have twice ended up with unuseable laptop partitions when I tried to move or resize using Partition Magic. I have used it successfully on laptops on a number of other occasions. I have never tried to recover a corrupt laptop partition.
On the plus side, if the power fails while you are moving or resizing a disk, your laptop's battery will keep the process going. In any case, I recommend backing up any partition before resizing it or moving it, or accept that there is a (small) chance that it will be damaged or destroyed in the process.
An understanding of the way boot sectors work is a pre-requisite to understanding the boot mechanisms discussed in this and subesquent sections.
On a floppy disk, the boot sector is the first sector on the disk. (A floppy disk can only ever contain one partition.) The first few bytes of the boot sector is a jump to code which is executed if you try and boot from the floppy disk.
Note that a formatted floppy disk always contains boot code, even if you haven't run SYS to put the DOS system files on it. The code just prints a message like Non-system disk or disk error and waits for you to press a key. (This is how you can pick up a boot sector virus by trying to boot from a non-bootable floppy.)
On hard disks, the setup is similar, but more complex. The first sector of the hard disk (which is outside any partition) is called the Master Boot Record (MBR). This contains code which is executed when the computer boots from that disk. It also contains the first part of the disk's partition table. The standard MBR for a fixed disk looks like this:
----------------------- 0x000 | Program code | |-----------------------| 0x1BE | Partition table | |-----------------------| 0x1FE | magic number (0xAA55) | -----------------------
The first sector of each primary and extended partition and of each logical drive is also a boot sector.
This has a similar structure to the MBR,
but may also contain some filesystem-specific information, such as MS-DOS disk parameters.
It is functionally equivalent to the Master Boot record,
in that it contains executable boot code and a partition table (for that partition only).
The Standard Boot Process
If your PC runs a single operating system (DOS/Windows, Windows NT or Linux) it boots as follows. (Note that this description is greatly simplified!)
- When you switch on the computer, or do a soft or hard reset, the BIOS loads the Master Boot Record (MBR) from disk 0.
- The BIOS executes the first instruction of the MBR.
- The MBR boot code determines which primary partition is the active partition by looking at the partition table in the MBR.
- The MBR boot code loads the boot sector from the active partition.
- The MBR boot code executes the boot sector code it has just loaded. This boot sector code loads the operating system which is on that partition. For MS-DOS, for example, it goes through the normal DOS/Windows boot sequence (loading COMMAND.COM etc.).
This process is illustrated in the following diagram.
ROM disk 0 active partition ------ ---------- -------------- | BIOS | --> | MBR code | --> | boot sector | --- ------ ---------- | code | | |--------------| | | operating | <-- | system files | | |
The above sequence is fine if there is only one operating system on the PC. However if there are multiple operating systems, then it needs to be modified to allow the user to choose which operating system to boot. There are several ways to do this.
- Method A: Change the Active Partition
Manually change the active partition, using DOS FDISK for example. If all else fails, this will always work. But it is cumbersome and user-unfriendly and is not discussed here further.
- Method B: Boot One Operating System, Then Another
Boot into one operating system, and then run a program which boots the computer into another operating system. An example of this is the Linux loader LOADLIN, which is a DOS program which boots Linux. This type of loader is not discussed here further either (refer to  if you want instructions).
- Method C: Modify a Boot Sector
Use the standard MBR, but replace the 'program code' part of the boot sector of the active partition with code which does something different.
- Method D: Modify the Master Boot Record
Replace the 'program code' part of the MBR with code which does something different.
The rest of this article concentrates on tools and utilities which utilise Method C or D.
The Windows NT Loader
If you want to run DOS/Windows and Windows NT on the same computer, you can use the Windows NT Boot Loader (which is part of Windows NT).
The Windows NT Loader is the least functional of the loaders discussed here in that it only allows you to boot Microsoft operating systems - typically Windows NT and another version of Windows (such as 3.x or 95). (I haven't been able to get the Windows NT boot loader to boot Linux, although I didn't try very hard.)
A dual Windows 95 / Windows NT installation would typically be configured as follows. (The Windows NT installation program will set up this for you if so instructed - see  for more details.)
- Windows 95 is installed in a primary VFAT partition on drive zero. This partition is made the active partition. It contains the standard Windows 95 C:\WINDOWS directory and its subdirectories, as well as the standard DOS/Windows system files in C:\. (Note the various restrictions about where you can install Windows 95, discussed in the previous section.)
- The Windows NT root files are installed in the same partition as Windows 95.
- The Windows NT system files are installed in a separate partition, called the system partition. (The Windows NT installation program will create this partition for you, as a logical drive, prompting you for its size. I am not aware of any restrictions on the size or position of this partition.)
The NT system partition can use FAT or NTFS; see above for a discussion of the merits of using NTFS. It contains the standard Windows NT x:\WINNT directory, and its subdirectories such as x:\WINNT\SYSTEM32 (where x: is the drive letter for this partition). A similar configuration would be used for a dual Windows 3.x / Windows NT installation, or a dual DOS / Windows NT installation for that matter.
The Windows NT installation program copies the original boot sector
of the Windows 95 partition to a file called BOOTSECT.DOS,
and replaces this boot sector with one of its own.
It also loads other files into the root directory (C:\) of this partition,
such as the NT Loader (NTLDR), the hardware detection program NTDETECT.COM,
and the initialisation file BOOT.INI.
It leaves the MBR unaffected.
Why this approach? Well, first of all, you are strongly advised against installing Windows 95 and NT in the same partition. Although they have their own root directories (C:\WINDOWS and C:\WINNT the shared root-level directories like C:\Program Files will get messed up. Also, the partition would have to be FAT16 (not FAT32 or NTFS) which is neither secure or reliable.
But you cant't install Windows 95 and NT in separate (primary) partitions,
because Windows 95 is unhappy about two primary partitions on the same disk.
(You can use Boot Magic to get around this little problem.)
Booting Windows NT With the NT Loader
The operation of the NT Loader is controlled by the initialisation file BOOT.INI. (An example BOOT.INI is given in Appendix B.) The configuration described above boots in the following manner.
- The MBR loads the boot sector for the partition containing Windows 95 (since this is the active partition).
- The boot sector for this partition (which was replaced by Windows NT) loads the Windows NT boot loader, NTLDR.
- NTLDR runs NTDETECT.COM to build a list of hardware installed on the PC.
- NTLDR looks in the information in the initialisation file BOOT.INI. It presents a list of options to the user, which in this instance would be Windows 95 or Windows NT.
- If the user selects Windows 95, then NTLDR loads the normal MS-DOS boot sector which is in the file BOOTSECT.DOS. This loads Windows 95.
- If the user selects Windows NT, then NTLDR continues to boot NT using the files in the \WINNT directory on the NT partition.
This process is illustrated in the following diagram.
ROM disk 0 Windows 95 partition ------ ---------- -------------- Windows NT Partition | BIOS | --> | MBR code | --> | boot sector | ------ ---------- | code | -------------- |--------------| option | | | NTLDR.EXE | -------> | Windows NT | | | --- | operating | |--------------| | | system files | --- | BOOTSECT.DOS | <-- | | | |--------------| | | --> | Windows 95 | | | | operating | | | | system files | | | | | | |
Windows 2000 uses the same mechanism as Windows NT. If you want to dual-boot between NT and 2000, then the NT Loader mechanism is the easiest way to do this. You should install Windows NT first, then Windows 2000. Windows 2000 updates NTLDR.EXE but this is still compatible with Windows NT.
LILO is a boot loader which is used in conjunction with Linux.
It is more configurable than the NT Loader and will boot many operating systems.
It uses either method C or method D.
Typical Windows 95 / NT / Linux Configuration
LILO will support a number of boot configurations. It provides a boot sector which will work on a floppy disk, on a disk partition or as the Master Boot record. Refer to  for a full description of setting up LILO. An example configuration, based on the one I used before I had Partition Magic, is given below.
- The Master Boot record is replaced by the LILO Boot Loader.
- Windows 95 is installed in a primary partition.
- The Windows NT system files are installed in a separate partition as described above.
- Linux is installed in another partition (usually a primary partition on disk 0).
Booting With LILO
Like the NT Loader, the operation of LILO is controlled by an initialisation file, an example of which is given in Appendix C. The configuration described above boots in the following manner.
- The LILO MBR is loaded by the BIOS, and displays a "LILO" prompt. (The way the prompt works is configurable.)
- The user types in the keyword for the operating system to be booted. (The valid options are defined in the initialisation file.) For the above configuration, the options are (1) Windows 95 / Windows NT, and (2) Linux.
- LILO loads the boot sector for the operating system selected, and then executes this boot code.
- If Windows 95 / NT was selected at the LILO prompt, then LILO loads the boot sector for then Windows 95 partition. This causes the Windows NT Loader NTLDR to execute, and the PC boots as described above. (In particular, the user must now select either Windows 95 or NT.)
- If Linux was selected at the LILO prompt, then LILO loads the Linux kernel and Linux boots.
Partition Magic comes supplied with a utility called Boot Magic that gives you more flexibility over your operating system configurtation. (Note that most of the restrictions on partition placement and size decribed above still apply, since these are architecture / BIOS restrictions.)
Using Partition Magic, you can install, for example, each of Windows 95, Windows NT and Linux in its own primary partition. You can do this because Partition Magic and Boot Magic have the ability to hide and unhide partitions. Hiding a partition involves changing the partition system type value in the partition table so that operating systems do not "see" it.
Unhiding the partition involves changing the partition system type back again so that it is now visible.
You can hide a partition explicitly from within Partition Magic. Even more usefully, Boot Magic will automatically hide or unhide the appropriate partitions for you at boot time.
Note that since a hidden partition is not visible to another operating system,
you should put shared data on a separate (usually logical) partition.
Note also that Linux does not worry about multiple primary partitions,
nor about hidden or unhidden partitions (only about what you mount).
Booting With Boot Magic
I now run Windows 95, Windows NT, Windows 2000 and Linux all on the same PC using this method. I set it up as follows.
- I installed Windows 95 first, in its own primary partition.
- I then used Partition Magic to hide the Windows 95 partition. I installed Windows NT in a second primary partition.
I then installed Linux in a third primary partition.
Linux doesn't care about other primary partitions,
but like all operating systems it must be installed under the 2GB and 1024-cylinder marks.
When installing Linux, I instructed the installation program to install LILO in the boot sector of the Linux partition, not in the MBR.
I then installed Windows 2000.
This modified the Windows NT boot loader to also allow booting of Windows 2000.
I placed the Windows 2000 system files in a logical partition (since these do not have to be in a bootable partition, as explained above).
- Finally, I ran up Boot Magic (from a floppy disk) and told it about Windows 95, Windows NT/2000 and Linux. (Boot Magic installs itself in the MBR, replacing the default MBR. The Boot Magic program files need a FAT partition in which to be installed; I installed them in my Windows 95 partition.)
My system boots as follows in this configuration.
- The Boot Magic code in the MBR starts up the Boot Magic program, which is a simple GUI interface presenting a list of configured operating systems.
- Using the mouse I select one of Windows 95, NT or Linux.
- Boot Magic hides any partitions which it needs to in order to boot the selected operating system. For example, if Windows 95 has been selected, it hides the Windows NT partition.
- Boot Magic unhides the selected operating system partition, if necessary.
- Boot Magic loads the boot sector from the partition for the selected operating system.
- For Windows NT/2000, the NT loader then prompts me for which of these two operating systems I wish to boot.
- The chosen operating system boots as normal.
I installed Solaris/Intel with a certain amount of trepidation. The documentation is sparse and suggested it is not compatible with Linux. (I think this is wrong.)
Warning! I was worried that the Solaris installation program would trash my hard disk. I was right to be worried - it managed to destroy the partition after the one into which I installed Solaris.
So take care when installing Solaris/Intel onto a disk containing other operating systems. My advice would be to install it onto an otherwise empty disk.
Solaris/Intel is not compatible with Partition Magic or Boot Magic, unfortunately. The only way I have been able to get Solaris to boot onto my PC is to use the Solaris Configuration diskette.
I may investigate this further one day.
Compatibility Between Operating Systems
Having booted into one operating system,
it is possible in some cases to access filesystems on the same PC which are
formatted for other operating systems.
It is also possible to run some programs written for other operating systems.
The following is my knowledge of these compatibility issues.
DOS/Windows programs can access FAT and VFAT filesystems. There is a utility program called NTFSDOS (see ) which allows DOS/Windows read-only access to NTFS filesystems on the same computer. It runs under DOS, Windows 3.x and Windows 95. DOS/Windows apps running under NT can, of course, see NTFS filesystems without any special software. I am not aware of any way of accessing Linux ext2 filesystems from DOS/Windows.
Windows 95 will run many (but not all) Windows NT programs using the WIN32S 32-bit shared libraries.
None of these will run Linux programs, of course (but you can boot into Linux using LOADLIN).
Windows NT (not 2000) programs can access FAT and FAT16 filesystems as standard, but not FAT32.
There is an ext2 filesystem driver for Windows NT (see ). I have not tried it yet.
Windows NT will run many DOS, Windows 3.x and Windows 95 programs (but not all -
specifically, not badly-behaved programs which try and access devices directly).
Windows NT will not run Linux programs.
Windows 2000 programs can access FAT, FAT16 and FAT32 filesystems as standard.
Windows 2000 will run many DOS, Windows 3.x and Windows 95 programs (but not all - specifically, not badly-behaved programs which try and access devices directly). Unlike NT 4 it supports newer hardware technologies like Plug-and-Play and USB.
Warning! Warning! Windows 2000 uses a new version of NTFS, version 5. Beware this if you want to run NT 4 and 2000 on the same computer, and have NTFS data partitions. Windows 2000 installation upgrades all NTFS volumes to NTFS 5 without prompting.
Note in particular:
- You need Service Pack 6 to access NTFS partitions from NT 4. You cannot make use of features such as release points, encrypted file systems or Windows 2000 disk quotas.
- According to Microsoft , "most read/write operations [ from Windows NT ] function normally if they don't make use of any NTFS for Windows 2000 [ NTFS 5 ] features." I have not encountered any problems (yet).
- chkdsk will not run from NT 4 against NTFS 5 partitions. You will see error messages to this effect when you boot into NT 4. (This does not otherwise affect the boot process.) You should use Windows 2000 to chkdsk all NTFS 5 partitions.
Linux can access FAT and VFAT filesystems. There is a read-only NTFS driver for Linux (see , which does not form part of the "official" distributions.
Linux will run a few DOS/Windows programs using the WINE emulator (which is under development).
I have not tried this (what on earth is the point?).
You can get more detailed information on the topics covered in this article from:
The Linux Documentation Project, particularly the Large Disk HOWTO, which can be found at http://www.linuxdoc.org
LILO Documentation by Werner Almesberger which can be found in the directory /usr/doc/lilo on a standard Linux installation.
README.fdisk which can be found in the directory /usr/doc/util-linux-xxx on a standard Linux installation
Windows NT Unleashed 1996 SAMS Publishing, ISBN 0-672-30902-5
Windows 95 Secrets 1995 IDG Books, ISBN 1-56884-453-0
NTFSDOS Read-Only NTFS Filesystem Driver for DOS/Windows which can be found at http://www.sysinternals.com/ntfs30.htm
Linux NTFS Filesystem Driver which can be found at http://www.informatik.hu-berlin.de/~loewis/ntfs
The PC Technology Guide which can be found at http://www.pctechguide.com
System Internals Website which can be found at http://www.sysinternals.com
ext2 Filesystem Driver for Windows NT which can be found at http://www.chat.ru/~ashedel/ext2fsnt
Fatwaste utility for determining FAT overhead which can be found at http://ftp1.rad.kumc.edu/share/win95/dskutil/fatwaste.zip
KnowledgeBase article Q192104 which can be found at http://support.microsoft.com/search
Microsoft Windows NT 4.0 Server, Terminal Server Edition Service Pack 6 README.HTM which can be found at http://www.microsoft.com/NTServer/terminalserver/downloads/recommended/tsesp6/sp6readme.htm
KnowledgeBase article Q224526 which can be found at http://support.microsoft.com/search
Partition System Types
Each partition and logical drive has a system type which is recorded in the partition table. The system type tells the PC what the partition is used for, that is, what type of filesystem it has. DOS/Windows and Windows NT use the system type at boot time to determine which partitions / drives they can read. Linux ignores the system type; partitions and drives are explicitly mounted.
The system types relevant to this article are:
- 6: DOS FAT and Windows 95 VFAT
- 7: Windows NT NTFS and OS/2 HPFS
- a: OS/2 Boot Manager
- 82, 83: Linux (82 for swap, 83 for filesystem)
A system type of zero means the partition is unused.
Example BOOT.INI File
BOOT.INI tells the Windows NT Loader which options to present to the user. The BOOT.INI file I use for Windows NT / 2000 dual boot is included below as an example.
[boot loader] timeout=5 ; default=signature(9e428d39)disk(0)rdisk(0)partition(9)\WINNT default=multi(0)disk(0)rdisk(0)partition(2)\WINNT [operating systems] multi(0)disk(0)rdisk(0)partition(2)\WINNT="Windows NT" /sos signature(9e428d39)disk(0)rdisk(0)partition(9)\WINNT="Windows 2000" /sos /fastdetect multi(0)disk(0)rdisk(0)partition(2)\WINNT="Windows NT [VGA mode]" /basevideo /sos signature(9e428d39)disk(0)rdisk(0)partition(9)\WINNT="Windows 2000 [VGA mode]" /sos /fastdetect /basevideo multi(0)disk(0)rdisk(1)partition(1)\WINNT="RECOVERY: Partition 1" /sos multi(0)disk(0)rdisk(1)partition(2)\WINNT="RECOVERY: Partition 2" /sos multi(0)disk(0)rdisk(1)partition(3)\WINNT="RECOVERY: Partition 3" /sos multi(0)disk(0)rdisk(1)partition(4)\WINNT="RECOVERY: Partition 4" /sos multi(0)disk(0)rdisk(1)partition(5)\WINNT="RECOVERY: Partition 5" /sos
The [boot loader] section defines the timeout (in seconds) before the default operating system loads. The # is a comment; the commented-out line is what I would use to make Windows NT the default operating system instead of Windows 95.
The [operating systems] section defines the choice of operating systems which the NT Loader can boot. Each line specifies an operating system to load, using what is called "ARC notation". For IDE disks this looks like the following:
- m is the number of the IDE channel (the first channel is number 0)
- n is the disk number on that channel (the first disk is number 0)
- p is the partition number on that disk (the first partition is number 1)
- directory is the top-level directory of the operating system
- menutext is the description which appears in the NT Loader menu.
For SCSI disks, the notation is slightly different. For Windows 2000, a new notation has been introduced. Information on these is available from the Microsoft Knowledge Base website.
For Windows 95/NT dual boot, the Windows 95 entry just looks like this:
The RECOVERY lines are there in case I restructure my disk and forget to alter BOOT.INI beforehand.
Example lilo.conf File
lilo.conf tells LILO which options to present to the user. An extract from my lilo.conf file is included below as an example.
boot=/dev/hda3 map=/boot/map install=/boot/boot.b prompt timeout=50 image=/boot/vmlinuz-2.0.36-0.7 label=1 root=/dev/hda3 read-only
Before you mess around with boot sectors you should always create a bootable diskette for each of your operating systems.
Bootable Diskette for DOS/Windows
Format a diskette under DOS, using the command FORMAT A: /U/S, or using Windows Explorer. This will put the DOS system files on the diskette so that you can boot from it. You should also copy (at a minimum) the following files on this diskette:
(You may want to copy other utilities onto this disk.)
If you have problems booting, you can always reboot from this floppy disk.
If your Master Boot record has become unusable,
you can restore it to the default using the undocumented DOS command
The action taken to recover a bad boot sector on a partition depends
on the filesystem installed on that partition.
Bootable Diskette for Windows NT
You should create a Windows NT boot diskette as soon as you install Windows NT. This is different from a DOS boot diskette (which only boots into DOS/Windows) and the Emergency Repair Disk (which is not a bootable diskette).
- Format a blank floppy diskette from Winodws NT Explorer.
Copy the following files from C: to this diskette:
- BOOTSECT.DOS if present
You should edit BOOT.INI on the floppy to contain a boot line for every partition combination you are likely to come across, for example:
multi(0)disk(0)rdisk(0)partition(0)\WINNT="NT IDE Partition 0" /sos multi(0)disk(0)rdisk(0)partition(1)\WINNT="NT IDE Partition 1" /sos multi(0)disk(0)rdisk(0)partition(2)\WINNT="NT IDE Partition 2" /sos multi(0)disk(0)rdisk(0)partition(3)\WINNT="NT IDE Partition 3" /sos etc.
You will thank yourself for this one day.
Windows NT Emergency Recovery Disk
Whenever you change your disk configuration you should re-create your Windows NT Emergency Repair Disk (ERD) (run RDISK.EXE).
This facility is of limited use.
Once your Windows NT Registry gets too large, you won't be able to fit all of the files onto one floppy
and RDISK.EXE will exit with an error.
There is no way around this that I am aware of.
Partition Magic Rescue Disk
You can create a "rescue" disk in Partition Magic which contains a DOS version of the Partition Magic program.
This is well worth doing!