快速业务通道

linux 下lvm逻辑卷的铸造

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-23

"/dev/sda6" is a new physical volume of "494.16 MB"

--- NEW Physical volume ---

PV Name /dev/sda6

VG Name

PV Size 494.16 MB

Allocatable NO

PE Size (KByte) 0

Total PE 0

Free PE 0

Allocated PE 0

PV UUID 3k3i3x-6MAs-cX5j-tXJY-790Y-JDCr-PQoI8c

创建卷组myvol1

[root@station23 ~]# vgcreate myvol1 /dev/sda5 /dev/sda6

Volume group "myvol1" successfully created

[root@station23 ~]# vgdisplay myvol1 查看卷组创建情况

--- Volume group ---

VG Name myvol1

System ID

Format lvm2

Metadata Areas 2

Metadata Sequence No 1

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 0

Open LV 0

Max PV 0

Cur PV 2

Act PV 2

VG Size 984.00 MB

PE Size 4.00 MB

Total PE 246

Alloc PE / Size 0 / 0

Free PE / Size 246 / 984.00 MB

VG UUID BDI2wz-XPuu-hZan-VpIu-H6tg-3zTk-Vhyu2x

创建逻辑卷lvm1 大小为300M

[root@station23 ~]# lvcreate -L 300M -n lvm1 myvol1

Logical volume "lvm1" created

[root@station23 ~]# lvdisplay lvm1 这里失败的原因的没写全路径

Volume group "lvm1" not found

[root@station23 ~]# lvdisplay /dev/myvol1/lvm1

--- Logical volume ---

LV Name /dev/myvol1/lvm1

VG Name myvol1

LV UUID 15mVY6-82LS-B39d-663P-Xrlf-p3Ju-cy3Mzp

LV Write Access read/write

LV Status available

# open 0

LV Size 300.00 MB

Current LE 75

Segments 1

Allocation inherit

Read ahead sectors auto

- currently set to 256

Block device 253:2

[root@station23 ~]# mkfs -t ext3 /dev/myvol1/lvm1 格式化lvm1为ext3

mke2fs 1.39 (29-May-2006)

Filesystem label=

OS type: Linux

Block size=1024 (log=0) 拥有帝国一切,皆有可能。欢迎访问phome.net

Fragment size=1024 (log=0)

76912 inodes, 307200 blocks

15360 blocks (5.00%) reserved for the super user

First data block=1

Maximum filesystem blocks=67633152

38 block groups

8192 blocks per group, 8192 fragments per group

2024 inodes per group

Superblock backups stored on blocks:

8193, 24577, 40961, 57345, 73729, 204801, 221185

Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or

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

[root@station23 ~]# mkdir -p /share/test 创建/share/test文件

[root@station23 ~]# vim /etc/fstab 设置lvm1 开机自动挂载

/dev/myvol1/lvm1 /share/test ext3 defaults 0 0

~

~

"/etc/fstab" 9L, 656C written 9,47-75 All

新建目录/share/test,设置其所属组为oinstall

[root@station23 /]# mkdir /share/test

[root@station23 /]# chown -R :oinstall /share

[root@station23 /]# ls -ld /share/test/

drwxr-xr-x 2 root oinstall 1024 Feb 25 12:39 /share/test/

[root@station23 /]# ls -ld /share

drwxr-xr-x 4 root oinstall 1024 Feb 25 12:39 /share

[root@station23 ~]# mount /dev/myvol1/lvm1 /share 挂载lvm1至/share目录下

扩展逻辑卷lvm1的大小至500M,要求不能损坏其中的文件;

[root@station23 test]# touch aa 新建aa文件,用于测试是否损坏了文件

[root@station23 test]# lvextend -L 500M /dev/myvol1/lvm1 /扩展l

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号