Operating Systems and Systems Integration

Partitioning the hard disk

1 Aim

A hard disk needs to be divided into one or more sections called partitions. We will install a number of operating systems onto our hard disks. Each operating system needs at least one partition. We will use the Linux fdisk program to create these partitions today. Later, in your subject Systems and Network Administration, Albert will show you how to install Windows 2000 (and possibly Windows NT) into some of these partitions. Our aim for today is to create the partitions necessary for installation of all these operating systems.

2 Background

2.1 Types of partition

On an ibm pc compatible, there are a few types of partition:

type  max number location
primary  4  outside of any other partition
extended  1  outside of any other partition
logical  no limit  inside an extended partition

The total number of primary and extended partitions must be four or less.

2.2 Limitations of IBM PC BIOS

The computers we use are compatible with the original ibm pc. The bios (Basic Input Output System) also remains compatible with the original machine, and has the following limitations:

parameter number of bits maximum value
cylinders  10  1023
heads  8  255
sectors  6  63

To boot an operating system on a PC, the bios must be able to load the first part of the operating system. The first part of the operating system must be on a location on the hard disk within these limitations. In particular, the boot files of the operating system must be entirely below cylinder 1024, or the computer may not be able to boot.

Partitioning the hard disk Operating Systems and Systems Integration

2

2.3 Disk and partition naming scheme in Linux

The motherboards of the computers in the lab have two 40-pin ide connectors: one is called the primary ide bus, the other the secondary. A ribbon cable connects to each of these connectors. There are two female sockets on each cable. One connects to a disk configured as the master, the other to the slave. Jumpers on the hard disk determine whether the disk is the master or slave.

The naming scheme for the disks is:

name primary/secondary master/slave
hda  primary  master
hdb  primary  slave
hdc  secondary  master
hdd  secondary  slave

Partitions are named with the first three letters being that of the hard disk. Added to this is a number. A primary partition may be numbered 1 to 4 (i.e., on our hard disks, hda1, hda2, hda3 or hda4). Logical partitions start with the number 5, so on hda, the logical partitions are called hda5, hda6, hda7,…

2.4 Our partitioning scheme

The partitioning scheme we use here will look like figure 1.

Figure 1: The partioning scheme we will use for our hard disk.

We will create all these partitions today.

We will use the Linux installation procedure to run fdisk to partition the removable hard disk.

3 Procedure

Hard disks are very delicate. Treat them as if they were very fragile and very expensive (they are!). Never plug or unplug a removable hard disk in while the power is on. Wait

Partitioning the hard disk Operating Systems and Systems Integration

3

at least fifteen seconds before putting the hard disk in or removing it from the computer.

1. Either make a network boot floppy disk or take one from the technician or from the lecturer.

2. Install the removable hard disk. This will be the master device on the primary IDE bus.

3. Put the floppy disk into the drive and reboot the machine.

4. The installation screen for Red Hat Linux will appear.

5. Accept defaults for language and keyboard.

Figure 2: The screen where you select using FTP for the network installation method.

6. For installation type, select FTP. See figure 2.

7. When asked for the IP address of the computer, select Use DHCP by pressing the space bar. See figure 3 on the following page.

8. For address of the server, put CSAlinux

9. For directory of the installation, put pub/CSAlinux See figure 4.

10. When asked what disk you want to install on, select /dev/hda. This is very important; do not partition /dev/hdc, or Patrick the technician will need to stay back and re-install the operating system for the other classes; he will be very upset!!! Be very careful.

11. The lecturer will demonstrate the partitioning procedure. Make sure that you ask questions if you are unsure. If you make a mistake and partition the wrong hard disk, you will upset many people. The common fdisk commands that you will use are:

Partitioning the hard disk Operating Systems and Systems Integration

4

Figure 3: The screen where you select using DHCP for TCP/IP parameters.

Figure 4: The screen where you select the server to do the network installation from.

command name  action
m  menu  show a list of all the commands
p  print  display the partition table
n  new partition create a new partition
d  delete  delete a partition (good if you make a mistake!)
a  active  make a partition active
q  quit  exit without saving the table. Great if you really

mess it up!

w write Write changes to the disk. w. After that, it’s very hard to undo your changes, so thing three times before pressing w.

Nick Urbanik <nicku@vtc.edu.hk>  ver. 1.3