12. Activating a new partition

Introduction

After installation it is necessary to activate all partitions that are not activated by default. Knoppix uses automount to mount the filesystems it finds automatically when you click on the icons on the desktop, but since we want to make a server system we need the partitions to be mounted at boot time.

Whether it will be to create backups on or to make a data directory, or anything else for that matter, the process of activating a partition is always similar. We will assume that the partition is already created using fdisk, but has not been made into a filesystem yet.

Formatting the partition

When you have just layed out the partition table there have been no filesystems initialized on the partitions knoppix did not need itself. The installer formatted the primary partition that it would install itself upon, but that's it. Other partitions need to be initialized before they can be used. You need to make them into a certain filesystem for these partitions to be usable. Here we describe how to do this.

The choice of a filesystem is something one can debate about forever and ever. Benchmarks favour one over another, comparing efficiency and reliability. In general, I think going for ext3 or xfs is a valid choice and both are supported by the knoppix kernel. Be aware that if you choose other filesystems some of them require kernel recompilation.

The recommended choice made here is an xfs filesystem. It has built in support in the kernel distributed by Knoppix, and support for ACLs on the filesystem.

Intitializing a partition is rather easy as the Webmin interface gives you an excellent interface to do this. All you need to do is go to Hardware section in which you should find the Partitions on Local Disks panel.

Choose a partition to initialize, and you will be provided with an interface to change the partition type, which at this moment should be "Linux", and also to Create a filesystem on this partition. After choosing "SGI (xfs)" from the popup, you can click on the "Create Filesystem" button, accept all the defaults and you are done. Here's a link to the interface page for initializing a partition.

For the interested, from the command line sudo mkfs.xfs /dev/hdb7 should do the same thing. You need only to find out the device number of the partition you wish to initialize.

Activating the partition

To activate the partion it suffices to mount it at boot time. At boot time, the file /etc/fstab decides on what partitions get to be mounted. You will need to add a line there corresponding with the partition you want to automount.

But, of course, also here you can call on Webmin to help you out. In the System section, there is a "Disk and Network Filesystems" control panel, which manages exactly this configuration file. There, you can "Add Mount" a new mount point and choose a partition on one of the disks from your knoppixbox. You can also browse the dev-tree, if you know what to look for. It's easier to choose your partition from the popup, I think. This is what it looks like.

From the command line, for instance, to mount /dev/hdb1 as the partition on which the /home/ directories will reside, add the following line to your fstab if in the case of a xfs partition:

Code listing 12.1: Adding this line to /etc/fstab will have the same effect

/dev/hdb1  /home  xfs  defaults  0  2
The first parameter describes the location of the partion, /dev/hdb1. The second one the mount point, /home. The third one is for the filesystem type, xfs, and the fourth one is dependent on the type of the file system, and is the place where you could add extra options to mount the filesystem. Usually, "defaults" is what you will want. The 0 describes whether or not the filesystem needs to be dumped sometime. No, not dumping, but dumping, which is a backup mechanism. Finally, the 2 is a number describing the pass the filesystem is checked in. First pass is for the root filesystem, second pass is for "after the root filesystem", so you can specify a 2 for all your self added filesystems. You need to specify 1 or 2 for every filesystem you want to be mounted at boot time.

Moving the /home/ partition

We will do this for the /home/ partition. You have seen how to do this, so you may just go ahead and do this as described, but one caveat is in order. There is already valid information in the /home/ directory, but mounting a new partition on that path will not throw away any files on the path in the root partition, so that's no worry.

line
Updated $LastChangedDate: 2004-11-05 23:24:59 +0100 (Fri, 05 Nov 2004) $
line
Kristof Van Landschoot
Author

line
Summary: It is good practice to have at least the /home/ directory tree on a different partition. This chapter describes how to do this.
line
Copyright 2003-2004 Coin-C bvba. Questions, Comments, Corrections? Email knoppix@coin-c.com.