# The &kvpm; Handbook

## Introduction

The KDE Logical Volume and Partition Manager can manipulate logical volumes, physical volumes and volume groups as defined by the Linux Logical Volume Manager, LVM2. It can also write a partition table or modify an existing one to add, delete or resize partitions. This guide assumes a basic knowledge of LVM2 operation and disk partitioning. The following is a good starting point for learning the basics of LVM2: http://tldp.org/HOWTO/LVM-HOWTO/

Currently most LVM functions are implemented by the standard lvm command line programs. KDE dialog boxes are used to determine the parameters to pass the program. If you are already using lvm on the command line the dialogues will probably seem familiar. For example this is the dialog to change a logical volume's attributes: Logical volume change attributes dialog &kvpm; change attributes dialog

## Getting Started

### The Storage Devices Tab

When first started on a system with no volume groups the screen will look something like this:

This is a screenshot of &kvpm; when first started &kvpm; main window

#### Storage Device Tree

The devices found are listed in the large tree list to the left. Clicking the &LMB; to select a device brings up additional information on the properties pane to the right. The colored bar across the top of the tab also gives a visual of the partitioning of the highlighted device. Clicking the &RMB; over the name of a device calls the context menu of actions that can be taken on that device. Any action that can be called from the context menu can also be called from the toolbar by selecting the device desired with the &LMB; and then pressing a button on the toolbar

#### Storage Device Bar

The device represented by the colored bar across the top is the one currently selected in the device tree, as described above. Each partition is represented by a segment of the bar. Right-clicking on a segment or free space on the device will call a context menu of partitioning operations. The colors indicate either the filesystem type in use on the partition or the type of partition. By default the partition type determines color but it is a user configuration option. Clicking the &RMB; over a device or partition calls the context menu of actions that can be taken on it.

### A Volume Group Tab

Below in an example of a volume group called vg1. If more than one group exists, additional tabs are used, one for each group, with the group name on the tab.

This is a screenshot of a typical volume group. a typical group

#### Volume Group Information Panel

Across the top of the window, below the toolbar, is an information panel about the volume group as a whole. It shows the size of the group, the amount of space used up and how much is still left. There are also entries for the uuid, clustering status, default allocation policy, metadata areas, whether resizing is allowed and the extent size.

#### The Logical Volume Bar

Below the volume group information panel is a graphical representation of the group in the form of a bar divided into segments. There are three logical volumes in this group. Each volume is represented by a bar segment according to its relative size and has a color representing the filesystem, if it has one, or the type of logical volume, depending on the user's configuration preference. The last segment of the bar is green and depicts the free space remaining. Clicking the &RMB; on a segment of the bar calls the context menu of actions that can be taken on the logical volume that was clicked. The menu also has an entry for creating new volumes.

#### Logical Volume Tree

The large tree list at center left shows the logical volumes by name, along with some information about them. Selecting a name in the list window shows additional information about that volume in the pane on the right right. Here, the volume lvol1 is selected. Clicking the &RMB; over the name of a volume calls the context menu of actions that can be taken on that logical volume. There is also an entry in the menu for creating new volumes. Any action that can be called from the context menu can also be called from the toolbar by selecting the volume desired with the &LMB; and then pressing a button on the toolbar

Because volumes often have an underlying structure, such as segments or mirror legs, the logical volumes are listed in tree form. Snapshots are also grouped under their origin volume. Clicking on an item in the tree will expand or collapse the branch if the item has more items under it.

#### Physical Volume Information

The last two panels at the bottom deal with physical volumes. The left tree list shows the physical volumes by name with basic information, while the right panel gives more detailed information. Clicking the &RMB; on the name list brings up a context menu of actions that can be taken on the physical volume.

## Storage Devices

### Working With Storage Devices

