Skip to main content



Volume management

developerWorks

   Recommendations  |   HOWTO & tools  |   Results  |   More
  Volume management with LVM
  Volume management with EVMS

Volume management with LVM

This HOWTO describes the most basic steps in defining a striped set of DASDs for Linux on System z. The following steps create a striped volume with stripe size 64k on the DASDs /dev/dasdv1 and /dev/dasdw1. We assume that the used DASDs have already been formatted and partitioned.

  1. Create "physical volumes" with the command pvcreate
    pserver10:~ # pvcreate /dev/dasd/56c5 /dev/dasd/56c6
    pvcreate -- physical volume "/dev/dasdv1" successfully created
    pvcreate -- physical volume "/dev/dasdw1" successfully created
  2. Create a "volume group" with the command vgcreate
    pserver10:~ # vgcreate myvolgroup /dev/dasdv1 /dev/dasdw1
    vgcreate -- INFO: using default physical extent size 4MB
    vgcreate -- INFO: maximum logical volume size is 255.99 Gigabyte
    vgcreate -- doing automatic backup of volume group "myvolgroup"
    vgcreate -- volume group "myvolgroup" successfully created and activated
  3. Get the maximum number of extents with the command vgdisplay
    pserver10:~ # vgdisplay myvolgroup
    --- Volume group ---
    VG Name myvolgroup
    VG Access read/write
    VG Status available/resizable
    VG # 0
    MAX LV 256
    Cur LV 0
    Open LV 0
    MAX LV Size 255.99GB
    Max PV 256
    Cur PV 2
    Act PV 2
    VG Size 13.74GB
    PE Size 4MB
    Total PE 3518
    Alloc PE / Size 0 / 0
    Free PE / Size 3518 / 13.74GB
    VG UUID hNoJPC-N3a0-g7md-dK64-PwJ7-T1De-Y0jF7V
  4. Create the "logical volume" with the command lvcreate
    lvcreate --name mylvolume --stripes 2 --stripesize 64 --extents 3518 myvolgroup
    lvcreate -- doing automatic backup of "myvolgroup"
    lvcreate -- logical volume "/dev/myvolgroup/mylvolume" successfully created
  5. Create a file system on the created logical volume
    pserver10:~ # mke2fs -j /dev/myvolgroup/mylvolume
    mke2fs 1.28 (31-Aug-2002)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    1802240 inodes, 3602432 blocks
    180121 blocks (5.00%) reserved for the super user
    First data block=0
    110 block groups
    32768 blocks per group, 32768 fragments per group
    16384 inodes per group
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

    Writing inode tables: done
    Creating journal (8192 blocks): done
    Writing superblocks and filesystem accounting information: done

    This filesystem will be automatically checked every 29 mounts or
    180 days, whichever comes first. Use tune2fs -c or -i to override.


If you want to learn more about the commands described here, please have a look at the man pages or the complete LVM-HOWTO (http://tldp.org/HOWTO/LVM-HOWTO/).

Note that the first step of the LVM-HOWTO (http://tldp.org/HOWTO/LVM-HOWTO/):
1. Set the partition system id to 0x8e on /dev/sdc1 and /dev/sde1.
is obsolete for DASD devices on Linux on System z (but valid for SCSI disks)



Back to top



Team
Please address any comments to the performance team: linux390@de.ibm.com