Next | Prev | Up | Top | Contents | Index

Creating a Logical Volume and a Filesystem on Newly Added Disks

Suppose that new disks are added to your system in order to provide additional storage. Instead of simply creating a filesystem on each disk, you could create a logical volume consisting of these new disks and make a filesystem on the logical volume. (To extend an existing filesystem onto a logical volume created out of an existing disk and the new disks, see the sections "Growing an EFS Filesystem Onto Another Disk" and "Growing an XFS Filesystem Onto Another Disk" in Chapter 4.)

Caution: All files on the new disks are destroyed by this procedure. If the new disks contain files that you want to save, back up all files to tape or another disk before beginning this procedure. Follow this procedure to create a logical volume and a filesystem on new disks that have been initialized and partitioned:

  1. Decide which partitions of these new disks you want to use for the new filesystem. (Normally, when adding a new filesystem like this, you want to use the entire disks, that is, partition 7 of each disk.)

  2. Decide if you want to make a striped volume. (See the section "To Stripe or Not to Stripe?" in Chapter 6 for information about the benefits and restrictions of striped volumes.)

  3. Add an entry to /etc/lvtab containing the device special pathnames of the new disks that are to be part of the new volume. (See the section "Creating Entries in the /etc/lvtab File" in this chapter for details of the syntax of lvtab entries.) For example:
lv0:Zebra Project:stripes=2:devs=/dev/dsk/dks0d2s7,/dev/dsk/dks1d1s7 

In this example, the logical volume named Zebra Project consists of two partitions from two separate disks on different controllers. Storage is striped across the two disks. (Note that it is not normally necessary to specify the step parameter. The default stripe unit value is used automatically.)

  1. Give the command lvck to check other logical volumes, if any, and the syntax of the new entry in /etc/lvtab:

    # lvck

    The <NO LABEL PRESENT> message you see is normal for the devices in the new logical volume.

  2. Give the command mklv to place the logical volume labels on the new disks to identify them as parts of a logical volume:

    # mklv lv0

    The device names /dev/dsk/lv0 and /dev/rdsk/lv0 are created. They can now be accessed exactly like any regular disk partition.

  3. To create the new filesystem, run mkfs on /dev/rdsk/lv0 as you would run it on a regular disk, for example:

    # mkfs /dev/rdsk/lv0

  4. You can mount /dev/dsk/lv0 exactly as you would mount a filesystem on a regular disk:

    # mkdir /zebra

    # mount /dev/dsk/lv0 /zebra

  5. You may want to add an entry to /etc/fstab to mount this filesystem automatically, for example:

    /dev/dsk/lv0 /zebra efs rw,raw=/dev/rdsk/lv0 0 0

  6. Give the command lvinfo to verify that the new logical volume is active:

    # lvinfo lv0



Next | Prev | Up | Top | Contents | Index