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

PV VG LV 的简单使用

时间:2015-12-02 12:41:07      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:pv vg lv

查看磁盘信息:

[root@PROD1 ~]# fdisk -l


Disk /dev/sda: 68.7 GB, 68719476736 bytes

255 heads, 63 sectors/track, 8354 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x0003ad13


   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          26      204800   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2              26         548     4194304   82  Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

/dev/sda3             548        8355    62708736   83  Linux


Disk /dev/sdb: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000


使用sdb创建基于磁盘的物理卷

[root@PROD1 ~]# pvcreate /dev/sdb 

  Physical volume "/dev/sdb" successfully created


查看物理卷创建是否成功

[root@PROD1 ~]# pvdisplay

  "/dev/sdb" is a new physical volume of "20.00 GiB"

  --- NEW Physical volume ---

  PV Name               /dev/sdb

  VG Name               

  PV Size               20.00 GiB

  Allocatable           NO

  PE Size               0   

  Total PE              0

  Free PE               0

  Allocated PE          0

  PV UUID               LDexlC-p56Q-knle-Gtxx-juj9-DmAD-nbaWgh


创建VG存储池

[root@PROD1 ~]# vgcreate VolGroup01  /dev/sdb

  Volume group "VolGroup01" successfully created


分配LV逻辑卷

[root@PROD1 ~]# lvcreate -L 10G -n LogVol01 VolGroup01

  Logical volume "LogVol01" created.


格式化分区

[root@PROD1 ~]# mkfs.ext4 /dev/VolGroup01/LogVol01

mke2fs 1.43-WIP (20-Jun-2013)

文件系统标签=

OS type: Linux

块大小=4096 (log=2)

分块大小=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

655360 inodes, 2621440 blocks

131072 blocks (5.00%) reserved for the super user

第一个数据块=0

Maximum filesystem blocks=2684354560

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: 完成                            

正在写入inode表: 完成                            

Creating journal (32768 blocks): 完成

Writing superblocks and filesystem accounting information: 完成 


添加/u02挂载点

[root@PROD1 ~]# mkdir /u02


挂载逻辑卷

[root@PROD1 ~]# mount /dev/VolGroup01/LogVol01 /u02

[root@PROD1 ~]# mount

/dev/sda3 on / type ext4 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on /dev/shm type tmpfs (rw)

/dev/sda1 on /boot type ext4 (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

/dev/mapper/VolGroup01-LogVol01 on /u02 type ext4 (rw)


卸载逻辑卷

[root@PROD1 ~]# umount /u02/

[root@PROD1 ~]# mount

/dev/sda3 on / type ext4 (rw)

proc on /proc type proc (rw)

sysfs on /sys type sysfs (rw)

devpts on /dev/pts type devpts (rw,gid=5,mode=620)

tmpfs on /dev/shm type tmpfs (rw)

/dev/sda1 on /boot type ext4 (rw)

none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)


https://oracle-base.com/articles/linux/linux-logical-volume-management


http://blog.csdn.net/wuweilong/article/details/7565530


http://blog.itpub.net/29435844/viewspace-1071797/


PV VG LV 的简单使用

标签:pv vg lv

原文地址:http://10955537.blog.51cto.com/10945537/1718783

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