Linux Training : l. LVM

LVM

  • Logical Volume Management aggregates drives

    LVM is a way to manage storage space so the filesystem can grow as needed. In general, once the filesystem is established and all drives mounted, making changes is very difficult if a partition runs out of room. If /var fills up, the system halts (
    Unknown macro: {tm}

    VeryBadThing

    ). With LVM, the filesystem can be expanded without having to copy all the data to a larger drive. For the most part here, LVM is used during the initial installation and rarely is it used afterwards.
    • Physical groups
      Physical groups are the actual drive partitions themselves.
      /usr/sbin/pvscan
        PV /dev/sda2   VG VolGroup70   lvm2 [148.94 GB / 0    free]
        Total: 1 [148.94 GB] / in use: 1 [148.94 GB] / in no VG: 0 [0   ]
      
      This shows a single physical volume group that uses sda2 partition and it all allocated to VolGroup70
    • Volume groups
      These are the structures on top of the physical groups. They are used to form the bases for the filesystem mount point.
       /usr/sbin/vgscan
        Reading all physical volumes.  This may take a while...
        Found volume group "VolGroup70" using metadata type lvm2
      
    • Logical volumes
      These are partitions created from the Volume groups.
      /usr/sbin/lvscan
        ACTIVE            '/dev/VolGroup70/LvRoot' [143.94 GB] inherit
        ACTIVE            '/dev/VolGroup70/LvLogs' [4.00 GB] inherit
        ACTIVE            '/dev/VolGroup70/LvSwap' [1.00 GB] inherit
      
      These logical partition match what mount says is mounted (swap is not "mounted" it is simply used)
       mount
      /dev/mapper/VolGroup70-LvRoot on / type ext3 (rw)
      proc on /proc type proc (rw)
      sysfs on /sys type sysfs (rw)
      devpts on /dev/pts type devpts (rw,gid=5,mode=620)
      /dev/mapper/VolGroup70-LvLogs on /var/log type ext3 (rw)
      /dev/sda1 on /boot type ext3 (rw)
      tmpfs on /dev/shm type tmpfs (rw)
      none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)