Human Readable   

 

     
   
     

Hard Drive Partitioning

© Copyright Darrell Anderson.

This How-To is not a step-by-step procedure but more of a philosophical discussion to help a user prepare and plan for hard drive partitioning. The details about using various software products to perform the actual partitioning is easy to find throughout the Internet. However, few people have written why partitioning might provide certain benefits or how to plan for such benefits. I’ll discuss partitioning for both Windows and Linux.

The topic of disk partitioning typically does not arise for many users, especially Windows users. A typical Windows installation uses an entire hard drive and within that operating system maps the entire drive as the “C:” drive. The phrase “C: drive” is misleading because technically, the word drive should refer to the physical hardware while the “C:” designation should refer to the partition. That distinction becomes more apparent when the physical drive is divided into more than one partition.

Some people might ask why bother with partitioning? Just let the Microsoft people have their way and run the entire disk as the C: partition. Although partitioning will not prevent or bypass catastrophes affecting an entire drive, such as controller failures, partitioning a drive opens the door to additional possibilities. Dividing a drive into partitions allows a user to install additional operating systems, add testing partitions, provides a layer of security and protection, helps reduce administrative overhead, and can help create a more efficient user environment.

Within the current Windows philosophy Microsoft creates a directory/folder called “C:\Program Files” to store all application programs, and creates another directory called “Profiles” (pre-Windows 2000) or “C:\Documents and Settings” to store user data and configuration files. Typically within Windows a user will use a desktop icon called “My Documents” to provide quick access to those personal user files. Yet, consider a simple partitioning scheme that separates the operating system, application programs, and data files. Suppose the operating system is installed on the C: partition, application programs are stored on the D: partition, and data files are stored on the E: partition.

With only one partition a software failure might render an entire disk inaccessible, and a more serious software failure such as a virus attack could create much discomfort and grief. What happens, however, if there are separate partitions to store various files? Typically, although not always, a software disruption affects only the immediate partition instead of an entire drive.

Another common situation is reformatting and reinstalling the operating system files. If all files are stored on one partition then such a process means reinstalling application files and deciding what to do about all data files. However, if the application and data files are stored on separate partitions, such processes are easier to manage.

One benefit of partitioning is simplifying administrative tasks such as backups. If all data files are stored in a separate partition, only that partition need be copied on a regular basis. Operating system and application programs tend to be more static and need not be backed up as often. A software failure in the partitions storing the operating system or application programs might mean reinstalling that software, but a separate partition for data means only restoring the last backup. Much faster and less stressful.

Another benefit of partitioning is being able to install an alternate or parallel partition for your operating system. Should problems occur with your primary partition, an alternate partition provides you a back door to obtain access to your primary partition and maintain direct access to your other partitions. In essence, you end up with two “C:” partitions, although only one “C:” partition is used at any one time. Using a disk management utility, the other “C:” partition can be hidden to prevent disasters and failures from affecting that other partition.

Maintaining an alternate operating system partition is particularly useful within Windows because of the obnoxious registry. By design, the registry files are protected files and not directly accessible. However, using an alternate operating system partition bypasses that challenge. Using an alternate operating system partition allows a user to quickly backup or restore those files, as well as manually modifying those files using registry editor tools. An alternate operating system also allows a way to bypass the primary operating system partition in the event of a virus, spyware, or hijacking attack.

Partitioning allows a user to install additional operating systems. A user could maintain an old MS-DOS/Windows 3.11 partition, Windows 95/98, Windows NT4, Windows 2000, Windows XP, and several Linux distributions. Such a setup typically requires a separate boot loader program, but that issue is secondary and relatively trivial compared to the flexibility a user obtains when using multiple operating systems.

The primary challenge for a user who wants to partition a hard drive is not the actual partitioning but preparing. The software products used to partition a hard drive are straightforward to use, but planning helps move that process methodically and efficiently. Conservative planning also reduces or avoids future repartitioning. Successful partitioning requires some thought and doodling on paper to visualize what a user needs and might want to do. With the size of today’s hard drives, lots of empty space can remain on a hard drive to allow for future expansion.

Within the older MS-DOS and current Windows environment, a hard drive can be partitioned into a maximum of four primary or bootable partitions and one extended partition. The extended partition can be further partitioned.

Linux is more forgiving and tolerant about partitions and although the Linux operating system recognizes the partitioning scheme popularized by Microsoft, Linux does not need to abide by that scheme to function properly. Linux is happy to reside on a primary or extended partition as long as the boot loader knows where to find the Linux kernel.

By design Linux is more adaptable to partitioning because Linux treats everything as a file and at a fundamental level does not distinguish between files and devices.

Like Windows, Linux runs fine without an elaborate partitioning scheme. However, partitioning is important if a user wants to improve flexibility, reduce administrative overhead, and provide better security. A typical user probably is concerned only with dual-booting a Windows and a Linux partition, but a more adventurous user might want to experiment with several Linux distros in addition to maintaining one or more Windows partitions.

