# Creating drive links

This chapter discusses the EVMS drive linking feature, which is implemented by the drive link plug-in, and tells how to create, expand, shrink, and delete a drive link.

## What is drive linking?

Drive linking linearly concatenates objects, allowing you to create larger storage objects and volumes from smaller individual pieces. For example, say you need a 1 GB volume but do not have contiguous space available of that length. Drive linking lets you link two or more objects together to form the 1 GB volume.

The types of objects that can be drive linked include disks, segments, regions, and other feature objects.

Any resizing of an existing drive link, whether to grow it or shrink it, must be coordinated with the appropriate file system operations. EVMS handles these file system operations automatically.

Because drive linking is an EVMS-specific feature that contains EVMS metadata, it is not backward compatible with other volume-management schemes.

## How drive linking is implemented

The drive link plug-in consumes storage objects, called link objects, which produce a larger drive link object whose address space spans the link objects. The drive link plug-in knows how to assemble the link objects so as to create the exact same address space every time. The information required to do this is kept on each link child as persistent drive-link metadata. During discovery, the drive link plug-in inspects each known storage object for this metadata. The presence of this metadata identifies the storage object as a link object. The information contained in the metadata is sufficient to:

- Identify the link object itself.

- Identify the drive link storage object that the link object belongs to.

- Identify all link objects belonging to the drive link storage. object

- Establish the order in which to combine the child link objects.

If any link objects are missing at the conclusion of the discovery process, the drive link storage object contains gaps where the missing link objects occur. In such cases, the drive link plug-in attempts to fill in the gap with a substitute link object and construct the drive link storage object in read-only mode, which allows for recovery action. The missing object might reside on removable storage that has been removed or perhaps a lower layer plug-in failed to produce the missing object. Whatever the reason, a read-only drive link storage object, together logging errors, help you take the appropriate actions to recover the drive link.

## Creating a drive link

The drive link plug-in provides a list of acceptable objects from which it can create a drive-link object. When you create an EVMS storage object and then choose the drive link plug-in, a list of acceptable objects is provided that you can choose from. The ordering of the drive link is implied by the order in which you pick objects from the provided list. After you provide a name for the new drive-link object, the identified link objects are consumed and the new drive-link object is produced. The name for the new object is the only option when creating a drive-link.

Only the last object in a drive link can be expanded, shrunk or removed. Additionally, a new object can be added to the end of an existing drive link only if the file system (if one exists) permits. Any resizing of a drive link, whether to grow it or shrink it, must be coordinated with the appropriate file system operations. EVMS handles these file system operations automatically.

## Example: create a drive link

This section shows how to create a drive link with EVMS:

> ### Create a drive link

> Create a new drive link consisting of `sde4` and `hdc2`, and call it "dl."

### Using the EVMS GUI

To create the drive link using the GUI, follow these steps:

1. Select Actions Create Feature Object to see a list of EVMS features.

2. Select Drive Linking Feature.

3. Click Next.

4. Click the objects you want to compose the drive link: sde4 and hdc2.

5. Click Next.

6. Type `dl` in the "name" field

7. Click Create.

   The last dialog window presents the free space object you selected as well as the available configuration options for that object.

Alternatively, you can perform some of the steps to create a drive link with the GUI context sensitive menu:

1. From the Available Objects tab, right click `sde4`.

2. Click Create Feature Object...

3. Continue creating the drive link beginning with step 2 of the GUI instructions. In step 4, `sde4` is selected for you. You can also select `hdc2`.

### Using Ncurses

To create the drive link, follow these steps:

1. Select Actions CreateFeature Object to see a list of EVMS features.

2. Select Drive Linking Feature.

3. Activate Next.

4. Use spacebar to select the objects you want to compose the drive link from: `sde4` and `hdc2`.

5. Activate Next.

6. Press spacebar to edit the Name field.

7. Type `dl` at the "::" prompt. Press Enter.

8. Activate Create.

Alternatively, you can perform some of the steps to create a drive link with the context sensitive menu:

1. From the Available Objects view, press Enter on `sde4`.

2. Activate the Create Feature Object menu item.

3. Continue creating the drive link beginning with step 4 of the Ncurses instructions. `sde4` will be pre-selected. You can also select `hdc2`.

### Using the CLI

Use the `create` command to create a drive link through the CLI. You pass the "object" keyword to the `create` command, followed by the plug-in and its options, and finally the objects.

To determine the options for the plug-in you are going to use, issue the following command:

    query: plugins, plugin=DriveLink, list options

Now construct the `create` command, as follows:

    create: object, DriveLink={Name=dl}, sde4, hdc2

## Expanding a drive link

A drive link is an aggregating storage object that is built by combining a number of storage objects into a larger resulting object. A drive link consumes link objects in order to produce a larger storage object. The ordering of the link objects as well as the number of sectors they each contribute is described by drive link metadata. The metadata allows the drive link plug-in to recreate the drive link, spanning the link objects in a consistent manner. Allowing any of these link objects to expand would corrupt the size and ordering of link objects; the ordering of link objects is vital to the correct operation of the drive link. However, expanding a drive link can be controlled by only allowing sectors to be added at the end of the drive link storage object. This does not disturb the ordering of link objects in any manner and, because sectors are only added at the end of the drive link, existing sectors have the same address (logical sector number) as before the expansion. Therefore, a drive link can be expanded by adding additional sectors in two different ways:

- By adding an additional storage object to the end of the drive link.

- By expanding the last storage object in the drive link.

If the expansion point is the drive link storage object, you can perform the expansion by adding an additional storage object to the drive link. This is done by choosing from a list of acceptable objects during the expand operation. Multiple objects can be selected and added to the drive link.

If the expansion point is the last storage object in the drive link, then you expand the drive link by interacting with the plug-in that produced the object. For example, if the link was a segment, then the segment manager plug-in that produced the storage object expands the link object. Afterwords, the drive link plug-in notices the size difference and updates the drive link metadata to reflect the resize of the child object.

There are no expand options.

## Shrinking a drive link

Shrinking a drive link has the same restrictions as expanding a drive link. A drive link object can only be shrunk by removing sectors from the end of the drive link. This can be done in the following ways:

- By removing link objects from the end of the drive link.

- By shrinking the last storage object in the drive link.

The drive link plug-in attempts to orchestrate the shrinking of a drive-link storage object by only listing the last link object. If you select this object, the drive link plug-in then lists the next-to-last link object, and so forth, moving backward through the link objects to satisfy the shrink command.

If the shrink point is the last storage object in the drive link, then you shrink the drive link by interacting with the plug-in that produced the object.

There are no shrink options.

## Deleting a drive link

A drive link can be deleted as long as it is not currently a compatibility volume, an EVMS volume, or consumed by another EVMS plug-in.

No options are available for deleting a drive link storage object.