Professional Documents
Culture Documents
LVM Steps - 2
LVM Steps - 2
Start
2048
End
41943039
Blocks
20970496
Id System
83 Linux
Empty
FAT12
XENIX root
XENIX usr
FAT16 <32M
Extended
FAT16
HPFS/NTFS/exFAT
AIX
AIX bootable
OS/2 Boot Manag
W95 FAT32
W95 FAT32 (LBA)
W95 FAT16 (LBA)
W95 Ext'd (LBA)
OPUS
Hidden FAT12
Compaq diagnost
Hidden FAT16 <3
Hidden FAT16
Hidden HPFS/NTF
AST SmartSleep
Hidden W95 FAT3
24
27
39
3c
40
41
42
4d
4e
4f
50
51
52
53
54
55
56
5c
61
63
64
65
70
NEC DOS
Hidden NTFS Win
Plan 9
PartitionMagic
Venix 80286
PPC PReP Boot
SFS
QNX4.x
QNX4.x 2nd part
QNX4.x 3rd part
OnTrack DM
OnTrack DM6 Aux
CP/M
OnTrack DM6 Aux
OnTrackDM6
EZ-Drive
Golden Bow
Priam Edisk
SpeedStor
GNU HURD or Sys
Novell Netware
Novell Netware
DiskSecure Mult
81
82
83
84
85
86
87
88
8e
93
94
9f
a0
a5
a6
a7
a8
a9
ab
af
b7
b8
bb
bf
c1
c4
c6
c7
da
db
de
df
e1
e3
e4
eb
ee
ef
f0
f1
f4
f2
fb
fc
fd
fe
Solaris
DRDOS/sec (FATDRDOS/sec (FATDRDOS/sec (FATSyrinx
Non-FS data
CP/M / CTOS / .
Dell Utility
BootIt
DOS access
DOS R/O
SpeedStor
BeOS fs
GPT
EFI (FAT-12/16/
Linux/PA-RISC b
SpeedStor
SpeedStor
DOS secondary
VMware VMFS
VMware VMKCORE
Linux raid auto
LANstep
ff BBT
PE Size
0
Total PE
0
Free PE
0
Allocated PE
0
PV UUID
rJ8wl7-xzIN-2qqV-ov7Z-lHKe-ELge-aAV29V
The pvscan command scans all supported LVM block devices in the system for physi
cal volumes
[root@centos7 ~]# pvscan
PV /dev/sda2 VG centos
lvm2 [29.51 GiB / 0
free]
PV /dev/sdb1
lvm2 [20.00 GiB]
Total: 2 [49.51 GiB] / in use: 1 [29.51 GiB] / in no VG: 1 [20.00 GiB]
6. Create volume group name vg_newlvm and add /dev/sdb1 partition into the group
.
[root@centos7 ~]# vgcreate vg_newlvm /dev/sdb1
Volume group "vg_newlvm" successfully created
If you have more than one partition, you can add multiple partition in single co
mmand. This command creates a local volume named vg_newlvm that contains physica
l volumes /dev/sdb1 and /dev/sdc1 :
[root@centos7 ~]# vgcreate vg_newlvm /dev/sdb1 /dev/sdc1
7. Creates a logical volume called centos7_newvol that uses all of the unallocat
ed space in the volume group vg_newlvm :
[root@centos7 ~]# lvcreate --name centos7_newvol -l 100%FREE vg_newlvm
Logical volume "centos7_newvol" created
You can see more example of lvcreate command in article 4 lvcreate Command Exampl
es on Linux
8. Display the created logical volumes :
[root@centos7 ~]# lvdisplay
..
..
--- Logical volume --LV Path
/dev/vg_newlvm/centos7_newvol
LV Name
centos7_newvol
VG Name
vg_newlvm
LV UUID
szlkNP-0lwe-f59Z-PJVU-X7pG-unBL-qN10D4
LV Write Access
read/write
LV Creation host, time centos7.ehowstuff.local, 2015-01-25 15:15:48 +0800
LV Status
available
# open
0
LV Size
20.00 GiB
Current LE
5119
Segments
1
Allocation
inherit
Read ahead sectors
auto
- currently set to
8192
Block device
253:2
9. Use the mkfs command to format a newly created LVM :
[root@centos7 ~]# mkfs.ext4 /dev/vg_newlvm/centos7_newvol
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks