User Tools

Site Tools


wiki:os:linux:lvm

LVM

Physical volume

pvcreate /dev/md125
[root@fuvs-sn1 ~]# pvdisplay /dev/md125
  "/dev/md125" is a new physical volume of "9,10 TiB"
  --- NEW Physical volume ---
  PV Name               /dev/md125
  VG Name               
  PV Size               9,10 TiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               66qrEL-a4C2-5lcG-zVXP-Gltn-fYnx-wJtqVD
[root@fuvs-sn1 ~]# pvs
  PV         VG  Fmt  Attr PSize   PFree  
  /dev/md125     lvm2 ---    9,10t   9,10t

Volume group

vgcreate vg1 /dev/md125
[root@fuvs-sn1 ~]# vgdisplay vg1
  --- Volume group ---
  VG Name               vg1
  System ID             
  Format                lvm2
  Metadata Areas        1
  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                1
  Act PV                1
  VG Size               9,10 TiB
  PE Size               4,00 MiB
  Total PE              2384350
  Alloc PE / Size       0 / 0   
  Free  PE / Size       2384350 / 9,10 TiB
  VG UUID               5EtIkG-bnld-ZuXu-LBuk-lSrA-P3j3-hO5kla
vgs
vgscan

Logical volume

lvcreate --name 9T --size 9T vg1
 
# nebo
 
lvcreate --name 10T -l 100%FREE vg1
[root@fuvs-sn1 ~]# lvdisplay
--- Logical volume ---
  LV Path                /dev/vg1/9T
  LV Name                9T
  VG Name                vg1
  LV UUID                wHjpoT-uq8x-XOma-6sGP-GcCC-fCUL-flY7Io
  LV Write Access        read/write
  LV Creation host, time fuvs-sn1.ovirt.dragon.cz, 2017-03-31 10:28:50 +0200
  LV Status              available
  # open                 0
  LV Size                9,00 TiB
  Current LE             2359296
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     20480
  Block device           253:3
lvs
lvscan
lvresize -l +100%FREE /dev/vg1/9T
lvrename vg1 9T 10T
e2fsck -f /dev/vg1/10T
resize2fs /dev/vg1/10T

Filesystem

mkfs.ext4 /dev/vg1/9T

Mount

[root@fuvs-sn1 ~]# blkid
...
/dev/mapper/vg1-9T: UUID="25fe3799-c76f-4a3a-93f9-4c9577c3b1b3" TYPE="ext4"
...
mkdir -p /exports/9T
vim /etc/fstab

...
# /dev/mapper/vg1-9T: 
UUID=25fe3799-c76f-4a3a-93f9-4c9577c3b1b3       /exports/9T     ext4    defaults        0 2
mount -a
df -h
Souborový systém     Velikost Užito Volno Uži% Připojeno do
...
/dev/mapper/vg1-9T       9,0T   81M  8,5T   1% /exports/9T
wiki/os/linux/lvm.txt · Last modified: 2018/01/22 15:14 by root