Appendix A. Manual disk partitioning

1. Introduction
2. Default partitioning scheme in ServerAtSchool
3. Partitioning with cfdisk
4. Formatting partititions and creating fstab


1. Introduction

This appendix discusses the additional installation procedures you need to follow if you elected to partition the disk manually at section 5. Disk partitioning in chapter III. Using the text mode installation program. The following image will be on your screen.

[ selecting manual partitioning ]


2. Default partitioning scheme in ServerAtSchool

If at this point you had selected the automatic partitioning option, the installation would have created a standard partitioning scheme as shown in the table below.

Standard ServerAtSchool partitions
partition mountpoint options size (MB) comments
P1 /boot noatime
128 minimum: 50 MB
P2 (extended)     P2 contains all other partitions
E5 / noatime
256 (This is a File System Hierarchy specification)
E6 /usr noatime
512 (This is an OpenNA specification)
E7 /chroot noatime
256 (This is an OpenNA specification)
E8 /var noatime
512 (This is an OpenNA specification)
E9 /tmp noatime
512 (This is an OpenNA specification modified for ServerAtSchool)
E10 (swap) defaults 512 or 1024 512 MB if RAM <= 512 MB, 1024 MB otherwise. (This is an OpenNA specification modified for ServerAtSchool)
E11 /var/lib noatime
33% of remaining space (This is a ServerAtSchool specification)
E12 /home noatime
67% of remaining space (This is a ServerAtSchool specification)

You can use this scheme as a starting point for your own scheme. It is a good idea to take some time to consider the effects of the choices you are about to make. It is not so easy to change the size of partitions once the disk is partitioned.

One reason to split the disk in so many different partitions is to ensure that the system itself will not stop working if some runaway process causes the message No space left on device to appear in the logfiles or on the console, i.e. after completely filling the /home partition or the /tmp partition with data.

Another reason to use different partitions is to allow for different options. As you can see in the table above, two of the partitions have extra options (besides noatime and notail).

The /tmp and /home partitions do not honour the set-userid-bit in file permissions. This is done to prevent you (the 'root' user) from being tricked into changing the ownership of a file which might then be executed by a regular user, using your (root) privileges. This is a security measure.

The /tmp partition also has the option noexec. This means that it is not possible to execute binary programs located on that partition. This is done because /tmp is writeable by every user (by design). Writing as such is OK, but executing programs is not.

If you simply put the entire system on a single large partition, you cannot use this fine degree of control.


3. Partitioning with cfdisk

In this example we will be manually partitioning a 10 GB disk. In order to keep the size of the example down, we will be using the following straightforward partitioning scheme.

Example partitioning scheme
partition mountpoint size (MB) comments
P1 /boot 128  
P2 (extended)   P2 contains all other partitions
E5 / 768 (This is a File System Hierarchy specification)
E6 (swap) 512  
E7 /home remaining space, about 8.5 GB  

Note that this scheme is far from ideal; the default ServerAtSchool scheme is much better. It is only intended to be used as an illustration of manual partitioning. You should invest some time in this subject and you should design your own partitioning scheme, tailor-made for your situation.

NOTICE: We will be using cfdisk(8) in the example below, because that is the program used by the installation routine. If you need to partition a disk later on (e.g. in section 11. REOBack in chapter V. Configuring all ServerAtSchool components), you can use either cfdisk(8) or fdisk(8).

We will now continue with the partitioning procedure. In the previous dialogue, you opted for manual partitioning. When you press the [OK] button, the following dialogue appears:

[ selecting the disk for partitioning ]

You now have to select the target disk. In the example above, there is only a single disk available. However, there could be more disks present in the computer, in which case you would have to select the disk to use.

NOTICE: You can find an example of a computer with three disks in section section 7. Target drive in the chapter III. Using the text mode installation program. We will be using the menu driven cfdisk(8) program. This program can be controlled through the cursor keys and the [Enter] key. You select a command by moving the highlight with [Cursor Left] or [Cursor Right] and then press [Enter] to confirm your selection.

You can select a partition from the list of partitions using the [Cursor Up] and [Cursor Down] keys.

The following commands are available.