Further flexibility is possible in a multiple operating system environment because Linux recognizes and can use several different file storage systems, including the FAT-16 and FAT-32 (VFAT) file systems. Thus, a user could create a FAT-16 or FAT-32 data file partition that both Windows and Linux can use. Although Linux can read NT4/5 partitions, Linux does not (yet) dependably write to those file systems and Windows cannot read or write to Linux file systems. Regardless, being able to access data files from either operating system is impressive and convenient.

If a user wants to work with only one Linux distro, there is a probable chance that a user will perform several reinstallations or will want to perform a “clean install” when updating to a newer version of a distro. An efficient partitioning scheme allows such updating without losing personal data or configuration files, or having to install third-party application programs.

Prudent planning also allows a user to create an alternate Linux root partition similar to creating an alternate Windows boot partition. Linux users tend to experiment more than Windows users, and an alternate root partition provides a back door to access configuration files in the event of overzealous experimenting.

What would a flexible partitioning scheme look like? Consider the following example.

Partition

Purpose

Description

Size

Primary 1

DOS/Windows 3.11 operating system

When booting to this partition DOS will treat the partition as C: (FAT-16).

512 MB

Primary 2

Windows NT4, Windows 2000, or Windows XP operating system

When booting to this partition Windows will treat the partition as C: (NT4/5).

512 MB

Primary 3

An alternate partition for Windows NT4, Windows 2000, or Windows XP operating system

When booting to this partition Windows will treat the partition as C: (NT4/5).

512 MB

Primary 4

Extended Partition

Extended (1)

Windows NT4/2000/XP application programs

Within Windows will be mapped as the D: partition (NT4/5).

4 GB

Extended (2)

Data files, downloads, etc.

Within Windows will be mapped as the E: partition (NT4/5 or FAT-32).

6–10 GB

Extended (3)

Windows TEMP directory

Mapped as the F: partition (NT4/5).

1 GB

Extended (4)

Windows NT4/2000/XP spare

Mapped as the G: partition, convenient for quick or temporary backups, experimenting, etc.; (NT4/5).

2 GB

Extended (5)

Shared space

Used to share files between systems. (FAT32)

4GB

Extended (6)

Linux swap

Linux swap space

256 MB

Extended (7)

Linux /boot

Global partition to all Linux distros.

16 MB

Extended (8)

Linux /home

Global partition to all Linux distros.

2–4 GB

Extended (9)

Linux /var

Global partition to all Linux distros.

256 MB

Extended (10)

Linux /tmp

Global partition to all Linux distros.

128 MB

Extended (11)

Linux /usr/local

Global partition to all Linux distros.

512 MB

Extended (12)

Linux /opt

Global partition to all Linux distros.

512 MB

Extended (13)

Linux distro 1 /usr

Specific partition for distro 1

3 GB

Extended (14)

Linux distro 1 / (root)

Specific partition for distro 1

128 MB

Extended (15)

Linux distro 2 /usr

Specific partition for distro 2

3 GB

Extended (16)

Linux distro 2 / (root)

Specific partition for distro 2

128 MB

Extended (17)

Linux distro 3 /usr

Specific partition for distro 3

3 GB

Extended (18)

Linux distro 3 / (root)

Specific partition for distro 3

128 MB

Extended (19)

Unused/empty

For future expansion

 

Planning for a major repartitioning project requires a backup of important data files. Perhaps the safest strategy is to clone or create an exact image of your hard drive. In the event of total disaster a user then can swap hard drives, and return to a productive environment or surfing the Internet to resolve problems. Thus, a repartitioning project might mean living with an open computer box for a few days while experimenting. Creating an image to CDs also is possible, although some additional steps are necessary to restore a system to original configuration.

Prudent planning also includes creating some boot floppy disks or CDs. Boot disks are handy when learning how to install and configure independent third-party boot loaders.

Within Windows, some additional planning is necessary if a user wants to create separate partitions for application programs and data files. Some registry entries need to be modified in addition to moving files from the respective directories. The affected registry entries are those providing location pointers to “Program Files,” “Common Files,” and individual user profile directories.

Within Windows, creating an alternate boot partition for the Windows operating system means at least one pass of installing Windows to the new partition. Additionally, Windows uses its own boot loader, and some manual editing might be required of the BOOT.INI configuration file when creating an alternate operating system partition. Verifying or editing the BOOT.INI file typically is necessary even if planning to eventually use a third-party boot loader.

One benefit of creating an alternate Windows boot partition is a user need maintain that partition with only minimal updates and patches. Likewise with an alternate Linux root partition. Such partitions are for emergency purposes and recovery, and a minimal clean installation is all that is necessary or desired.

Hopefully this How-To provides a philosophical picture to help an individual plan a hard drive partitioning scheme. The scheme provided in this essay is only one example.

Finis.

Table of Contents