免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 5110 | 回复: 13
打印 上一主题 下一主题

[求助] : iscsi 共享上创建 LVM 的问题 , 谢谢 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-05-26 17:35 |只看该作者 |倒序浏览
本帖最后由 lrlfriend 于 2013-05-27 08:30 编辑

环境 : VMware + CentOS 5.5
实验1 :
   target上创建了一个LV 并把它共享出去, initiator上找到了这个共享 (/dev/sdd) , 然后在 /dev/sdd上再创建 LVM , 刚创建后可以挂载 . 然后initiator logout再login ,  再挂载该LV失败,错误信息如下

mount: wrong fs type, bad option, bad superblock on /dev/vg_iscsi/lv_iscsi,
       missing codepage or other error                                    
       In some cases useful info is found in syslog - try                  
       dmesg | tail  or so                                                

实验2 :    target上将换成将1个普通分区(/dev/sdb1) 共享出去, initiator上找到了这个共享 (/dev/sdd) , 然后在 /dev/sdd上再创建 LVM , 结果和实验1 一样.

实验3 :    target上将LVM共享出去, initiator上找到了这个共享 (/dev/sdd)后再其上创建普通分区 , 没有上述问题 , logout再login, 还能挂载

补充 :  文件系统没用GFS



1. 上述结果是否正常 ?
2. 如果不能在共享上创建LVM , 那应该如何实现在线扩容 ?

谢谢.

论坛徽章:
0
2 [报告]
发表于 2013-05-28 21:03 |只看该作者
本帖最后由 lrlfriend 于 2013-05-28 21:03 编辑

我发错版面了

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
3 [报告]
发表于 2013-05-29 15:04 |只看该作者
先看log吧。错误都告诉你该怎么做了。

论坛徽章:
0
4 [报告]
发表于 2013-05-29 22:08 |只看该作者
本帖最后由 lrlfriend 于 2013-05-29 22:14 编辑

回复 3# wenhq


    ISCSI没提示错误, 就是第二次mount的时候提示错误了, 上面已经贴出来了.

    请教, LVM的LV上再创建LVM是不是不可行 ?  如果是,那ISCSI如何联机扩容呢 ? 谢谢.

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
5 [报告]
发表于 2013-05-30 08:54 |只看该作者
原理上是可行的吧,你要扩容可以再分一个LV给targetserver即可啊。

有个疑问是你挂了ISCSI后又做LVM为啥呢?不能直接format mount么?

论坛徽章:
0
6 [报告]
发表于 2013-05-30 10:15 |只看该作者
本帖最后由 lrlfriend 于 2013-05-30 10:17 编辑

回复 5# wenhq

   
    挂载后( initiator上看到的是 /dev/sdd) 分区(比如只分了一个 /dev/sdd1) 容量就固定了。 target上再建一个LV做扩容后(initiator上看到的是 /dev/sde) 也改变不了原分区(/dev/sdd1)的大小了。 我想要的是能扩充原分区的大小,所以想到在共享上建LVM

   我试了单机上建LVM,然后在LV上再建LVM,同样的结果。 刚建完后能挂载,再以后就不成了。

   不知道是我做的不对还是LV上再建LVM行不通。

   请教有没有其他办法实现 ?

   谢谢。

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
7 [报告]
发表于 2013-05-30 10:44 |只看该作者
我记得LVM可以在线扩容吧
你只需要新加一个target到initiator然后加入LVM即可是吧?

论坛徽章:
0
8 [报告]
发表于 2013-05-30 13:04 |只看该作者
回复 7# wenhq


  我现在的问题就是不能把共享磁盘加入到initiator的LVM上 。

  下面是initiator上没扩容时的LVM

etc/init.d.\>vgdisplay -v vg_iscsi
    Using volume group(s) on command line
    Finding volume group "vg_iscsi"
  --- Volume group ---
  VG Name               vg_iscsi
  System ID            
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               18.64 GB
  PE Size               4.00 MB
  Total PE              4771
  Alloc PE / Size       4608 / 18.00 GB
  Free  PE / Size       163 / 652.00 MB
  VG UUID               V8qwZb-KVG9-Je74-PV7z-yryh-L5ha-2JtK21
   
  --- Logical volume ---
  LV Name                /dev/vg_iscsi/lv_iscsi
  VG Name                vg_iscsi
  LV UUID                pxleYU-tbQ5-sddU-dKtl-3z48-u3DZ-D9J5Xu
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                18.00 GB
  Current LE             4608
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:4
   
  --- Physical volumes ---
  PV Name               /dev/sda1     
  PV UUID               wZdJMk-u1md-GdSf-GKv0-dZmo-82hz-9CPx9J
  PV Status             allocatable
  Total PE / Free PE    4771 / 163   



下面是扩容后的

/etc/init.d.\>vgdisplay -v vg_iscsi
    Using volume group(s) on command line
    Finding volume group "vg_iscsi"
  --- Volume group ---
  VG Name               vg_iscsi
  System ID            
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               46.58 GB
  PE Size               4.00 MB
  Total PE              11924
  Alloc PE / Size       9728 / 38.00 GB
  Free  PE / Size       2196 / 8.58 GB
  VG UUID               V8qwZb-KVG9-Je74-PV7z-yryh-L5ha-2JtK21
   
  --- Logical volume ---
  LV Name                /dev/vg_iscsi/lv_iscsi
  VG Name                vg_iscsi
  LV UUID                pxleYU-tbQ5-sddU-dKtl-3z48-u3DZ-D9J5Xu
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                38.00 GB
  Current LE             9728
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:4
   
  --- Physical volumes ---
  PV Name               /dev/sda1     
  PV UUID               wZdJMk-u1md-GdSf-GKv0-dZmo-82hz-9CPx9J
  PV Status             allocatable
  Total PE / Free PE    4771 / 0
   
  PV Name               /dev/sdd1     
  PV UUID               ZLSmMY-UU54-8lu4-7WFP-rBFx-qCzT-FBWTrN
  PV Status             allocatable
  Total PE / Free PE    7153 / 2196
   
