Designing an Appropriate Partition Scheme

The "Optimizing Disk Partitions" section of Chapter 2, "Improving Disk Performance," includes information about creating partitions to optimize disk performance. Some of these rules impact multi-OS installations in that they suggest tradeoffs of one OS over another. Other rules suggest ways to harmonize OS configurations. Specific issues in a multiboot scenario include:

Prioritizing Disk Access Speed Because of the way modern disks allocate sectors on their platters, early sections of the disk tend to produce faster throughput than later sections. Therefore, you should place partitions belonging to the OS you want to favor with faster disk access earlier on the disk.

Keeping OS Data Contiguous Accessing new data files usually requires moving the disk head, and this action takes time. Thus, you should keep each OS's partitions contiguous. You might make exceptions for seldom-used partitions if other factors require it, though.

For instance, the Linux /boot partition might be separated from other Linux partitions with little performance impact.

Boot Partition Requirements Some OSs have specific requirements for their boot partitions. For instance, it's almost always necessary to store certain key files in a part of the disk that's accessible to the BIOS—a limit that's referred to as the 1024-cylirider boundary. At various points in the history of the IA-32 architecture, the 1024-cylinder boundary has fallen at 504MB or 8GB. Modern systems and boot loaders usually don't suffer from these limits; they use more advanced calls that work around the 1024-cylinder limit. If in doubt, you may want to keep a Linux/boot partition, as well as boot partitions for other OSs, below the 8GB line. Some OSs must boot from primary partitions, as described next. A few, such as DOS, are limited to residing on the first 2GB of the disk.

Primary Partition Allotments The partition table used by IA-32 computers provides only four "slots" for partitions. This is why the number of primary partitions is limited to four, one of which can be an extended partition that defines additional logical partitions. Some OSs, including the BSDs and all versions of Windows, must boot from a primary partition. Thus, you may want to allocate primary partitions only as boot partitions for such OSs and boot more flexible OSs, such as Linux and OS/2, from logical partitions. All logical partitions must be contiguous, because they're held within a single "carrier" extended partition.

Note It is possible to install Wndows to a logical D: partition (or to a primaryD: partition on the same or a different physical disk), but when you do so, Wndows still requires a primary C: partition for some critical boot files. In some sense, Windows is actually installed on C:, and D: is used only for support files—albeit ones that make up the bulk of the OS.

Another factor in a multiboot environment is data transfer. Typically, having a File Allocation Table (FAT) partition you can use for data exchange between the OSs is desirable. Each OS then uses its native format for its core OS files. If FAT is an OS's native filesystem, you might forgo having a separate exchange partition; however, using an exchange partition has certain data-isolation advantages. For instance, by not mounting a Windows C: partition in Linux, you minimize the risk of accidentally damaging critical Windows files from Linux.

As an example, consider a computer that boots DOS, Windows Me, and Linux. Its partition layout might resemble the following, as revealed by Linux's fdisk:

Disk/dev/hda: 255 heads, 63 sectors, 1244 cylinders Units = cylinders of 16065 * 512 bytes

Device Boot Start

/dev/hda3 264

/dev/hda5 264

/dev/hda7 401

/dev/hda8 1039

/dev/hda9 1060

End Blocks Id System 8 64228+ 16 Hidden FAT 16 263 2048287+ b Win95 FAT32 1245 7887316+ 5 Extended 391 1028128+ 6 FAT 16 400 72261 83 Linux 1038 5124703+ 83 Linux 1059 168651 82 Linux swap 1245 1493415 83 Linux

Note Even if you were to try to reproduce the preceding partition table, you might notice some differences, particularly in partition sizes and type codes. For instance, two extended partition type codes exist, 0x05 and OxOf. Multiple codes also exist for most FAT partition types. These different codes tell Windows whether or not the partition spans the 1024-cylinder boundary. If you use Linux's fdisk, type I in the utility to see a list of type codes. Those marked as beintjBA codes are safest for use with Windows when that OS must access the disk past the 1024-cylinder mark.

This configuration allocates one primary partition for DOS and another for Windows. The DOS partition (/dev/hda1) is 63MB in size and is described as "hidden" because the boot loader has modified its partition type number to "hide" it from OSs that rely on this number. This practice is sometimes required to boot multiple Microsoft OSs. The second partition is a 2GB FAT partition for Windows, and it holds all of the Windows software. After that comes an extended partition, including a 1GB FAT data exchange partition that's accessible from all OSs. Four Linux partitions, intended as a /boot partition, a root partition, the swap partition, and a /home partition, consume the end of the disk.

This configuration, like most multiboot partition layouts, is a mass of compromises.

The DOS partition comes early because DOS has problems reading beyond the first 2GB of any disk. The Windows and exchange partitions come next to keep this block together and to avoid potential problems booting Wndows from beyond the 1024-cylinder boundary. If you wanted to risk booting Windows from the end of the disk, you could move the Windows primary partition to the end, slightly improving Linux's disk performance.

Tip Complex multiboot configurations often benefit from the use of two or more hard disks. You can place partitions intended for each OS on both disks, improving performance. The extra primary partitions may also come in handy when booting OSs that must boot from primary partitions but that aren't tied to the first physical disk, such as FreeBSD.

0 0

Post a comment