• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

VG是按什么顺序使用包含在其中的PV的

发布: 2007-6-08 22:43 | 作者: seanhe | 来源: | 查看: 23次 | 进入软件测试论坛讨论

领测软件测试网
假如我在创建VG时是这样的:
vgcreate /dev/vg01 /dev/dsk/c0t1d0  /dev/dsk/c0t2d0  /dev/dsk/c0t3d0
假如创建一个LV :lvcreate –L 90 –n lv01 vg01
那么这90M的空间是分配在第一个磁盘上吗,如果不是,系统又是遵循怎么样的分配原则呢?
还有假如lvcreate时不使用i选项,系统在分配磁盘空间给LV 时就不会strip化

 2bedodo 回复于:2003-04-15 09:14:33
我不敢确定,但是我好象有印象我们原来上课的时候老师是这么说的——顺序分配

 cuixn 回复于:2003-04-15 13:30:10
好像可以在VG的参数后面,再加上具体的PV,这样就能控制了!

 chep 回复于:2003-04-15 23:50:50
lvcreate不带i选项肯定不会实现stripe,这是显然的.既然不能实现stripe,那lv的分配是完全是透明地把vg当作一块硬盘使用的,这也是vg
这个概念的初衷.

 Shad 回复于:2003-04-16 00:38:02
[quote:3ef1c577ae="leyearn"]假如我在创建VG时是这样的:
vgcreate /dev/vg01 /dev/dsk/c0t1d0  /dev/dsk/c0t2d0  /dev/dsk/c0t3d0
假如创建一个LV :lvcreate –L 90 –n lv01 vg01
那么这90M的空间是分配在第一个磁盘上吗,如果不是,系统?..........[/quote:3ef1c577ae]

Hi,
The PVs in a vg is used sequentially, if you don't specify which PV to use when you lvreate/lvextend. The stripping will NOT happen if you don't specify the options to the lvcreate.

Hope this helps.

 wdbj 回复于:2003-04-16 19:39:48
SHAD说的对

 夏令时 回复于:2003-04-17 17:38:23
[quote:660cbde9ab="wdbj"]SHAD说的对[/quote:660cbde9ab]

84吧,lvcreate的时候系统是自动把lv分在不同的pv上的,是讲师说的。

 wdbj 回复于:2003-04-17 18:38:05
你的讲师讲错了

To create a 24-Mb logical volume named
lvcane in vg01 that is NOT striped, you would use:

    # lvcreate -L 24 -n lvcane /dev/vg01                # not striped

To create a the same logical volume striped across 3 disks with a stripe size
of 8 Kb, you would use:

    # lvcreate  -i 3  -I 8  -L 24 -n lvcane /dev/vg01   # striped

 sql2000 回复于:2003-04-17 20:28:57
真不清楚这个问题,我刚用三块盘做的一个VG,不知道如果之中的一块盘坏了的话会出现什么情况.
谁确实遇到过一个VG中的一块盘坏了的情况?说说.

 Shad 回复于:2003-04-17 20:51:44
[quote:93a7966fe1="sql2000"]真不清楚这个问题,我刚用三块盘做的一个VG,不知道如果之中的一块盘坏了的话会出现什么情况.
谁确实遇到过一个VG中的一块盘坏了的情况?说说.[/quote:93a7966fe1]

Hi,
If one of the 3 disks in a vg is bad, there are two situations:

1. If the bad disk contains active LV and data, then your affected file systems will NOT function correctly. You will see some read/write errors to these file systems. Also, some processes accessing these file systems will hang. Your syslog.log will log the disk errors, "dmesg" command will report errors too.

2. If the bad disk does not contain active LV, then you will only the problem logged in the syslog.log, "dmesg" will report error.

Hope this explains.  

Also,  夏令时's teacher was definitely WRONG !!

Thanks,

 夏令时 回复于:2003-04-17 22:23:29
有没有关于这些地红宝书上的材料,截一段让我看看,多谢大家
我的讲师的水平很高的
要不就是我听错了?

吼吼

 Shad 回复于:2003-04-17 22:31:18
Hi  夏令时,
I guess I mis-read your first post. The "lvcreate" command will put the newly created LV sequentially and automatically on the PVs in a vg, if there is no PV specified to the "lvcreate".