This command toggles the bootable or active flag. There should be at least one bootable partition. If there is no bootable partition, Linux will not be able to boot. In the example below we will set the bootable flag for the partition /boot on /dev/hda1.
If a disk has already been used, one or more partitions may already have been defined. With this command you can remove these partitions from the partition table.
This command gives you access to the on-line help of the cfdisk(8) program.
This command allows for making a partition as large as the disk space will allow. Note that this command might prove incompatible with non-Linux partitions on dual-boot computers. If you have a Linux-only server this command is safe to use.
This command allows you to show the partition table on the screen or write it to a file (for future reference). This way you can check your new partition table. Note however that you cannot save the output on a disk which you have just partitioned becase a new or changed partition has to be formatted first.
This is the command to end the cfdisk(8) program.
This command is used to change the type of a partition. By default all new partitions are of type 83 Linux. For a swap partition you have to change the type to 82 Linux swap.
This command can be used to change the display of partition size. You can choose either MB, cylinders or sectors.
This command is used to write the partition table to disk. It is a potentially destructive command because it can result in data loss. For added safety, an explicit confirmation is required before the partition table is actually written to disk.
If you happen to have a disk that has already been used, you may see the following screen:

[ deleting existing partitions ]

Please delete any existing partitions by using the [Delete] command. After all partitions have been deleted, or if you started with an empty disk, you will see the following:

[ adding the first new partition ]

The cursor in the list of partitions is located on a line that says 'Pri/Log Free Space 10001.95'. This is the only line in the list. This means that no partitions have been defined yet. Use the [New] command to create a new partition. The following dialogue appears:

[ select a primary partition ]

Here you can choose between creating a primary partition and creating a logical partition. We will be starting with the partition P1 (see the table at the top of this section). Select the option to create a primary partition. The following dialogue will be displayed:

[ enter partition size 128M ]

Please enter the size of the partition (in MB). Type the number 128, then press the [Enter] key.

NOTICE: By default cfdisk(1) shows you the remaining space when defining the size of the new partition. In this example the default remaining space is 10001.95 MB. If, instead of typing a new value, you had simply pressed [Enter], you would have accepted the default value. You can get rid of the default value by pressing [Backspace] or by simply starting to type the new value, 128.

The following dialogue will be displayed:

[ locating the partition at the beginning ]

Place this partition at the beginning of the disk.

NOTICE: Putting the partition at the beginning of the disk is especially handy for the boot partition since some computer BIOSes have problems with booting from a partition that is located above the 1023 cylinders limit. By choosing a reasonable size (128 MB) and starting with this boot partition as the first partition at the beginning of the disk you will have no problems with this limit. If you want to make sure that the partition is within the limit, you can use the [Units] command to display the size in cylinders rather than MB's.

Use [Cursor Down] to move the white menu bar to the line that reads 'Pri/Log Free Space'. In the following dialogue you can see that the first partition (/dev/hda1) has been defined.

[ the first partition has been defined ]

You should now repeat this procedure and add the second and third partitions.

The second partition should be a 'Logical' partition to be located at the 'Beginning'. The size should be 768 MB. This partition will become the root partition (also known as '/').

The third partition should also be a 'Logical' partition located at the 'Beginning'. The size should be 512 MB. This will become the swap partition.

Once you have defined the third partition, you will see the following dialogue:

[ changing the type of the partition ]

Use the [Type] command to change the partition type. The following list of partition types will be displayed:

[ list of available partition type 1/2 ]

After pressing [Enter] even more partition types will be displayed:

[ list of available partition type 2/2 ]

Accept the default value of 82 by pressing [Enter]. This partition is indeed meant to be a swap partition.

After this you should add one more partition. This will also be a 'Logical' partition. The partition can occupy the remainder of the disk. You can therefore simply press [Enter] to accept the default size as shown in the image below.

[ accept default remaining space as  partition size ]

This partition, too, should be located at the 'Beginning'.

Finally you should change the boot flag of the first partition. Move the menu bar to the first partition as shown in the image below.

[ set the active or boot flag for the boot partition ]

Now select the [Bootable] command. The word 'Boot' will appear in the column labeled 'Flags'.

All partitions have now been defined. If you are satisfied with the partition table as it is now, after perhaps checking it with [Print], it is time to store the table on disk.

