LinuxTAG day 3 — LVM2 Insiders

Insiders guide to Linux LVM2 – Alasdair Kergon – Redhat – 2006/05/05

Advantages of LVM
– Filesystems can extend across disks
– Data can be moved to other disks while in use
– Snapshots
– Hardware config hidden from software

Device Mapper
– Generic kernel framework for volume management
– Modular framework for block devices that map I/O to/from
existing devices based on a table of rules
– Written as a replacement for in-kernel LVM code
– Included in 2.6 kernel

EVMS -> Directly to devmapper
LVM2 -> talk to libdevmapper which talks to devmapper

– Writable snapshots implementation
– Copy-on-write
– Run fsck on a snapshot to find out if a fsck is required on the
real data/disks

– dmsetup
– LVM2
– cryptsetup
– dmraid
– multipath tools

A PV is an ordered list of raw device segments
A VG consists of unordered lists of PV’s and LV’s
A LV is an ordered list of LV segments
A LV-Segment is a mapping applied to an ordered list of
PV-segments or LV segments

Label – one sector near the start of the PV
– Header – Points to label data
– Data – Points to metadata areas and data areas

For larger installations, increate metadata size in PV (default is fine for home-use, not production)

LMV2 tools
– Single binary (argv[0] )
– Unified cmdline processing
– Supports metadata formats via loadable modules (lvm1, lvm2, gfs)
– Customizable logging
– much more
– pvs, lvs, vgs -> replacements for displayvg, displaylv etc…
– put tags on lv, pv or vg, and specify groups by a tag

DevMapper Roadmap
– Minimime lock times
– Allow some ioctl’s to non-root users
– Netlink interface

Be Sociable, Share!