Читаем The Debian Administrator's Handbook полностью

The last partitioning method, called “Separate /home, /usr, /var, and /tmp partitions”, is appropriate for servers and multi-user systems. It divides the file tree into many partitions: in addition to the root (/) and user accounts (/home/) partitions, it also has partitions for applications (/usr/), server software data (/var/, and temporary files (/tmp/). These divisions have several advantages. Users can not lock up the server by consuming all available hard drive space (they can only fill up /tmp/ and /home/). The daemon data (especially logs) can no longer clog up the rest of the system.

BACK TO BASICS Choosing a filesystem

A filesystem defines the way in which data is organized on the hard drive. Each existing filesystem has its merits and limitations. Some are more robust, others more effective: if you know your needs well, choosing the most appropriate filesystem is possible. Various comparisons have already been made; it seems that ReiserFS is particularly efficient for reading many small files; XFS, in turn, works faster with large files. Ext3, the default filesystem for Debian, is a good compromise, based on the two previous versions of filesystems historically used in Linux (ext and ext2). You could also choose its successor ext4, which overcomes certain limitations of ext3 and is particularly appropriate for very large capacity hard drives. If you are particularly brave, you could experiment with the very promising btrfs, which includes numerous features that require, to this day, the use of LVM and/or RAID.

A journalized filesystem (such as ext3, ext4, btrfs, reiserfs, or xfs) takes special measures to make it possible to return to a prior consistent state after an abrupt interruption without completely analyzing the entire disk (as was the case with the ext2 system). This functionality is carried out by filling in a journal that describes the operations to conduct prior to actually executing them. If an operation is interrupted, it will be possible to “replay” it from the journal. Conversely, if an interruption occurs during an update of the journal, the last requested change is simply ignored; the data being written could be lost, but since the data on the disk has not changed, they have remained coherent. This is nothing more nor less than a transactional mechanism applied to the filesystem.

After choosing the type of partition, the software calculates a suggestion, and describes it on the screen; the user can then modify it if needed. You can, in particular, choose another filesystem if the standard choice (ext3) isn't appropriate. In most cases, however, the proposed partitioning is reasonable and it can be accepted by selecting the “Finish partitioning and write changes to disk” entry.

Figure 4.10. Validating partitioning

4.2.13.2. Manual Partitioning

Manual partitioning allows greater flexibility, allowing the user to choose the purpose and size of each partition. Furthermore, this mode is unavoidable if you wish to use software RAID.

IN PRACTICE Shrinking a Windows partition.

To install Debian alongside an existing operating system (Windows or other), you must have some available hard drive space that is not being used by the other system in order to be able to create the partitions dedicated to Debian. In most cases, this means shrinking a Windows partition and reusing the freed space.

The Debian installer allows this operation when using the manual mode for partitioning. You only need to choose the Windows partition and enter its new size (this works the same with both FAT and NTFS partitions).

The first screen displays the available disks, their partitions, and any possible free space that has not yet been partitioned. You can select each displayed element; pressing the Enter key then gives a list of possible actions.

You can erase all partitions on a disk by selecting it.

When selecting free space on a disk, you can manually create a new partition. You can also do this with guided partitioning, which is an interesting solution for a disk that already contains another operating system, but which you may wish to partition for Linux in a standard manner. See the previous section for more details on guided partitioning.

BACK TO BASICS Mount point

The mount point is the directory tree that will house the contents of the filesystem on the selected partition. Thus, a partition mounted at /home/ is traditionally intended to contain user data.

When this directory is named “/”, it is known as the root of the file tree, and therefore the root of the partition that will actually host the Debian system.

BACK TO BASICS Virtual memory, swap

Перейти на страницу:

Похожие книги