/etc/init.d.\>


刚扩容后是可以mount的

/etc/init.d.\>mount -t ext3 /dev/vg_iscsi/lv_iscsi /data/testscsi
/etc/init.d.\>



initiator重启后就不能再mount了
(这次的共享是分区,不是LVM,如果是LVM的话,签退再签到后就不能再mount了)


~.\>mount -t ext3 /dev/vg_iscsi/lv_iscsi /data/testscsi
mount: special device /dev/vg_iscsi/lv_iscsi does not exist


mount UUID也不行
/dev.\>mount UUID="59bbf54a-9f40-48aa-87dc-7b0b8587dd6f" -t ext3 /data/testscsi
mount: special device UUID=59bbf54a-9f40-48aa-87dc-7b0b8587dd6f does not exist
/dev.\>


查看 vg,还在啊
~.\>vgdisplay -v vg_iscsi
    Using volume group(s) on command line
    Finding volume group "vg_iscsi"
  --- Volume group ---
  VG Name               vg_iscsi
  System ID            
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               46.58 GB
  PE Size               4.00 MB
  Total PE              11924
  Alloc PE / Size       9728 / 38.00 GB
  Free  PE / Size       2196 / 8.58 GB
  VG UUID               V8qwZb-KVG9-Je74-PV7z-yryh-L5ha-2JtK21
   
  --- Logical volume ---
  LV Name                /dev/vg_iscsi/lv_iscsi
  VG Name                vg_iscsi
  LV UUID                pxleYU-tbQ5-sddU-dKtl-3z48-u3DZ-D9J5Xu
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                38.00 GB
  Current LE             9728
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
   
  --- Physical volumes ---
  PV Name               /dev/sda1     
  PV UUID               wZdJMk-u1md-GdSf-GKv0-dZmo-82hz-9CPx9J
  PV Status             allocatable
  Total PE / Free PE    4771 / 0
   
  PV Name               /dev/sdd1     
  PV UUID               ZLSmMY-UU54-8lu4-7WFP-rBFx-qCzT-FBWTrN
  PV Status             allocatable
  Total PE / Free PE    7153 / 2196


fdisk 查看 , 共享设备还在
~.\>fdisk -l

Disk /dev/hda: 858.9 GB, 858993459200 bytes
255 heads, 63 sectors/track, 104433 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14      104433   838753650   8e  Linux LVM

Disk /dev/sda: 2147.4 GB, 2147483648000 bytes
255 heads, 63 sectors/track, 261083 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        2433    19543041   83  Linux

Disk /dev/sdb: 2147.4 GB, 2147483648000 bytes
255 heads, 63 sectors/track, 261083 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        2433    19543041   83  Linux
/dev/sdb2            2434        6081    29302560   83  Linux

Disk /dev/sdc: 2147.4 GB, 2147483648000 bytes
255 heads, 63 sectors/track, 261083 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        2433    19543041   83  Linux
/dev/sdc2            2434        6081    29302560   83  Linux

Disk /dev/md0: 20.0 GB, 20012007424 bytes
2 heads, 4 sectors/track, 4885744 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

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

Disk /dev/md1: 30.0 GB, 30005723136 bytes
2 heads, 4 sectors/track, 7325616 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

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

Disk /dev/md2: 50.0 GB, 50017599488 bytes
2 heads, 4 sectors/track, 12211328 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

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

Disk /dev/sdd: 30.0 GB, 30005789184 bytes
64 heads, 32 sectors/track, 28615 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1       28615    29301744   83  Linux

Disk /dev/sde: 40.0 GB, 40007761920 bytes
64 heads, 32 sectors/track, 38154 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

Disk /dev/sde doesn't contain a valid partition table
~.\>  
  
tune2fs 查看

~.\>tune2fs -l /dev/vg_iscsi/lv_iscsi
tune2fs 1.39 (29-May-2006)
tune2fs: No such file or directory while trying to open /dev/vg_iscsi/lv_iscsi
Couldn't find valid filesystem superblock.
  


不知道是为什么了,求解,谢谢。

论坛徽章:
16
IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每月发帖之星
日期:2015-09-11 19:30:52IT运维版块每周发帖之星
日期:2015-09-11 19:20:31IT运维版块每日发帖之星
日期:2015-08-26 06:20:00每日论坛发贴之星
日期:2015-08-20 06:20:00IT运维版块每日发帖之星
日期:2015-08-20 06:20:002015年辞旧岁徽章
日期:2015-03-03 16:54:15金牛座
日期:2014-05-04 16:58:09双子座
日期:2013-12-17 16:44:37辰龙
日期:2013-11-22 15:20:59狮子座
日期:2013-11-18 22:55:08射手座
日期:2013-11-12 10:54:26
9 [报告]
发表于 2013-05-30 17:40 |只看该作者
Once the targets are listed above, they are automatically added into
         /etc/iscsi/nodes


You can change the settings in the nodes directory and make it always automatic login on boot. The directories and files to be considered are
/etc/iscsi/iscsid.conf <- Make Node as automatic rather than manual
/etc/iscsi/nodes/yournodename <- Change the configuration and make it automatic e.g. node.startup=automatic

参考http://linuxtrove.com/wp/?page_id=143

论坛徽章:
0
10 [报告]
发表于 2013-05-30 17:50 |只看该作者
回复 9# wenhq


    唉,步骤基本一样,不明白为啥结果不一样。

   我再看看吧,多谢了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP