Defining Filesystems

After a primary partition has been created, you need to define the format in which a filesystem should be created on that partition, its size, and the mount point for that filesystem. Linux and Unix use the definition of mount points in the same way that Windows uses drive letters. The advantage with Linux is that the whole system is hierarchical in nature, and therefore access to data on disks, network drives, and partitions can be kept under one manageable tree structure.

Swap Partitions

The first partition you need to create is the swap partition. Most modern operating systems use swap partitions, also referred to as swap space, which provides the ability to free up memory when the memory is full by pushing processes out to the swap space on disk.

You should always create a swap partition on a Linux or Unix machine as the workload on any system can never be fully quantified beforehand and running out of physical memory without swap space causes processes to crash or be unable to execute in the first place.

The window to create a filesystem/partition can be quite daunting for new users (see Figure 1-12). SUSE and the other distributions try to make the process as simple and usable as possible. Selecting the format of the filesystem is primarily a concern when creating data partitions or for advanced users, as discussed later in the chapter. When creating a swap partition, you must select Swap as its format. You will notice that the mount point will also change to be swap because the swap partition is not mounted like a data partition but is used internally by the Linux system.

; Filesystems are discussed in more detail in Chapter 3.

Start and end cylinders are often new concepts to new Linux users who are used to data sizes being defined in mega- and gigabytes. YaST enables you to enter the size of a partition in human readable form, such as MB and GB. The start cylinder, as this is the first partition on the disk, is 0 (the start of the usable space on the disk), and the end cylinder is what we need to change. It is usually customary to select a swap size that is 1.5 times the amount of physical RAM in the system, but this is subject to much conjecture. A reasonable swap size should be considered based on the workload of the machine you will be using, and as most modern PC systems have at least 512MB, it is safe to use the standard 1.5 times physical memory. To specify that you want the swap partition to be 750MB, enter +750M in the End cylinder entry box. The + signifies that you want to add space, the number is the unit of space needed, and the M specifies that the amount of data is expressed in megabytes. You can also specify G for gigabytes, which you will be using in the following example of creating a root partition.

Creating filesystems openSUSE11.U


j Sutern Analysis <s Time 2ooe

/ Di-r.kl up Stili'ctlon


treat® td1t Qelet« Koitze IVM... RAIU... * Crypt Ftl«,.. » Mf-S... Expert.. "

After entering the size of your new swap partition, click OK to proceed.

- r ■ r j At a bare minimum, the filesystems that need to be created are the swap space and

A--.: ^ ^j a root (/) filesystem. However, for ease of use and manageability, the creation of a /home partition can help keep your personal data separate from the system partition and also enable you to keep your data if and when you do a total reinstall of Linux. See the section on ''Data Partitions'' later in this chapter for more information.

In this example you are creating the bare minimum — the swap and root partitions.

The Root Partition

After the swap space has been created, you need to configure the root (/) partition (see Figure 1-13). The root (/) partition is the most important data partition on any Linux or Unix system and is the only non-swap filesystem partition that is required in order to boot a Unix or Linux system. The root partition takes its name from the fact that it is the partition mounted at the root of the Unix/Linux filesystem, which is the directory known as /. A filesystem must be mounted on this directory to successfully boot a Linux system. The root filesystem contains core directories required to boot Linux, such as the directory through which devices are accessed (/dev); the directory containing system administration, configuration, and initialization files (/etc); the directory in which critical system libraries, kernel modules, security, and internationalization information are located (/lib); and directories containing critical system binaries (/sbin, /bin, and so on).

By default, creating this partition will automatically use the remaining unallocated space on the hard drive, which is fine for our example. However, if you need to create another partition — /home, for example — you specify the size of the partition explicitly as you did with the swap space. See the next section "Data Partitions" for an overview of why you may want to create additional partitions.

When you create a partition, you can choose the type of filesystem that you want to put onto the partition. In the Windows world, there are the FAT and NTFS filesystems, and those filesystems can be accessed from Linux, too. But for your Linux system you will use one of the native Linux filesystems, and you are given the choice at this point.

