>> fdisk /dev/sdb
Command (m forhelp): n
Partition type:
p primary (0 primary, 0 extended, 4 free) e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-41943039, default 2048):
Last sector, +sectors or +size{K,M,G,T,P}(2048-41943039, default 41943039):
Created a new partition 1 of type'Linux' and of size 20 GiB.
Command (m forhelp): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
Command (m forhelp): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
>> fdisk -l /dev/sdb
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512=512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 20484194303920970496 8e Linux LVM
开始设置LVM磁盘系统
创建物理卷 Physical Volume
123456789101112
>> pvcreate /dev/sdb1
>> pvdisplay
--- Physical volume ---
PV Name /dev/sda1
VG Name root
PV Size 20.00 GiB / not usable 3.00 MiB
Allocatable yes (but full) PE Size 4.00 MiB
Total PE 5119
Free PE 0
Allocated PE 5119
PV UUID BduFVm-tKMn-JDPf-b1U8-vcs8-8YDk-FNsW0e
创建卷组 Volume Group
12345678910111213141516171819202122
>> vgcreate root /dev/sdb1
>> vgdisplay
--- Volume group ---
VG Name root
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 20.00 GiB
PE Size 4.00 MiB
Total PE 5119
Alloc PE / Size 5119 / 20.00 GiB
Free PE / Size 0 / 0
VG UUID kROehq-qYhI-U21s-Guaq-FFns-bv3R-8cIzDA
创建逻辑卷 Logical Volume, 及以后操作的卷
123456789101112131415161718
>> lvcreate -l +100%FREE root -n root
>> lvdisplay
--- Logical volume ---
LV Path /dev/root/root
LV Name root
VG Name root
LV UUID YtEeaf-sqJJ-8VAq-MdYo-es8Q-uTtO-QulEHJ
LV Write Access read/write
LV Creation host, time archiso, 2014-11-10 03:41:50 +0000
LV Status available
# open 1 LV Size 20.00 GiB
Current LE 5119
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0