LVM basic concepts - drive, physical volume, volume group, logical volumes

  1. fdisk or parted - create an LVM Linux partition (8e) - can use MANY drives
  2. physical volume - pvcreate ; see it with pvdisplay and pvs - create physical volumes on devices
  3. volume group - vgcreate ; see it with vgdisplay and vgs - create ONE volume group from many physical volumes
  4. logical volume - lvcreate ; see it with lvdisplay and lvs - create logical volumes within a volume group
  5. file systems on logical volumes - mkfs -t ext4 /dev/mapper/vgname-lvname
http://johnmeister.com/linux/FileSystems/lvm-commands.html
 

setup LVM on Linux (configuration details from SuSE setup - 2005)

process: fdisk -l pvcreate /dev/sd?5 pvdisplay vgcreate vg199 /dev/sd[c-k]5 vgdisplay lvcreate -L 303400 vg199 lvdisplay mkfs -t ext3 /dev/mapper/vg199-lvol0 vi /etc/fstab - add: /dev/vg199/lvol0 /VG199 ext3 defaults 0 0 mkdir /VG199 mount -a df -h from /root: fdisk -l > fdisk.6sep05 --> cat fdisk.6sep05 Disk /dev/sda: 47 MB, 47185920 bytes 2 heads, 45 sectors/track, 1024 cylinders Units = cylinders of 90 * 512 = 46080 bytes Disk /dev/sdb: 47 MB, 47185920 bytes 2 heads, 45 sectors/track, 1024 cylinders Units = cylinders of 90 * 512 = 46080 bytes Disk /dev/sdc (San disk label): 30 heads, 64 sectors, 36826 cylinders Units = cylinders of 1920 * 512 bytes Device Flag Start End Blocks Id System /dev/sdc3 u 0 36826 35352960 5 Whole disk /dev/sdc4 u 0 2 1920 f Unknown /dev/sdc5 u 3 36826 35350080 e Unknown Disk /dev/sdd (San disk label): 30 heads, 64 sectors, 36826 cylinders Units = cylinders of 1920 * 512 bytes Device Flag Start End Blocks Id System /dev/sdd3 u 0 36826 35352960 5 Whole disk /dev/sdd4 u 0 2 1920 f Unknown /dev/sdd5 u 3 36826 35350080 e Unknown Disk /dev/sde (San disk label): 30 heads, 64 sectors, 36826 cylinders Units = cylinders of 1920 * 512 bytes Device Flag Start End Blocks Id System /dev/sde3 u 0 36826 35352960 5 Whole disk /dev/sde4 u 0 2 1920 f Unknown /dev/sde5 u 3 36826 35350080 e Unknown Disk /dev/sdf (San disk label): 30 heads, 64 sectors, 36826 cylinders Units = cylinders of 1920 * 512 bytes Device Flag Start End Blocks Id System /dev/sdf3 u 0 36826 35352960 5 Whole disk /dev/sdf4 u 0 2 1920 f Unknown /dev/sdf5 u 3 36826 35350080 e Unknown Disk /dev/sdg (San disk label): 30 heads, 64 sectors, 36826 cylinders Units = cylinders of 1920 * 512 bytes Device Flag Start End Blocks Id System /dev/sdg3 u 0 36826 35352960 5 Whole disk /dev/sdg4 u 0 2 1920 f Unknown /dev/sdg5 u 3 36826 35350080 e Unknown Disk /dev/sdh (San disk label): 30 heads, 64 sectors, 36826 cylinders Units = cylinders of 1920 * 512 bytes Device Flag Start End Blocks Id System /dev/sdh3 u 0 36826 35352960 5 Whole disk /dev/sdh4 u 0 2 1920 f Unknown /dev/sdh5 u 3 36826 35350080 e Unknown Disk /dev/sdi (San disk label): 30 heads, 64 sectors, 36826 cylinders Units = cylinders of 1920 * 512 bytes Device Flag Start End Blocks Id System /dev/sdi3 u 0 36826 35352960 5 Whole disk /dev/sdi4 u 0 2 1920 f Unknown /dev/sdi5 u 3 36826 35350080 e Unknown Disk /dev/sdj (San disk label): 30 heads, 64 sectors, 36826 cylinders Units = cylinders of 1920 * 512 bytes Device Flag Start End Blocks Id System /dev/sdj3 u 0 36826 35352960 5 Whole disk /dev/sdj4 u 0 2 1920 f Unknown /dev/sdj5 u 3 36826 35350080 e Unknown Disk /dev/sdk (San disk label): 30 heads, 64 sectors, 36826 cylinders Units = cylinders of 1920 * 512 bytes Device Flag Start End Blocks Id System /dev/sdk3 u 0 36826 35352960 5 Whole disk /dev/sdk4 u 0 2 1920 f Unknown /dev/sdk5 u 3 36826 35350080 e Unknown ------------------------------------------------ ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> pvcreate /dev/sdc5 /dev/sdd5 /dev/sde5 /dev/sdf5 /dev/sdg5 /dev/sdh5 /dev/sdi5 /dev/sdj5 /dev/sdk5 Physical volume "/dev/sdc5" successfully created Physical volume "/dev/sdd5" successfully created Physical volume "/dev/sde5" successfully created Physical volume "/dev/sdf5" successfully created Physical volume "/dev/sdg5" successfully created Physical volume "/dev/sdh5" successfully created Physical volume "/dev/sdi5" successfully created Physical volume "/dev/sdj5" successfully created Physical volume "/dev/sdk5" successfully created ------------------------------------------------ ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> pvdisplay --- NEW Physical volume --- PV Name /dev/sdc5 VG Name PV Size 33.71 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID 5JQ3e8-BYuk-zGGm-dAl9-zc4R-fg4f-vbef9N --- NEW Physical volume --- PV Name /dev/sdd5 VG Name PV Size 33.71 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID FMO1Re-ZWCI-x86f-AWYU-1Ptb-x0et-7y7d34 --- NEW Physical volume --- PV Name /dev/sde5 VG Name PV Size 33.71 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID Wz63XN-yLRY-wH83-0jce-2WwN-MHno-kHc4UM --- NEW Physical volume --- PV Name /dev/sdf5 VG Name PV Size 33.71 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID VgjrsQ-MfnV-Buth-6sVG-hnrp-6B25-ljgOJU --- NEW Physical volume --- PV Name /dev/sdg5 VG Name PV Size 33.71 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID haUHuI-zhU2-vdNR-MD3J-pjdy-rQaR-wLJ3vs --- NEW Physical volume --- PV Name /dev/sdh5 VG Name PV Size 33.71 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID 8os5zU-DPeG-kTty-WScN-WQWk-dlCC-4t5Fow --- NEW Physical volume --- PV Name /dev/sdi5 VG Name PV Size 33.71 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID TFEMUp-CTGg-1RXJ-WYCY-9Mu5-B5AP-OpA1zu --- NEW Physical volume --- PV Name /dev/sdj5 VG Name PV Size 33.71 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID PnJYGj-qNzD-6lTd-FDx1-IDGD-6smm-ZVRp8m --- NEW Physical volume --- PV Name /dev/sdk5 VG Name PV Size 33.71 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID rjK5kQ-H91T-M3ne-hDYy-aL0u-Pk0i-KPf4u0 ------------------------------------------------ ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> vgcreate vg199 /dev/sd[c-k]5 Volume group "vg199" successfully created ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> vgdisplay --- Volume group --- VG Name vg199 System ID Format lvm2 Metadata Areas 9 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 9 Act PV 9 VG Size 303.40 GB PE Size 4.00 MB Total PE 77670 Alloc PE / Size 0 / 0 Free PE / Size 77670 / 303.40 GB VG UUID Sm2YQ7-H5yk-k832-eqGs-SfEL-dWOV-DT2NVk ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> lvcreate -L 303400 vg199 Logical volume "lvol0" created ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> lvdisplay --- Logical volume --- LV Name /dev/vg199/lvol0 VG Name vg199 LV UUID AiwwiO-DYcZ-Ufv2-NDiA-BbN8-XnVh-843Z51 LV Write Access read/write LV Status available # open 0 LV Size 296.29 GB Current LE 75850 Segments 9 Allocation inherit Read ahead sectors 0 Block device 253:0 ------------------------------------------------ ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> mkfs -t ext3 /dev/mapper/vg199-lvol0 mke2fs 1.36 (05-Feb-2005) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 38846464 inodes, 77670400 blocks 3883520 blocks (5.00%) reserved for the super user First data block=0 2371 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, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616 Writing inode tables: 1194/2371 ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> vi /etc/fstab add: ######################################### /dev/vg199/lvol0 /VG199 ext3 defaults 0 0 ######################################### --> mkdir /VG199 ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> mount -a ------------------------------------------------ root@linux-srv [/root] ------------------------------------------------ --> df -h Filesystem Size Used Avail Use% Mounted on /dev/cciss/c0d0p2 72G 4.4G 64G 7% / tmpfs 16G 8.0K 16G 1% /dev/shm /dev/mapper/vg199-lvol0 292G 33M 277G 1% /VG199 ------------------------------------------------------------------------------------------------ ---------------------------------------------------- john meister UNIX Systems Administrator ----------------------------------------------------

Simply Linux: Basics  Full Size Jeep Buyer's Guide Using BASH on Windows 10
Practical Suggestions for Microsoft Windows
Linux Tackles Microsoft
12 hour Video Course by john:
The Art of Linux System Administration
published by O'Reilly Media
Study Guide for the LPIC-2 Certification Exams
search for:
on the internet, or:
JohnMeister.com-fotos
LinuxMeister-Linux
BibleTech- Bible overview

overview of mankind's history
Biblical history:
"Promises and Prophets"

Wagoneers

FULL SIZE JEEPS

JeepMeister
"Jeep is America's
only real sports car."
-Enzo Ferrari


MeisterTech
Diesels +

One Page Overview of Linux Commands

click for an image of the 5 essential Linux commands

An Intro to Linux
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983
purchase AMSOIL
at Midway Auto on SR9 in Snohomish,
or at Northland Diesel in Bellingham, WA


SJ - 1962-1991

XJ - 1984-2001

WJ - 1999-2004

KJ - 2002-2007

WK - 2005-2010

Find the recommended
AMSOIL synthetics
for your Jeep

CJ-10A - 1984-1986

Jeepsters

MJ - 1984-1992

Willys - 1946-1965

Other Jeeps (FC)