05
2011
01

创建并使用逻辑卷

实验环境

     公司准备在 Internet中搭建邮件服务器(RHEL5系统平台),面向全国各地的员工及部分VIP客户提供电子邮箱空间,由于用户数量众多,邮件存储需要大量的空间,考虑到动态扩容的需要,计划增加两块SCSI硬盘并构建LVM逻辑卷(挂载到"/mail“目录下)专门用于存放邮件数据。

 

[root@localhost ~]# fdisk -l                               查看磁盘系统

Disk /dev/sda: 21.4 GB, 21474836480 bytes                   第一块SCSI硬盘

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

 

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14        2610    20860402+  8e  Linux LVM

 

Disk /dev/sdb: 21.4 GB, 21474836480 bytes                  第二块SCSI硬盘

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 21.4 GB, 21474836480 bytes                第三块SCSI硬盘

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

[root@localhost ~]# pvcreate /dev/sdb /dev/sdc            创建PV

  Physical volume "/dev/sdb" successfully created

  Physical volume "/dev/sdc" successfully created

[root@localhost ~]# vgcreate vgmail /dev/sdb /dev/sdc        创建VG

  Volume group "vgmail" successfully created

[root@localhost ~]# lvcreate -L +20G -n lvmail vgmail       创建LV

  Logical volume "lvmail" created

[root@localhost ~]# mkfs.ext3 /dev/vgmail/lvmail        格式化

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

2621440 inodes, 5242880 blocks

262144 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=0

160 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 34 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@localhost ~]# mkdir /mail                              创建/mail目录

[root@localhost ~]# mount /dev/vgmail/lvmail /mail           LV挂载到/mail目录

[root@localhost ~]# df -hT /mail                              查看/mail信息

文件系统      类型    容量  已用 可用 已用% 挂载点

/dev/mapper/vgmail-lvmail

              ext3     20G  173M   19G   1% /mail

[root@localhost ~]#

« 上一篇下一篇 »

评论列表:

1.wcdxf  2011-4-29 16:35:07 回复该留言
yi bu xiao xin you zou jin lai l

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。