On newer versions of openSUSE (and for future versions of SLES), the default filesystem is EXT3, which is a journaling filesystem based on the original Linux EXT2 filesystem. SLES 10 and older versions of openSUSE use the Reiser filesystem as the default. The traditional EXT2 filesystem is also an option here (but in general not one you should choose because it lacks journaling capabilities), as is the advanced XFS filesystem (which is also a journaling filesystem).

A journaling filesystem dedicates a specific part of the filesystem for use as a cache of pending writes to the filesystem; this ensures that filesystem updates occur in a clean, atomic fashion and allow a fast recovery if the system is not cleanly shut down. Ordinarily, when a Linux system is shut down, it ensures that all pending writes to each filesystem have completed and then detaches the filesystems (known as unmounting them) to guarantee that all system data is consistent before the system is turned off. Using a journaling filesystem does not mean it is safe to just power off the machine as data loss can still occur when data is not completely written to the disk. But a journaling filesystem is much less likely to become corrupt in the event of sudden loss of power or some other disaster and takes less time to check for errors.

After the root partition has been created, you can review your changes (see Figure 1-14) and proceed further with the installation by clicking Next. If you want to create additional filesystems during the installation process, read the next section before clicking Next.


Reviewing changes to the partition scheme open5Ubt 11,0

Sjitem Analysis

/ ßtisklop Selection

IVH.,. RAil>. crypt Fit«.

Data Partitions

Data partitions is a generic term for partitions that are formatted as a filesystem and in which both the system and its users can store data. The partition designated as the root filesystem is a special case of a data partition because it is required in order to boot a Linux system.

The preceding sections explained how to create the swap and root partitions that must be present to successfully boot a Linux system. However, you can also create other data partitions, format them as filesystems, and specify their mount points during the installation process. On Linux systems, a mount point is simply a Linux directory through which a filesystem is made available to the system, known as mounting that filesystem. Using regular directories as mount points is a clever part of the design of Unix and Linux. If you run out of disk space on a given partition, you can add another disk to your system, create data partitions there, copy the data from existing directories to those partitions, and then mount the new partitions on the directory where the data was originally located, effectively increasing the amount of storage available to an existing system.

Today's larger disks make it attractive to create other data partitions. You have several reasons to consider creating multiple data partitions on today's disks:

■ When you boot a Linux system, the system checks the consistency of each of its filesystems (as defined in the file / etc/fstab — more about this in Chapter 3). Checking the consistency of a single, huge, nonjournaled filesystem can take quite a bit of time.

■ Filesystem corruption can occur as a result of a number of problems, such as a system crash, sudden power loss, or hardware problems. Whenever a filesystem is corrupted, repairing it (which is mandatory) can cause you to lose data. Creating multiple partitions reduces the extent to which filesystem corruption can affect a single data partition.

■ Keeping data on multiple partitions limits the chance that you can lose data during a subsequent system upgrade. Some upgrades reformat the root partition or re-create its directory structure. If your user data is stored on other data partitions, they will not be affected by changes to the root filesystem.

■ Some Linux backup software backs up data on a per-partition basis. Backing up a single huge partition can take quite a bit of time. Also, if your backups fail (such as when a tape is corrupted), you may not be able to use the backups to restore your system. Creating multiple partitions limits problems related to a backup failure to a single partition.

Chapter 3 provides more detail about creating multiple partitions and the types of filesystems supported by Linux, and provides additional reasons why you may want to create multiple partitions on your Linux system. Most types of Linux filesystems can be resized once they have been created, enabling you to customize your system's partitioning, even after the system has been installed and is running.

If you want to create multiple partitions during the installation process, you can do this by making sure that the root partition does not completely fill your disk and then creating additional partitions in the remaining space on your disk. Common parts of a Linux system that you might want to put onto separate data partitions are /boot, /home, /opt, /tmp, /var, /usr, and /usr/local. For more information on these partitions and the types of information stored there, see Chapter 3.

Was this article helpful?

0 0

Post a comment