Chapter 2. Advanced Disk Setup

Contents

2.1. Using the YaST Partitioner
2.2. LVM Configuration
2.3. Soft RAID Configuration

Sophisticated system configurations require particular disk setups. All common partitioning tasks may be done with YaST. To get persistent device naming with block devices, use a specific start-up script or udev. Logical Volume Management (LVM) is a disk partitioning scheme that is designed to be much more flexible than the physical partitioning used in standard setups. Its snapshot functionality enables you to create data backups easily. Redundant Array of Independent Disks (RAID) offers increased data integrity, performance, and fault tolerance.

2.1. Using the YaST Partitioner

With the expert partitioner, shown in Figure 2.1, “The YaST Partitioner”, manually modify the partitioning of one or several hard disks. Partitions can be added, deleted, resized, and edited. Also access the soft RAID and LVM configuration from this YaST module.

[Warning]Repartitioning the Running System

Although it is possible to modify the partitions in the installed system, this should be handled only by experts. Otherwise the risk of making a mistake that causes data loss is very high.

Figure 2.1. The YaST Partitioner

The YaST Partitioner

All existing or suggested partitions on all connected hard disks are displayed in the list of the YaST Expert Partitioner dialog. Entire hard disks are listed as devices without numbers, such as /dev/hda or /dev/sda. Partitions are listed as parts of these devices, such as /dev/hda1 or /dev/sda1. The size, type, file system, and mount point of the hard disks and their partitions are also displayed. The mount point describes where the partition appears in the Linux file system tree.

If you run the expert dialog during installation, any free hard disk space is also listed and automatically selected. To provide more disk space to openSUSE™, free the needed space starting from the bottom toward the top of the list (starting from the last partition of a hard disk toward the first). For example, if you have three partitions, you cannot use the second exclusively for openSUSE and retain the third and first for other operating systems.

2.1.1. Partition Types

Every hard disk has a partition table with space for four entries. An entry in the partition table can correspond to a primary partition or an extended partition. Only one extended partition entry is allowed, however.

A primary partition simply consists of a continuous range of cylinders (physical disk areas) assigned to a particular operating system. With primary partitions only, you would be limited to four partitions per hard disk, because more do not fit in the partition table. This is why extended partitions are used. Extended partitions are also continuous ranges of disk cylinders, but an extended partition may itself be subdivided into logical partitions. Logical partitions do not require entries in the partition table. In other words, an extended partition is a container for logical partitions.

If you need more than four partitions, create an extended partition as the fourth partition or earlier. This extended partition should span the entire remaining free cylinder range. Then create multiple logical partitions within the extended partition. The maximum number of logical partitions is 15 on SCSI, SATA, and Firewire disks and 63 on (E)IDE disks. It does not matter which types of partitions are used for Linux. Primary and logical partitions both work fine.

2.1.2. Creating a Partition

To create a partition from scratch, proceed as follows:

  1. Select Create.

    If several hard disks are connected, a selection dialog appears in which to select a hard disk for the new partition.

  2. Specify the partition type (primary or extended). Create up to four primary partitions or up to three primary partitions and one extended partition. Within the extended partition, create several logical partitions (see Section 2.1.1, “Partition Types”).

  3. Select the file system to use and a mount point. YaST suggests a mount point for each partition created.

  4. Specify additional file system options, should your setup require this. For details on the options available, refer to Section 2.1.3, “Editing a Partition”.

  5. Click OK+Apply to apply your partitioning setup and leave the partitioning module.

    If you created the partition during installation, you are returned to the installation overview screen.

2.1.3. Editing a Partition