Nearly any action that can be taken on a device is done from the device context menu, discussed next, or the equivalent tool bar. It has menu entries for the creation, deletion, extension and reduction of partitions and a variety of other changes that can be made to a device. There is also a sub-menu for working with or writing filesystems on the device.

### The Storage Device Context Menu

This is a pop-up menu activated with the &RMB;. See The Storage Device Bar and The Storage Device Tree for information on calling this context menu.

Partitioning is inherently dangerous. It is highly recommended that all data be backed up before making any changes to a device or its partitions.

Create or remove a partition table

- Writes a new partition table to the device or erases an existing table. Both GUID (GPT) and traditional MS-DOS type tables are supported. Any partitions or data on the device will be permanently lost.

Delete disk partition

- Deletes a partition on the device. Any data on it will be lost permanently.

Add disk partition

- Creates a new partition on the device.

Move or resize disk partition

- Move, grow or shrink an existing partition.

Change partition flags

- Changes flags, such as the boot flag.

Extend physical volume to fill device

- If the device or partition is larger than the physical volume thinks it is, this will extend the volume.

Create volume group

- Create a new volume group using the selected device or partition.

Remove from volume group

- Remove the device or partition from the its volume group.

Extend volume group

- Add the device or partition to an existing volume group.

#### Filesystem Operations On Devices

The Filesystem operations sub-menu provides five common menu selections for working with a filesystem. Details are provided under Filesystem Operations.

### Adding a new partition

To add a new partition select Add disk partition from the storage device context menu or the tool bar on the devices tab.

This is a screenshot of a dialog for creating a new volume partition. add a disk partition

At the top is a graphic that represents the size and position of the new partition relative to the free space it is going into. The blue bar is the partition and the green is the left over space around it.

The combo box labeled Select type can be set to Primary, Logical or Extended if the partition table is MS-DOS. If it is a GUID partition table (GPT) only Primary is allowed and the combo box is disabled. The usual limits to MS-DOS partitions, such as only four primary partitions or three primary and one extended partition, also apply.

The size of the partition can be set with the upper slider or can be typed directly into the text box above it. A combo box next to the text box changes the input numerical value between megabytes, gigabytes and terabytes. Once the size is set it can be locked before setting the partition's starting position. By default the partition will be as large as the available free space.

By default the partition will start at the beginning of available free space on the device. By unchecking Lock partition start the partition can be placed anywhere in the free space. If the partition size is not locked changing the start may make the partition smaller. Conversely, making the partition larger after setting the start may move the start towards zero if the start is not locked.

Clicking Reset will make the partition as large as possible.

### Changing an existing partition

To change a partition select Move or resize disk partition from the storage device context menu or the tool bar on the devices tab.

This is a screenshot of a dialog for creating a new volume partition. add a disk partition

At the top is a graphic that represents the size and position of the partition relative to any free space around it. The blue bar is the partition and the green is the available free space. The text below indicates the partition is going to be moved 512 megabytes towards the start of the disk and will be 512 megabytes larger.

The size of the partition can be set with the upper slider or can be typed directly into the text box above it. A combo box next to the text box changes the input numerical value between megabytes, gigabytes and terabytes. Once the size is set it can be locked before setting the partition's starting position.

By unchecking Lock partition start the partition can be placed anywhere in the free space. If the partition size is not locked changing the start may make the partition smaller. Conversely, making the partition larger after setting the start may move the start towards zero if the start is not locked.

Clicking Reset will reset the partition to its original size and starting point.

Not all filesystem types can grow or shrink so some operations may not be available.

## Volume Groups

### Working With Volume Groups

Most actions that can be taken on a Volume Group are done from the Volume Groups menu discussed next. It has menu entries for the creation, deletion, extension and reduction of Volume Groups and a variety of other changes that can be made.

The Volume Groups Menu is located at the top of the main program window. Except for Create volume group all of the menu choices act on the currently selected volume group tab. If the Storage devices tab is selected, or there are no existing volume groups, only the Create volume group choice will be available.

