Daniel Hill wrote, On 16/09/09 20:10:
don't like articles that don't state what they are trying achieve or
what LVM does

LVM is another layer of indirection for disk storage. Allows you to expand the LV a filesystem lives on, without having to shuffle partitions on disk like the OP. Most filesystems these days support some kind of expand function. Some do it live, and some even can be shrunk.

You have Physical Volumes (PV), which are one or more partitions, that are combined to form Volume Groups (VGs) and inside a PV you create Logical Volumes (or LVs).

Example

[r...@server ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/md1              2.8G  2.1G  599M  78% /
/dev/md0               97M   22M   71M  23% /boot
/dev/mapper/VG00-home 157G  129G   20G  87% /home
/dev/md2              5.8G  1.3G  4.3G  23% /usr
/dev/md3               29G   19G  9.3G  67% /var
/dev/mapper/VG00-imap  50G   16G   32G  33% /var/spool/imap



[r...@swerver ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/md4
  VG Name               VG00
  PV Size               421.95 GB / not usable 448.00 KB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              108019
  Free PE               54594
  Allocated PE          53425
  PV UUID               CLxPXr-BC7N-vv3H-vs06-UcuA-etdo-tk7DNT


So there's 54594 blocks of 4MB (~220GB) which could be allocated to new LVs or appended to existing ones





[r...@sever ~]# lvdisplay
  --- Logical volume ---
  LV Name                /dev/VG00/home
  VG Name                VG00
  LV UUID                000000-0000-0000-0000-0000-0000-000000
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                158.59 GB
  Current LE             40600
  Segments               2
  Allocation             normal
  Read ahead sectors     10000
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/VG00/imap
  VG Name                VG00
  LV UUID                000000-0000-0000-0000-0000-0000-000001
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                50.10 GB
  Current LE             12825
  Segments               1
  Allocation             normal
  Read ahead sectors     10000
  Block device           253:1



Note the home LV has 2 segments - it has already been expanded once.

Note also that LVM is not RAID. LVM provides only convenience, and no additional reliability in itself.



--
Craig Falconer

Reply via email to