The following is what the lvcreate's man page (can be considered as 红宝书) says:
-------
If you omit the -l and -L options, the logical volume is created with zero length.  This permits you to choose its physical volume location when you allocate logical extents with the lvextend command (see lvextend(1M)).  If you specify -l or -L, the location is determined automatically.
-------

Take care.

 wdbj 回复于:2003-04-19 11:17:32
我摘一段lvcreate的man page给你们看吧:


           -D distributed           Set the distributed allocation policy.
                                    distributed can have one of the
                                    following values:

                                    y    Turn on distributed allocation.

                                    n    Turn off distributed allocation.
                                         This is the default.

                                    When the distributed allocation policy
                                    is turned on, only one free extent is
                                    allocated from the first available
                                    physical volume.  The next free extent
                                    is allocated from the next available
                                    physical volume.  Allocation of free
                                    extents proceeds in round-robin order on
                                    the list of available physical volumes.

                                    When the distributed allocation policy
                                    is turned off, all available free
                                    extents are allocated from each
                                    available physical volume before
                                    proceeding to the next available
                                    physical volume.  This is the default.

尤其要看最后一段。

 夏令时 回复于:2003-04-19 12:06:24
谢谢  Shad  和 wdbj  两位兄弟

 leyearn 回复于:2003-04-21 15:51:26
谢谢各位了!
共同进步!

 leyearn 回复于:2003-04-21 16:09:42
通过I 选项设置的stripe_size是个什么概念
是每次在一个pv上分配stripe_size后再到下一个pv上分配一个stripe_size大小的空间吗?
to wdbj
lvcreate有 -D选项吗
是不是-s选项呀?

 albert 回复于:2003-04-21 19:15:45
Yes, stripe_size is just what you understand.

lvcreate has '-D' option.

But it is different from '-s' option.  

-D Distributed
   One free extent is allocated from the first available
physical volume and the next free extent is allocated from      the next available physical volume.  Allocation of free extents proceeds in round-robin order on the list of available physical volumes.

-s strict

If the logical volume is mirrored, setting this option on is useful to prevent the mirrores of the logical volume from sharing the same physical volume or physical volume group.

For detailed information about the options about 'lvcreate', please see the manual of 'lvcreate'

 leyearn 回复于:2003-04-22 08:49:14
l
[color=red:9af857a409]-s [/color:9af857a409]strict Set the strict allocation policy. Mirror copies of a logical extent can be allocated
to share or not share the same physical volume or physical volume
group. strict can have one of the following values:
[color=red:9af857a409]y[/color:9af857a409] Set a strict allocation policy. Mirrors of a logical extent cannot share
the same physical volume. This is the default.
[color=red:9af857a409]g [/color:9af857a409]Set a PVG-strict allocation policy. Mirrors of a logical extent cannot
share the same physical volume group. A PVG-strict allocation policy
cannot be set on a logical volume in a volume group that does not
have a physical volume group defined.
[color=red:9af857a409]n [/color:9af857a409]Do not set a strict or PVG-strict allocation policy. Mirrors of a logical
extent can share the same physical volume.

其中g选项的解释中的A PVG-strict allocation policy
cannot be set on a logical volume in a volume group that does not
have a physical volume group defined.
隐含的意思是可以在volume group 里定义physical volume group 
这里的physical volume group是个什么概念?
谢谢了!

 wdbj 回复于:2003-04-22 20:46:20
在MULTI-BUS的情况下,例如有两条总线连接到磁盘设备,虽然连接的是同一个磁盘设备,但反映在主机上会是两个设备文件。可以用-g的选项把这两个设备(实际是一个设备)加到一个VG中,这样,当一条总线故障,系统可以从另一条备用总线继续access该磁盘

 leyearn 回复于:2003-04-23 08:08:08
to wdbj兄
怎么区分实际上系统只有一个设备但是有两条系统总线,系统显示的是两个设备文件,怎样识别这两个设备文件是对应的一个设备呢?
谢谢了!

 braveyun 回复于:2003-08-26 23:14:40
的确是按顺序的,如果你在创建lv的时候不加相关参数。他也不回自动给你做striping,不过我记得lvcreate可以加参数把lv健在哪个pv上面。印象不深了自己去看man lvcreate吧

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网