### The Volume Groups Menu

Volume Groups Create volume group

- Create a new volume group.

Volume Groups Delete volume group

- Delete the volume group. A group must be empty before it may be deleted.

Volume Groups Rename volume group

- Rename the volume group.

Volume Groups Remove missing physical volumes

- Remove any missing physical volumes. This may cause data loss, use with caution

Volume Groups Extend volume group

- Extend the volume group by adding new physical volumes.

Volume Groups Reduce volume group

- Reduce the volume group by removing physical volumes.

Volume Groups Split volume group

- Split the volume group into two groups.

Volume Groups Merge volume group

- Merge the volume group with another.

Volume Groups Export volume group

- Export the volume group.

Volume Groups Import volume group

- Import the volume group.

Volume Groups Change volume group attributes

- Call a dialog that allows many group attributes to be modified.

### Creating a Volume Group

To create a new volume group select Volume Groups Create Volume Group. A dialog box will ask which devices to use, its name and other pertinent questions about the new group. I have checked several devices and entered the name MyVolumeGroup. After the dialog's OK button has been pressed notice the new tab titled MyVolumeGroup is now present on the main window.

This is a screenshot of &kvpm; creating a new volume group. create a volume group

Because &kvpm; uses the lvm2app library to create volume groups, not all options of the command lvcreate are available here yet. Some, such a clustering, need to be selected from the Volume Groups Change volume group attributes dialog discussed later.

### Splitting A Volume Group

By selecting Volume Groups Split Volume Group a volume group can be split into two groups.

This is a screenshot of the volume group split dialog. split a volume group

The dialog has two views. One view shows which logical volumes will remain in the original group and those being moved to the new group. The other view shows the physical volumes that will be in each group. All volumes will start in the original group. By selecting a volume with the &LMB; and then pressing Add or Remove they may be moved as needed. The new group must be given a name, which can be entered at the top. Any physical volume that has a busy or mounted logical volume on it will be greyed out and moving it will be disabled.

Moving a volume between groups may cause other volumes to move as well. When a logical volume is moved it takes all of its physical volumes with it because they cannot be split across groups. That, in turn, may pull other volumes. In the same fashion, one volume that is mounted and can't be moved may cause others to become impossible to move.

### Remove Missing Physical Volumes

By selecting Volume Groups Remove missing volumes a volume group with missing physical volumes, a failed disk drive for example, can have them permanently removed. This dialog has only two options, either all missing volumes will be removed or only those that were empty and unused. If removing all missing volumes is chosen and some of the missing volumes had logical volumes or thin pools on them then any unmirrored data they held will be permanently deleted.

Removing missing volumes can result in data loss

### Changing a Volume Group

By selecting Volume Groups Change Volume Group Attributes a wide variety of changes can be made to the group.

This is a screenshot of the volume group change dialog. change a volume group

Most Volume group attributes may be changed here with some restrictions. For example: changes in the extent size depend on the alignment of allocated extents, so some sizes my not be possible. Also, a volume group can not be made unavailable if it contains mounted or otherwise busy volumes.

Do not enable cluster support unless there is a working cluster running. Switching off cluster support or using the volume group with it enabled is difficult without a cluster.

## Logical Volumes

### Working With Logical Volumes

Nearly any action that can be taken on a logical volume is done from the logical volume context menu discussed next or the equivalent tool bar. It has menu entries for the creation, deletion, extension and reduction of logical volumes and a variety of other changes that can be made to a volume. There are also two sub menus, one for changes in mirroring and another for handling or writing filesystems on the volume.

### The Logical Volume Context Menu

This is a pop-up menu activated with the &RMB;. See The Logical Volume Bar and The Logical Volume Tree for information on calling this context menu

Create logical volume

- Creates a new logical volume.

Create thin pool

- Creates a new pool for thin provisioned logical volumes.

Create thin volume

- Creates a new thin provisioned logical volume.