NOTICE: Up to this point, nothing irreversible has been done to the disk. You could even bail out now without changing anything on the disk, by using the [Quit] command.

If you are ready to save the partition table, select the [Write] command. If you do, the following dialogue will be displayed:

[ confirmation of writing partition table ]

As soon as you enter 'yes' here (not just the letter 'y' but a full 'yes' followed by pressing [Enter]), the new partition table will be written to disk. When that is done, you can end the cfdisk program by selecting [Quit].

You will be returned to the installation procedure.


4. Formatting partititions and creating fstab

Selecting the [Quit] command in cfdisk(8) ended the program. The following dialogue will now be displayed:

[ swap partition detected ]

Press the [OK] button to proceed. The swap partition that was detected will now be formatted automatically. After a brief message to that effect the following dialogue will be displayed:

[ swap partition has been formatted and will be added to fstab automatically ]

Press the [EXIT] button. The following dialogue will be displayed:

[ select the partition that will be the root of the file system]

Here you must select the partition that will be used as the root partition (also known as '/'). In this example /dev/hda5 will be the root partition. Select the correct partition and press the [OK] button to continue. The following dialogue will be displayed:

[ formatting the partition with checks for bad blocks ]

Here you should choose the 'slow' format with a check for bad blocks.

NOTICE: This so-called 'slow' format usually is not so very slow. Furthermore, the extra minutes (or maybe hours) spent now are insignificant compared with the uptime you hope to get (a year or even more). It is a good idea to check for bad blocks. Hard disks are imperfect mechanical devices. It is better to learn that a disk is bad during installation than to have it fail when the server is in full production.

Press the [OK] button to confirm your choice. The following dialogue will be displayed:

[ selecting ReiserFS as root filesystem ]

Select the file system you want to use on the partition. ReiserFS is highly recommended but you are free to choose another one. Press the [OK] button to confirm your choice. Formatting of the disk will begin.

During format a message will appear on screen that the partition is being formatted. After formatting, another message box will appear to inform you that the root file system has been mounted. After that the following dialogue will be displayed:

[ select the next partition to be formatted ]

This dialogue shows that other Linux partitions were detected. Select the partition /dev/hda1 and format it like you did with the root partition, i.e. using a 'slow' format and ReiserFS. When this partition is ready, the following dialogue will be displayed:

[ select the mountpoint of the  partition ]

In this dialogue you should specify the mount point for this partition. From the table at the top of section 3. Partitioning with cfdisk above, it follows that this partition is to be mounted at /boot.

Please enter /boot as the mountpoint and press the [OK] button to proceed.

Repeat the procedure of 'slow' formatting and ReiserFS for the remaining partition, using the mount point /home.

NOTICE: This procedure can be repeated for all partitions that were detected, even partitions that happen to exist on other disks. However, you do not have to assign all partitions at this point. If you select the option ---   (done adding partitions, continue with setup), you will leave the partitioning loop to proceed with the next step.

NOTICE: If the second and third disks in the server have not yet been partitioned, they will not show up in these dialogues. You will have to perform the partitioning and formatting operations manually at a later stage. See sections 11.1 Creating a backup partition and mount point and 11.5.1 Preparing the buddies partition in chapter V. Configuring all ServerAtSchool components.

When all this is done, the folllowing dialogue with an overview of the defined partitions will be displayed:

[ the final fstab ]

At this point you can press the [EXIT] button in order to proceed. The installer will now continue with the regular installation procedure and ask you which server to install. This is shown below.

[ selecting the server type (SAS) ]

You will now be presented with the same list of options you would have been shown if you had chosen automatic partioning, for you to make your choice of server type.

NOTICE: By following the manual partition procedure as described in this appendix, you will be skipping section 7. Target drive, as that part will have been taken care of by the manual partitioning and formatting procedure.

NOTICE: Due to the way this procedure for manual partitioning is implemented, it is not possible to optimise the various options in the file system table fstab. Two standard options have been added (noatime and notail) but if you require other options you should add them later, after the server has been booted for the first time.

You can now continue with the procedure in section 6. Type of installation (SAS) in chapter III. Using the text mode installation program.


Author: Peter Fokker <peter (at)>
$Id: partitioning.html,v 1.9 2006/03/31 18:16:08 peter Exp $