With the expert partitioner, shown in Figure 15-1, manually modify the partitioning of one or several hard disks. You can add, delete, resize, and edit partitions, as well as access the soft RAID, and LVM configuration.
WARNING: Repartitioning the Running System
Although it is possible to repartition your system while it is running, the risk of making a mistake that causes the data loss is very high. Try to avoid repartitioning your installed system and always do a complete backup of your data before attempting to do so.
Figure 15-1 The YaST Partitioner
HINT: IBM System z: Device Names
IBM System z recognize only DASD and SCSI hard disks. IDE hard disks are not supported. This is why these devices appear in the partition table as dasda or sda for the first recognized device.
All existing or suggested partitions on all connected hard disks are displayed in the list of /dev/sda (or /dev/dasda). Partitions are listed as parts of these devices, such as /dev/sda1 (or /dev/dasda1, respectively). The size, type, encryption status, 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.in the YaST dialog. Entire hard disks are listed as devices without numbers, such as
Several functional views are available on the lefthand RAID, Volume Management, Crypt Files, or view file systems with additional features, such as BTRFS, NFS, or TMPFS.. Use these views to gather information about existing storage configurations, or to configure functions like
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 SUSE® Linux Enterprise Server, 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).
HINT: IBM System z: Hard Disks
On the IBM System z platforms, SUSE Linux Enterprise Server supports SCSI hard disks as well as DASDs (direct access storage devices). While SCSI disks can be partitioned as described below, DASDs can have no more than three partition entries in their partition tables.
Every hard disk has a partition table with space for four entries. Every entry in the partition table corresponds 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 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 be divided into logical partitions itself. 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 occupy the entire remaining free cylinder range. Then create multiple logical partitions within the extended partition. The maximum number of logical partitions is 63, independent of the disk type. It does not matter which types of partitions are used for Linux. Primary and logical partitions both function normally.
HINT: GPT Partition Table
If you need to create more than 4 primary partitions on one hard disk, you have to use the GPT partition type. This type removes the primary partitions number restriction, and supports partitions bigger than 2 TB as well.
To use GPT, run the YaST Partitioner, click the relevant disk name in theand choose .
To create a partition from scratch selectand then a hard disk with free space. The actual modification can be done in the tab:
Select Section 15.1.1, Partition Types).and 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
Specify the size of the new partition. You can either choose to occupy all the free unpartitioned space, or enter a custom size.
Select the file system to use and a mount point. YaST suggests a mount point for each partition created. To use a different mount method, like mount by label, select root.. For more information on supported file systems, see
Specify additional file system options if your setup requires them. This is necessary, for example, if you need persistent device names. For details on the available options, refer to Section 15.1.3, Editing a Partition.
Clickto apply your partitioning setup and leave the partitioning module.
If you created the partition during installation, you are returned to the installation overview screen.
If you want to use Btrfs (see Section 4.0,
Snapshots/Rollback with Snapper, (↑Administration Guide) and Section 1.0,
Overview of File Systems in Linux, (↑Storage Administration Guide) for more information
on Btrfs) as your default file system for a newly installed system, click
on the screen, and check . The installation system then suggests creating the
/boot partition formatted with Ext3 file system, and
the root / partition formatted with Btrfs holding a
default set of subvolumes, which you can modify with the tool later.
The root file system is the default subvolume and it is not listed in the list of created subvolumes. As a default Btrfs subvolume, it can be mounted as a normal file system.
It is possible to create snapshots of Btrfs subvolumes - either manually, or automatically based on system events. For example when making changes to the file system, zypper invokes the snapper command to create snapshots before and after the change. This is useful if you are not satisfied with the change zypper made and want to restore the previous state. As snapper invoked by zypper snapshots the root file system by default, it is reasonable to exclude specific directories from being snapshot, depending on the nature of data they hold. And that is why YaST suggests creating the following separate subvolumes.
Directories with frequently changed content.
Contains user data, such as mails.
Contains system and applications' log files which should never be rolled back.
Contains memory dumps of crashed kernels.
Contains data files belonging to FTP and HTTP servers.
Contains third party software.
HINT: Size of Btrfs Partition
Because saved snapshots require more disk space, it is recommended to reserve more space for Btrfs partition than for a partition not capable of snapshotting (such as Ext3). Recommended size for a root Btrfs partition with suggested subvolumes is 20GB.
Subvolumes of a Btrfs partition can be now managed with the YaSTmodule. You can add new or remove existing subvolumes.
Start the YaSTwith .
Choosein the left pane.
Select the Btrfs partition whose subvolumes you need to manage and click.
Click @/.snapshots/xyz/snapshot entries — each of these subvolumes belongs to one existing snapshot.. You can see a list off all existing subvolumes of the selected Btrfs partition. You can notice a number of
Depending on whether you want to add or remove subvolumes, do the following:
To remove a subvolume, select it from the list ofand click .
To add a new subvolume, enter its name to thetext field and click .
Figure 15-2 Btrfs Subvolumes in YaST Partitioner
Confirm withand .
Leave the partitioner with.
When you create a new partition or modify an existing partition, you can set various parameters. For new partitions, the default parameters set by YaST are usually sufficient and do not require any modification. To edit your partition setup manually, proceed as follows:
Select the partition.
Clickto edit the partition and set the parameters:
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. Typical values are, , , and .
To change the partition file system, clickand select file system type in the list.
SUSE Linux Enterprise Server supports several types of file systems. Btrfs is the Linux file system of choice because of its advanced features. It supports copy-on-write functionality, creating snapshots, multi-device spanning, subvolumes, and other useful techniques. ReiserFS, JFS, XFS, and Ext3 are journaling file systems. These file systems are able to restore the system very quickly after a system crash, utilizing write processes logged during the operation. Ext2 is not a journaling file system, but it is adequate for smaller partitions because it does not require much disk space for management.
NOTE: Support for Ext4 Filesystem
Because Btrfs proved to be more efficient and scalable than Ext4, SUSE Linux Enterprise Server SP2 supports only read-only access to Ext4 partitions. It is, however, still possible to access Ext4 partitions in a read-write mode — you need to install the ext4-writeable package. Please note that this operation is not supported and taints the Kernel.
Swap is a special format that allows the partition to be used as a virtual memory. Create a swap partition of at least 256 MB. However, if you use up your swap space, consider adding more memory to your system instead of adding more swap space.
WARNING: Changing the file system
Changing the file system and reformatting partitions irreversibly deletes all data from the partition.
For details on the various file systems, refer to Storage Administration Guide.
If you activate the encryption, all data is written to the hard disk
in encrypted form. This increases the security of sensitive data,
but reduces the system speed, as the encryption takes some time to
process. More information about the encryption of file systems is
provided in Section 11.0,
Encrypting Partitions and Files, (↑Security Guide).
Specify the directory where the partition should be mounted in the file system tree. Select from YaST suggestions or enter any other name.
Specify various parameters contained in the global file system administration file (/etc/fstab). The default settings should suffice for most setups. You can, for example, change the file system identification from the device name to a volume label. In the volume label, use all characters except / and space.
To get persistent devices names, use the mount option, or . In SUSE Linux Enterprise Server, persistent device names are enabled by default.
NOTE: IBM System z: Mounting by path
Since mounting by ID causes problems on IBM System z when using disk-to-disk copying for cloning purposes, devices are mounted by path in /etc/fstab on IBM System z by default.
If you prefer to mount the partition by its label, you need to define one in the HOME for a partition intended to mount to /home.text entry. For example, you could use the partition label
If you intend to use quotas on the file system, use the mount option Section 12.3.5, Managing Quotas.. This must be done before you can define quotas for users in the YaST module. For further information on how to configure user quota, refer to
Selectto save the changes.
NOTE: Resize Filesystems
To resize an existing file system, select the partition and use. Note, that it is not possible to resize partitions while mounted. To resize partitions, unmount the relevant partition before running the partitioner.
After you select a hard disk device (like) in the pane, you can access the menu in the lower right part of the window. The menu contains the following commands:
This option helps you create a new partition table on the selected device.
WARNING: Creating a New Partition Table
Creating a new partition table on a device irreversibly removes all the partitions and their data from that device.
This option helps you clone the device partition layout (but not the data) to other available disk devices.
After you select the hostname of the computer (the top-level of the tree in thepane), you can access the menu in the lower right part of the window. The menu contains the following commands:
To access SCSI over IP block devices, you first have to configure iSCSI. This results in additionally available devices in the main partition list.
Selecting this option helps you configure the multipath enhancement to the supported mass storage devices.
The following section includes a few hints and tips on partitioning that should help you make the right decisions when setting up your system.
HINT: Cylinder Numbers
Note, that different partitioning tools may start counting the cylinders of a partition with 0 or with 1. When calculating the number of cylinders, you should always use the difference between the last and the first cylinder number and add one.
Swap is used to extend the available physical memory. It is then possible to use more memory than physical RAM available. The memory management system of kernels before 2.4.10 needed swap as a safety measure. Then, if you did not have twice the size of your RAM in swap, the performance of the system suffered. These limitations no longer exist.
Linux uses a page called
Least Recently Used (LRU) to
select pages that might be moved from memory to disk. Therefore, running
applications have more memory available and caching works more smoothly.
If an application tries to allocate the maximum allowed memory, problems with swap can arise. There are three major scenarios to look at:
The application gets the maximum allowed memory. All caches are freed, and thus all other running applications are slowed. After a few minutes, the kernel's out-of-memory kill mechanism activates and kills the process.
At first, the system slows like a system without swap. After all
physical RAM has been allocated, swap space is used as well. At this
point, the system becomes very slow and it becomes impossible to run
commands from remote. Depending on the speed of the hard disks that
run the swap space, the system stays in this condition for about 10
to 15 minutes until the out-of-memory kill mechanism resolves the
issue. Note that you will need a certain amount of swap if the
computer needs to perform a
suspend to disk. In that
case, the swap size should be large enough to contain the necessary
data from memory (512 MB–1GB).
It is better to not have an application that is out of control and swapping excessively in this case. If you use such application, the system will need many hours to recover. In the process, it is likely that other processes get timeouts and faults, leaving the system in an undefined state, even after killing the faulty process. In this case, do a hard machine reboot and try to get it running again. Lots of swap is only useful if you have an application that relies on this feature. Such applications (like databases or graphics manipulation programs) often have an option to directly use hard disk space for their needs. It is advisable to use this option instead of using lots of swap space.
If your system is not out of control, but needs more swap after some time, it is possible to extend the swap space online. If you prepared a partition for swap space, just add this partition with YaST. If you do not have a partition available, you may also just use a swap file to extend the swap. Swap files are generally slower than partitions, but compared to physical ram, both are extremely slow so the actual difference is negligible.
To add a swap file in the running system, proceed as follows:
Create an empty file in your system. For example, if you want to add a swap file with 128 MB swap at /var/lib/swap/swapfile, use the commands:
mkdir -p /var/lib/swap dd if=/dev/zero of=/var/lib/swap/swapfile bs=1M count=128
Initialize this swap file with the command
Activate the swap with the command
To disable this swap file, use the command
Check the current available swap spaces with the command
Note that at this point, it is only temporary swap space. After the next reboot, it is no longer used.
To enable this swap file permanently, add the following line to /etc/fstab:
/var/lib/swap/swapfile swap swap defaults 0 0
From the, access the LVM configuration by clicking the item in the pane. However, if a working LVM configuration already exists on your system, it is automatically activated upon entering the initial LVM configuration of a session. In this case, all disks containing a partition (belonging to an activated volume group) cannot be repartitioned. The Linux kernel cannot reread the modified partition table of a hard disk when any partition on this disk is in use. If you already have a working 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.
For more details about LVM, see
Storage Administration Guide, (↑Storage Administration Guide).