16.9. Managing Your Partitions

We already learned from "Structure of a hard disk " what partitions are used for; and you initially set up your partitions during the installation process. DiskDrake allows you, to some extent, to resize your partitions, move them, etc.

Warning

DiskDrake is a very powerful, and therefore dangerous tool. Misuse of it can very easily lead to data loss in your hard drive. Consequently, you are advised to take some protective measures before using it:

  1. Back up your data. Transferring them on another computer, ZIP disks, etc.

  2. Save your current partition table (the table describing the partitions held on your hard drive(s)) on a floppy disk (see A Note About The Expert Mode: Save The Partition Table).

16.9.1. The Interface

Figure 16-28. DiskDrake's Main Window

DiskDrake enables you to configure each physical hard drive on the machine. If you only have one IDE disk, you will see a single hda tab below the filesystem types. This tab is in fact repeated for each hard drive, reproducing the Linux name of that drive. The tool available here allows you to control the partitioning of each drive.

The window (figure 16-28) is divided into four zones:

16.9.2. In Practice: Resize an Old Partition And Create a New One

In this section, we are going to do a little exercise that will use the more useful features of the tool. Let's imagine that you decide to use your machine as an FTP server. You then choose to create a separate /home/ftp partition in order to host the FTP files.

This is what the current /home partition looks like (figure 16-29), before any modification. We chose to shrink this partition in order to create the new one on the free some space.

Warning

In order to perform this example, you must log directly as root, not using your user account.

First of all, you need to unmount the /home partition by selecting it, then pressing the unmount button.

Figure 16-29. The /home Partition Before Resizing

As you may have guessed, just click on the Resize button. A dialog will appear (figure 16-30), in which you will choose a new size for that /home partition.

Figure 16-30. Choosing a New Size

When this is done, you will notice that the graphic representation of your hard drive has changed. The /home partition is smaller, and an empty space appears on the right. Click on that empty space and then on the Create button that just appeared. A dialog (figure 16-31) where you can choose the parameters for the new partition pops up. Change the start sector if you want to leave a new free space between the /home and /home/ftp partitions. Define the needed size, choose the filesystem you want (generally Linux native) and then enter the mount point of that partition, in our case /home/ftp.

Figure 16-31. Defining The New Partition

This is what our projected partition table looks like now (figure 16-32).

Figure 16-32. The New Partition Table

Warning

Up until now, we did not really modify the partition table, we just redesigned and rejected it. Further steps will effectively make our changes active, so if you do not intend to modify your system, click on the Undo button until you come back to the beginning.

You finally need to format (prepare to host files) the newly created partition: click on it, then on the Format button. Confirm the writing of the partition table, and then the formating of the partition. You may be asked to reboot the computer to make changes effective.

Figure 16-33. Confirming The Writing of The Partition Table

16.9.3. A Note About The Expert Mode: Save The Partition Table

Among many available features, the save and restore from file is one of the more interesting ones. It allows you to save the current partition table to a file on a disk (floppy for example) and then restore it in case you totally messed up your partition table. It can prove useful as long as you do not reformat partitions, otherwise data will be lost.


Tux on Star from MandrakeSoft Linux is a registered trademark of Linus Torvalds. All other trademarks and copyrights are the property of their respective owners.
Unless otherwise stated, all the content of these pages and all images are Copyright MandrakeSoft S.A. and MandrakeSoft Inc. 2002.
http://www.mandrakelinux.com/