When you create a new partition or modify an existing partition, set various parameters. For new partitions, suitable parameters are set by YaST and usually do not require any modification. To edit your partition setup manually, proceed as follows:

  1. Select the partition.

  2. Click Edit to edit the partition and set the parameters:

    File System ID

    Even if you do not want to format the partition at this stage, assign it a file system ID to ensure that the partition is registered correctly. Possible values include Linux, Linux swap, Linux LVM, and Linux RAID. For LVM and RAID details, refer to Section 2.2, “LVM Configuration” and Section 2.3, “Soft RAID Configuration”.

    File System

    To format the partition immediately within the scope of the installation, specify one of the following file systems for the partition: Swap, Ext2, Ext3, ReiserFS, or JFS. Refer to Chapter 17, File Systems in Linux for details on the various file systems.

    Swap is a special format that allows the partition to be used as virtual memory. Create a swap partition of at least 256 MB. Ext3 is the default file system for the Linux partitions. ReiserFS, JFS, and Ext3 are journaling file systems. These file systems are able to restore the system very quickly after a system crash, because write processes are logged during the operation. Furthermore, ReiserFS is very fast in handling lots of small files. Ext2 is not a journaling file system. However, it is rock solid and good for smaller partitions, because it does not require much disk space for management.

    File System Options

    Set various parameters for the selected file system here. Depending on the file system used, various options are offered for experts.

    Encrypt File System

    If you activate the encryption, all data is written to the hard disk in encrypted form. This increases the security of sensitive data, but slightly reduces the system speed, because the encryption takes some time. More information about the encryption of file systems is provided in Chapter 40, Encrypting Partitions and Files.

    Fstab Options

    Here, specify various parameters for the administration file of the file systems (/etc/fstab). For example, change the file system identification from the device name, which is default, to a volume label. In the volume label, you can use all characters except / and space.

    Mount Point

    Specify the directory at which the partition should be mounted in the file system tree. Select from various YaST proposals or enter any other name.

  3. Select OK+Apply to activate the partition.

2.1.4. Expert Options

Expert opens a menu containing the following commands:

Reread Partition Table

Rereads the partitioning from disk. For example, you need this after manual partitioning in the text console.

Delete Partition Table and Disk Label

This completely overwrites the old partition table. For example, this can be helpful if you have problems with unconventional disk labels. Using this method, all data on the hard disk is lost.

2.1.5. More Partitioning Tips

If the partitioning is performed by YaST and other partitions are detected in the system, these partitions are also entered in the file /etc/fstab to enable easy access to this data. This file contains all partitions in the system with their properties, such as the file system, mount point, and user permissions.

Example 2.1. /etc/fstab: Partition Data

/dev/sda1    /data1    auto      noauto,user 0 0
/dev/sda5    /data2    auto      noauto,user 0 0 
/dev/sda6    /data3    auto      noauto,user 0 0
   

The partitions, regardless of whether they are Linux or FAT partitions, are specified with the options noauto and user. This allows any user to mount or unmount these partitions as needed. For security reasons, YaST does not automatically enter the exec option here, which is needed for executing programs from the location. However, to run programs from there, you can enter this option manually. This measure is necessary if you encounter system messages such as “bad interpreter” or “Permission denied”.

2.1.6. Partitioning and LVM

From the expert partitioner, access the LVM configuration with LVM (see Section 2.2, “LVM Configuration”). However, if a working LVM configuration already exists on your system, it is automatically activated as soon as you enter the LVM configuration for the first time in a session. In this case, any disks containing a partition belonging to an activated volume group cannot be repartitioned because the Linux kernel cannot reread the modified partition table of a hard disk when any partition on this disk is in use. However, if you already have a functioning LVM configuration on your system, physical repartitioning should not be necessary. Instead, change the configuration of the logical volumes.

At the beginning of the physical volumes (PVs), information about the volume is written to the partition. To reuse such a partition for other non-LVM purposes, it is advisable to delete the beginning of this volume. For example, in the VG system and PV /dev/sda2, do this with the command dd if=/dev/zero of=/dev/sda2 bs=512 count=1.

[Warning]File System for Booting

The file system used for booting (the root file system or /boot) must not be stored on an LVM logical volume. Instead, store it on a normal physical partition.