RHEL6基础二十八之LVM逻辑卷管理(Logical Volume Manager)

)→格式化(LV为ext文件系统)→挂载

三、创建LV

创建LV前需要创建VG,而创建VG前需要创建PV,所以我们要先创建PV再创建VG最后再创建LV,这里利用/dev/sdb盘来创建

创建PV:pvcreate /dev/sdbx

[root@justin ~]# fdisk -lDisk /dev/sda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000661de Device BootStartEndBlocks Id System/dev/sda1 *126204800 83 LinuxPartition 1 does not end on cylinder boundary./dev/sda2261332 10485760 83 Linux/dev/sda3133215932097152 82 Linux swap / Solaris/dev/sda4159326118182784 5 Extended/dev/sda5159326118181760 83 LinuxDisk /dev/sdb: 5368 MB, 5368709120 bytes255 heads, 63 sectors/track, 652 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000[root@justin ~]# fdisk /dev/sdbCommand (m for help): nCommand action e extended p primary partition (1-4)ePartition number (1-4): 4First cylinder (1-652, default 1):Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652):Using default value 652Command (m for help): nCommand action l logical (5 or over) p primary partition (1-4)lFirst cylinder (1-652, default 1):Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652): +3GCommand (m for help): nCommand action l logical (5 or over) p primary partition (1-4)lFirst cylinder (394-652, default 394):Using default value 394Last cylinder, +cylinders or +size{K,M,G} (394-652, default 652):Using default value 652Command (m for help): pDisk /dev/sdb: 5368 MB, 5368709120 bytes255 heads, 63 sectors/track, 652 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0xd58eff7b Device BootStartEndBlocks Id System/dev/sdb416525237158+ 5 Extended/dev/sdb513933156709+ 83 Linux/dev/sdb63946522080386 83 LinuxCommand (m for help): tPartition number (1-6): 5Hex code (type L to list codes): 8eChanged system type of partition 5 to 8e (Linux LVM)Command (m for help): tPartition number (1-6): 6Hex code (type L to list codes): 8eChanged system type of partition 6 to 8e (Linux LVM)Command (m for help): pDisk /dev/sdb: 5368 MB, 5368709120 bytes255 heads, 63 sectors/track, 652 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0xd58eff7b Device BootStartEndBlocks Id System/dev/sdb416525237158+ 5 Extended/dev/sdb513933156709+ 8e Linux LVM/dev/sdb63946522080386 8e Linux LVMCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.[root@justin ~]# pvcreate /dev/sdb5 /dev/sdb6 Writing physical volume data to disk “/dev/sdb5” Physical volume “/dev/sdb5” successfully created Writing physical volume data to disk “/dev/sdb6” Physical volume “/dev/sdb6” successfully created[root@justin ~]# partprobe /dev/sdb ;使用工具partprobe让kernel读取分区信息[root@justin ~]# fdisk -lDisk /dev/sda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000661de Device BootStartEndBlocks Id System/dev/sda1 *126204800 83 LinuxPartition 1 does not end on cylinder boundary./dev/sda2261332 10485760 83 Linux/dev/sda3133215932097152 82 Linux swap / Solaris/dev/sda4159326118182784 5 Extended/dev/sda5159326118181760 83 LinuxDisk /dev/sdb: 5368 MB, 5368709120 bytes255 heads, 63 sectors/track, 652 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0xd58eff7b Device BootStartEndBlocks Id System/dev/sdb416525237158+ 5 Extended/dev/sdb513933156709+ 8e Linux LVM/dev/sdb63946522080386 8e Linux LVM[root@justin ~]# pvdisplay ;查看PV信息 “/dev/sdb5” is a new physical volume of “3.01 GiB” — NEW Physical volume — PV Name/dev/sdb5 VG NamePV Size3.01 GiB AllocatableNO PE Size0 Total PE0 Free PE0 Allocated PE0 PV UUIDPz14Rv-2Ngu-lbdD-5dgF-CLU1-cQ9p-bDAf52″/dev/sdb6″ is a new physical volume of “1.98 GiB” — NEW Physical volume — PV Name/dev/sdb6 VG NamePV Size1.98 GiB AllocatableNO PE Size0 Total PE0 Free PE0 Allocated PE0 PV UUID9sIqz9-iXNv-kloo-p55V-ZzMT-eGD0-Tf2iEn[root@justin ~]#用最多的梦面对未来

RHEL6基础二十八之LVM逻辑卷管理(Logical Volume Manager)

相关文章:

你感兴趣的文章:

标签云: