La commande 'extendlv' permet d'augmenter la taille d'un LV, sans passer par l'augmentation du FS lui-même.

Cette commande est utile dans la gestion des LV non attachés à un FS, mais aussi pour réserver de l'espace à un FS sans agrandir immédiatement ce dernier.

La syntaxe est la suivante :

extendlv [ -a Position ] [ -e Range ] [ -u Upperbound ] [ -s Strict ] LogicalVolume Nb_Partitions [ PhysicalVolume ... ]

 

Un exemple simple est : 'extendlv lv002 10 hdisk10' pour ajouter 10 PPs au volume logique lv002.

Si on ne spécifie pas le(s) disque(s) physique(s), le système prend un des disques du groupe de volumes de ce volume logique.

 

 

Ci-dessous la documentation officielle IBM.

extendlv Command

 

Purpose

 

Increases the size of a logical volume by adding unallocated physical partitions from within the volume group.

 

Syntax

 

To Add Available Physical Partitions

 

extendlv [ -a Position ] [ -e Range ] [ -u Upperbound ] [ -s Strict ] LogicalVolume Partitions [ PhysicalVolume ... ]

 

To Add Specific Physical Partitions

extendlv [ -mMapFile ] LogicalVolume Partitions

 

Description

 

The extendlv command increases the number of logical partitions allocated to the LogicalVolume by allocating the number of additional logical partitions represented by the Partitions parameter. The LogicalVolume parameter can be a logical volume name or a logical volume ID. To limit the allocation to specific physical volumes, use the names of one or more physical volumes in the PhysicalVolume parameter; otherwise, all the physical volumes in a volume group are available for allocating new physical partitions.

 

By default, the logical volume is expanded using the existing characteristics that are displayed when you use the lslv command. To override these existing characteristics for the new partitions only, choose different values for these characteristics by using the flags.

 

The default maximum number of partitions for a logical volume is 512. Before extending a logical volume more than 512 logical partitions, use the chlv command to increase the default value.

 

The default allocation policy is to use a minimum number of physical volumes per logical volume copy, to place the physical partitions belonging to a copy as contiguously as possible, and then to place the physical partitions in the desired region specified by the -a flag. Also, by default, each copy of a logical partition is placed on a separate physical volume.

You can specify logical volumes sizes in 512 Blocks/KB/MB/GB when using the extendlv command. (See Examples.)

 

Notes:
  1. When extending a striped logical volume, the number of partitions must be in an even multiple of the striping width.
  2. It is recommended that a logical volume using a large number of partitions (more than 800MB) be extended gradually in sections.
  3. Changes made to the logical volume are not reflected in the file systems. To change file system characteristics, use the chfs command.
  4. You must either have root user authority or be a member of the system group to use this command. If you do not have root user authority, you will notice a warning that 'savebase' could not be run. You need to have someone with root user authority run the savebase command before rebooting the system to ensure that the ODM changes are saved. Alternatively, SUID can be enabled for the savebase command so that non-root users are given root authority when running it.
  5. The extendlv command is not allowed on a snapshot volume group.

You can use the Volumes application in Web-based System Manager to change volume characteristics. You could also use the System Management Interface Tool (SMIT)smit extendlv fast path to run this command.

 

Flags

 

Note:
The -e and -s flags are not valid with a striped logical volume.

 

-a Position Sets the intraphysical volume allocation policy (the position of the logical partitions on the physical volume). The Position variable can be one of the following:
m
Allocates logical partitions in the outer middle section of each physical volume. This is the default position.
c
Allocates logical partitions in the center section of each physical volume.
e
Allocates logical partitions in the outer edge section of each physical volume.
ie
Allocates logical partitions in the inner edge section of each physical volume.
im
Allocates logical partitions in the inner middle section of each physical volume.
-e Range Sets the interphysical volume allocation policy (the number of physical volumes to extend across, using the volumes that provide the best allocation). The value of the Range variable is limited by the Upperbound variable (set with the -u flag) and can be one of the following:
x
Allocates logical partitions across the maximum number of physical volumes.
m
Allocates logical partitions across the minimum number of physical volumes.
-m MapFile Specifies the exact physical partitions to allocate. Partitions are used in the order given by the file designated by the MapFileparameter. All physical partitions belonging to a copy are allocated before allocating for the next copy. The MapFile format is:
PVname:PPnum1[-PPnum2]
where PVname is a physical volume name (for example, hdisk0). It is one record per physical partition or a range of consecutive physical partitions.
PVname
Name of the physical volume as specified by the system.
PPnum
Physical partition number.
Important:
When you use map files, you must understand and adhere to all LV-allocation parameters such as strictness, upperbound, and stripe width. Using map files bypasses the checks done in the LVM-allocation routines. This is important for striped LVs, which are assumed to have a typical striped allocation pattern conforming to the stripe width.
-s Strict Determines the strict allocation policy. Copies of a logical partition can be allocated to share or not to share the same physical volume. The Strict variable is represented by one of the following:
y
Sets a strict allocation policy, so copies for a logical partition cannot share the same physical volume.
n
Does not set a strict allocation policy, so copies for a logical partition can share the same physical volume.
s
Sets a super strict allocation policy, so that the partitions allocated for one mirror cannot share a physical volume with the partitions from another mirror.
Note:
When changing a non superstrict logical volume to a superstrict logical volume you must specify physical volumes or use the -uflag.
-u Upperbound Sets the maximum number of physical volumes for new allocation. The value of the Upperbound variable should be between one and the total number of physical volumes. When using super strictness, the upper bound indicates the maximum number of physical volumes allowed for each mirror copy. When using striped logical volumes, the upper bound must be multiple of Stripe_width.

 

Examples

  1. To increase the size of the logical volume represented by the lv05 directory by three logical partitions, type:
    extendlv lv05 3
  2. To request a logical volume named lv05 with a minimum size of 10MB, type:
    extendlv lv05 10M # 

    The extendlv command will determine the number of partitions needed to create a logical volume of at least that size.

    You can use uppercase and lowercase letters as follows:

        B/b       512 byte blocks
        K/k       KB
        M/m       MB
        G/g       GB
icon phone
Téléphone/Whatsapp : +33 (0)6 83 84 85 74
icon phone