Learning Linux

Part 0 – Where to Install Linux



Hard disk partitions

A hard disk can be a huge storage area. Using it as a single storage area is less efficient than dividing it up into smaller portions, which can each be treated as a hard drive. These portions are called 'partitions' or 'slices'. They can be created, resized or deleted using a program called a partition editor.

Benefits of Multiple Partitions

Disadvantages of Multiple Partitions

Personal Computer Partition Types

When IBM came up with their personal computer, they created a hard disk schema based on a Master Boot Record (MBR). That schema allows the creation of up to four physical partitions on a single hard drive. These partitions can be primary partitions or three of them can be primary and one can be secondary (extended).

A primary partition contains one file system. In earlier versions of Windows, the first system partition was required to be the first primary partition. The file system used for this partition could be FAT, FAT32 or NTFS.

The system partition for Linux can be anywhere, and can be one of a number of different file systems, such as ext2, ext3, ext4, ReiserFS, etc.

An extended partition can be subdivided into multiple logical partitions. This capability allows one to have more than four partitions on the hard drive.

Typical Hard Disk Partitioning

Figure 1. Typical Windows Partitioning



Microsoft OEMs no longer provide installation CDs or disks for their systems. Instead, they provide a 'restore' partition on the hard disk. This means that the typical Windows installation has at least two partitions – the restore partition and the O/S partition.

Figure 2. Simple Dual-boot Installation Partitioning

A simple Linux installation to dual-boot both Windows and Linux takes advantage of all four primary partitions. Note that a Linux swap partition is the fourth partition.

A better way to dual-boot Windows and Linux splits the home directory off as its own partition. As you can see, there are now five partitions, so one of the four original partitions has been designated as an extended partition instead. The extended partition can contain any of the Linux partitions. In the case shown above, the home partition and the swap partition are part of the extended partition.

Figure 4. Full Linux Partitioning w/Windows Restore

The partition scheme shown in figure 4 allows almost full usage of the hard drive. If the user ever wishes to remove Linux and restore the original Windows configuration, this scheme will allow them to do that.

Figure 5. Full Usage Linux Partitioning

Figure 5 shows Linux taking maximum advantage of the hard disk with no dual-boot capability. Only three partitions are used, so they can all be primary partitions.

Linux Installation Options

We have shown above that there are at least two types of Linux installations: dual-boot and standalone. There are also two more types of installations

  1. Installing within Windows (an option with the Ubuntu distribution).

  2. Installing as a virtual machine using virtualization software such as VMWare or VirtualBox.

With both of these installations, you are actually running Linux as a program that is running as a part of the original operating system, whatever that may be.

Once you have picked how you want to install Linux, you can proceed to install it.

Installing as a Dual-boot System

To install Linux so it can be dual-booted with Windows, you must first create some empty space on your hard disk in which to install Linux. This means you have to use a partition editor to change the size of the Windows partition. The reclaimed space can then be used as partitions for Linux.

IMPORTANT: Before you adjust the Windows partition, you must ensure that there are no pieces of files in the way of an adjustment. To do that, you must run two Windows programs:

  1. Run the command line program 'chkdsk'. This program ensures that there are no unconnected pieces of deleted files floating around in the Windows file system.

  2. Run the Disk Defragmenter program from Accessories | System Tools. This will move pieces of existing files so the files will end up at the start of the file system and will be (nearly) contiguous.

Running chkdsk

If you want to check the Windows C: drive, you must run the following command from a DOS prompt:

chkdsk C: /F

You will get the following response from the operating system:

Type 'Y', then press enter. Reboot your Windows system and chkdsk will be run during the boot process.

Running Disk Defragmenter

Select the defragmenter from the Start menu at Accessories | System Tools. Select Analyze, then select Defragment. You will see the following:

Once both of the programs have been run, you can then use a partitioning program to readjust the size of the Windows partition. Most live Linux distributions have a partitioning program on them and most Linux install programs also have one.



>> Part 1 - Choosing and Installing a Linux Distribution