linux创建物理卷、卷组、逻辑卷以及格式化、挂载。 | 您所在的位置:网站首页 › linux创建一个新目录 › linux创建物理卷、卷组、逻辑卷以及格式化、挂载。 |
一、创建物理卷
[root@centos ~]# fdisk /dev/sdb #创建3主分区,每个区5G Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0x29162724. Command (m for help): 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): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +5G Partition 1 of type Linux and of size 5 GiB is set Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): p Partition number (2-4, default 2): 2 First sector (10487808-41943039, default 10487808): Using default value 10487808 Last sector, +sectors or +size{K,M,G} (10487808-41943039, default 41943039): +5G Partition 2 of type Linux and of size 5 GiB is set Command (m for help): n Partition type: p primary (2 primary, 0 extended, 2 free) e extended Select (default p): p Partition number (3,4, default 3): 3 First sector (20973568-41943039, default 20973568): Using default value 20973568 Last sector, +sectors or +size{K,M,G} (20973568-41943039, default 41943039): +5G Partition 3 of type Linux and of size 5 GiB is set Command (m for help): t #修改分区号 Partition number (1-3, default 3): 1 Hex code (type L to list all codes): 8e Changed type of partition 'Linux' to 'Linux LVM' Command (m for help): t Partition number (1-3, default 3): 2 Hex code (type L to list all codes): 8e Changed type of partition 'Linux' to 'Linux LVM' 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/sdb: 21.5 GB, 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 Disk label type: dos Disk identifier: 0x29162724 Device Boot Start End Blocks Id System /dev/sdb1 2048 10487807 5242880 8e Linux LVM /dev/sdb2 10487808 20973567 5242880 8e Linux LVM /dev/sdb3 20973568 31459327 5242880 8e Linux LVM Command (m for help): w #保存并退出 The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. [root@centos ~]# pvcreate /dev/sdb{1,2,3} #创建物理卷 Physical volume "/dev/sdb1" successfully created. Physical volume "/dev/sdb2" successfully created. Physical volume "/dev/sdb3" successfully created. [root@centos ~]# pvs #查看物理卷信息 PV VG Fmt Attr PSize PFree /dev/sda2 centos lvm2 a-- |
CopyRight 2018-2019 实验室设备网 版权所有 |