Delete logical volume

- Deletes the selected logical volume, thin pool or thin volume.

Rename logical volume

- Renames the logical volume, thin pool or thin volume.

Create snapshot

- Creates a snapshot volume based on the selected volume.

Create thin snapshot

- Creates a thin provisioned snapshot volume based on the selected volume.

Merge snapshot

- Merges the snapshot with it logical volume origin.

Reduce logical volume

- Reduces the size of the logical volume.

Extends logical volume

- Enlarges the size of the logical volume.

Move physical extents

- Move the logical volume's extents to other physical volumes.

Change attributes or tags

- Changes the logical volume's attributes, such as allocation policy, or tags.

#### Mirror Operations on Volumes

The following five menu choices allow converting an existing volume into a mirror, changing a mirror or converting a mirror back into a linear volume.

Mirror operations Add mirror legs to volume

- Add one or more mirror legs to the volume, convert it to a mirror if it isn't already.

Mirror operations Change mirror log

- Change the log type for a non-RAID mirror.

Mirror operations Remove mirror legs

- Remove one or more mirror legs.

Mirror operations Repair RAID or mirror

- Remove or replace missing physical volumes under mirror or RAID.

Mirror operations Re-sync RAID or mirror

- Re-synchronize a RAID or mirror volume's underlying elements.

#### Filesystem Operations on Volumes

The Filesystem operations sub-menu provides five common menu selections for working with a filesystem.

Details are provided under Filesystem Operations.

### Creating a Logical Volume

If a volume group exists and has free space, a logical volume can be created in it. Select the tab titled with the name of the volume group you wish to work with first. Then a dialog can be called up by right clicking on the long green bar or the (still empty) table below it and selecting Create logical volume. The toolbar also has an equivalent button. I have called the volume VolumeOne and it will take 20 GiB of the available space.

This is the volume group A dialog for creating logical volumes

### Converting Mirrors

To create a mirror from a linear volume, bring up the logical volume context menu and select Mirror operations Add mirror legs to volume. Then select the physical volumes and other options from the dialog. Mirrors may be the original LVM2 mirrors or RAID. A mirror may be created with multiple legs or as few as two and non-RAID mirror legs can be striped. When the dialog is finished the data on the original linear volume will be copied to the new mirror leg or legs and synchronized.

If creating a non-RAID mirror remember to account for the space the mirror log takes when selecting physical volumes. Depending on configuration LVM may require separate physical volumes for logs.

A mirror can be returned to a linear volume by removing all but one of its mirror legs. This can be a convenient way to move data on a mounted volume. Simply create a new mirror leg on the destination physical volume and wait for the mirror to sync. When finished, remove the source mirror leg and the remaining leg will have all the original data.

## Filesystem Operations

### Working With Filesystems

The Filesystem Operations menu is available under the Logical Volume context menu and the Storage Device context menu.

Filesystem operations Mount

- Mount the filesystem under a directory.

Filesystem operations Unmount

- Unmount the filesystem.

Filesystem operations Extend filesystem to fill volume

- If the filesystem is smaller than the volume that contains it, extend it.

Filesystem operations Run fsck -fp on filesystem

- Force fsck to preen a filesystem, use with caution.

Filesystem operations Make or remove filesystem

- Write a filesystem on the volume or write zeros at the beginning to remove the filesystem.

### Mounting a Filesystem

#### Filesystem Type

The main tab of the filesystem mount dialog provides a list of the most common filesystem types that may be selected. The dialog attempts to identify the type and check the correct radio button in advance. If needed the user may select Specify other and write the correct type into the dialog. There is also a place to enter the desired mount point and a Browse button for convenience. It is possible to mount a filesystem at multiple locations.

Mounting a filesystem Mounting a filesystem

#### Mount Options

The options tab of the filesystem mount dialog provides a list of the most common mount options and a place to write in a comma separated list of any additional options required. If unsure, it is generally safe to leave these at the default.

