Next Previous Contents

9. Implementation

Having done the layout you should now have a detailled description on what goes where. Most likely this will be on paper but hopefully someone will make a more automated system that can deal with everything from the design, through partitioning to formatting and installation. This is the route one will have to take to realise the design.

Modern distributions come with installation tools that will guide you through partitioning and formatting and also set up /etc/fstab for you automatically. For later modifications, however, you will need to understand the underlying mechanisms.

9.1 Drives and Partitions

When you start DOS or the like you will find all partitions labeled C: and onwards, with no differentiation on IDE, SCSI, network or whatever type of media you have. In the world of Linux this is rather different. During booting you will see partitions described like this:


Dec  6 23:45:18 demos kernel: Partition check:
Dec  6 23:45:18 demos kernel:  sda: sda1
Dec  6 23:45:18 demos kernel:  hda: hda1 hda2

SCSI drives are labelled sda, sdb, sdc etc, and (E)IDE drives are labelled hda, hdb, hdc etc. There are also standard names for all devices, full information can be found in /dev/MAKEDEV and /usr/src/linux/Documentation/devices.txt.

Partitions are labelled numerically for each drive hda1, hda2 and so on. On SCSI drives there can be 15 partitions per drive, on EIDE drives there can be 63 partitions per drive. Both limits exceed what is currently useful for most disks.

These are then mounted according to the file /etc/fstab before they appear as a part of the file system.

9.2 Partitioning

First you have to partition each drive into a number of separate partitions. Under Linux there are two main methods, fdisk and the more screen oriented cfdisk. These are complex programs, read the manual very carefully. Under DOS there are other choices, mainly the version of fdisk that is bundled with for instance DOS, or fips. The latter has the unique advantage here that it can repartition a drive without necessarily damaging existing data, unlike all the other partitioning programs.

In order to get the most out of fips you should first defragment your drive. This way you can allocate more space to other partitions.

Nevertheless, it is important you do a full backup of all your valued data before partitioning.

Partitions come in 3 flavours, primary, extended and logical. You have to use primary partitions for booting, but there is a maximum of 4 primary partitions. If you want more you have to define an extended partition within which you define your logical partitions.

Each partition has an identifier number which tells the operating system what it is, for Linux the types swap and ext2fs are the ones you will need to know.

There is a readme file that comes with fdisk that gives more in-depth information on partitioning.

Someone has just made a Partitioning HOWTO which contains excellent, in depth information on the nitty-gritty of partitioning. Rather than repeating it here and bloating this document further, I will instead refer you to it instead.

9.3 Multiple devices (md)

Being in a state of flux you should make sure to read the latest documentation on this kernel feature. It is not yet stable, beware.

Briefly explained it works by adding partitions together into new devices md0, md1 etc. using mdadd before you activate them using mdrun. This process can be automated using the file /etc/mdtab.

Then you then treat these like any other partition on a drive. Proceed with formatting etc. as described below using these new devices.

There is now also a HOWTO in development for RAID using md you should read.

9.4 Formatting

Next comes partition formatting, putting down the data structures that will describe the files and where they are located. If this is the first time it is recommended you use formatting with verify. Strictly speaking it should not be necessary but this exercises the I/O hard enough that it can uncover potential problems, such as incorrect termination, before you store your precious data. Look up the command mkfs for more details.

Linux can support a great number of file systems, rather than repeating the details you can read the manpage for fs which describes them in some details. Note that your kernel has to have the drivers compiled in or made as modules in order to be able to use these features. When the time comes for kernel compiling you should read carefully through the file system feature list. If you use make menuconfig you can get online help for each file system type.

Note that some rescue disk systems require minix, msdos and ext2fs to be compiled into the kernel.

Also swap partitions have to be prepared, and for this you use mkswap.

9.5 Mounting

Data on a partition is not available to the file system until it is mounted on a mount point. This can be done manually using mount or automatically during booting by adding appropriate lines to /etc/fstab. Read the manual for mount and pay close attention to the tabulation.


Next Previous Contents