码迷,mamicode.com
首页 > 其他好文 > 详细

centos7.5 创建逻辑卷

时间:2019-01-15 19:09:43      阅读:254      评论:0      收藏:0      [点我收藏+]

标签:ESS   log   journal   pvs   ima   efault   分区信息   设置   created   

查看分区信息

[root@master ~]# fdisk -l

Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 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
Disk label type: dos
Disk identifier: 0x00003b2a

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 411647 204800 83 Linux
/dev/sda2 411648 63342591 31465472 8e Linux LVM

创建分区/dev/sda2/ 并将分区类型设置为 8e Linux LVM
[root@master ~]# fdisk /dev/sda
Command (m for help): t
Partition number (1-3, default 3): 3
Hex code (type L to list all codes): 8e
Changed type of partition ‘Linux‘ to ‘Linux LVM‘

Command (m for help): p

Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 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
Disk label type: dos
Disk identifier: 0x00003b2a

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 411647 204800 83 Linux
/dev/sda2 411648 63342591 31465472 8e Linux LVM
/dev/sda3 63342592 168200191 52428800 8e Linux LVM

让内核重启读取分区信息

[root@master ~]# partprobe /dev/sda

查看物理卷
[root@master ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- 30.00g 4.00m
创建物理卷
[root@master ~]# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created.
检查结果
[root@master ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- 30.00g 4.00m
/dev/sda3 lvm2 --- 50.00g 50.00g

创建卷组
[root@master ~]# vgcreate test /dev/sda3
Volume group "test" successfully created
[root@master ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a-- 30.00g 4.00m
/dev/sda3 test lvm2 a-- <50.00g <50.00g

创建逻辑卷
[root@master ~]# lvcreate -L 10G -n u01 test
Logical volume "u01" created.

查看结果
[root@master ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 20.00g
swap centos -wi-ao---- 10.00g
u01 test -wi-a----- 10.00g

格式化 /dev/test/u01
root@master ~]# mkfs.ext4 /dev/test/u01
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
655360 inodes, 2621440 blocks
131072 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2151677952
80 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

创建文件/u01
[root@master ~]# mkfs /u01

挂载分区
[root@master ~]# mount /dev/test/u01 /u01
[root@master ~]# ls /u01
lost+found

centos7.5 创建逻辑卷

标签:ESS   log   journal   pvs   ima   efault   分区信息   设置   created   

原文地址:http://blog.51cto.com/437549/2343081

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!