Mounting a filesystem Mounting a filesystem

### Writing a Filesystem

In the following dialog the device /dev/MyVolumeGroup/MyVolume has been selected to write a new filesystem on. The type ext4 has been chosen and the beginning of the volume will be zeroed out to erase the old filesystem.

Writing a filesystem Writing a filesystem

If ext2, ext3 or ex4 are selected the Standard Ext Options tab will be enabled. Selecting ext4 also enables the tab labeled Additional Ext4 Options. This dialog may also be used to create Linux swap space. Most filesystem types also allow an optional short text label which can be supplied here.

It is not necessary to erase the old filesystem but doing so is recommended. If the old filesystem is of a different type, the remaining traces of it can fool &kvpm; and other programs into misidentifying the new filesystem.

&kvpm; uses the standard system programs to write filesystems. If a filesystem type is chosen for which the needed program is missing, &kvpm; will generate an error message and otherwise do nothing. See also, Programs.

#### Standard Options For Ext2, Ext3 and Ext4

Writing an ext filesystem Writing a filesystem

#### Ext4 Only Options

Writing an ext4 filesystem Writing a filesystem

## Configuring &kvpm;

### The Configuration Dialog

There are many aspects of &kvpm; that may be configured or customized. To access the configuration dialog select Settings Configure &kvpm;

The dialog has three pages:

General

- Configures the data to display or hide.

Colors

- Configures the colors used to represent different types of filesystem or types of partitions and volumes.

Programs

- Configures the places to look for support programs.

### General

The General page is the largest of the three pages and has two tabs. The first tab Tree Views is for configuring the tree and table views. The second tab Property Panels deals with the property panel that each tree or table has associated with it. See here for more detail on the layout of the trees and panels. Any changes made to the configuration may be reverted to the default simply by pressing the Defaults button at the bottom of the dialog.

#### Tree Views

The columns of each tree my be hidden or shown as desired by clicking on the appropriate check box. For example, to hide the mount point column in the device tree, find the section titled Device Tree and uncheck the check box labeled Mount point. Some information, such as stripe size, is duplicated in the property panel and may be hidden by default in the tree view. The amount of space left on a device or volume may be set to show as a percentage of the the total space, in Mega/Giga/Tera bytes or both. There is also an option to enable a warning icon in the remaining column when the amount of space left drops below a user set level.

#### Property Panels

The panels are divided into sections which may be, optionally, shown or hidden. Checking a box enables showing the section while unchecking it will hide the section.

### Colors

The Colors page is for customizing the colors used where devices or volumes are shown graphically. For devices the color can be configured to represent the device, such as one color for logical partitions and another for primary partitions. For volumes the color would be different between RAID and linear for example. The other option is to have the color represent the filesystem type on the device, if there is one. Colors can be changed by clicking on the color picker buttons.

### Programs

The Programs page has two tabs. The first tab sets the search path for needed support programs. The second tab contains a list of the programs that are needed and where, or if, they were found.

#### Search Path

Most of the functionality of &kvpm; comes from standard LVM and system programs such as lvcreate and mkfs. The search path is a list of locations in the system where &kvpm; should look to find the needed programs. The standard locations in the list are:

- /sbin
- /usr/sbin
- /bin
- /usr/bin
- /usr/local/sbin
- /usr/local/bin

Using the provided list box it is possible to add new locations or to remove unwanted ones. The search is done from top to bottom so moving items up or down in the list will change their search order. The Defaults button will restore the standard list.

#### Program List

The second tab has a list of all the needed executables and the location where they were found. If a program could not be found an error message will be displayed.

## Credits and License

&kvpm;

Program Copyright 2008, 2009, 2010, 2011 &Benjamin.Scott; &benscott.email;

Documentation Copyright 2011 &Benjamin.Scott; &benscott.email;

&underFDL; &underGPL;