linux基本命令iscsiadm,iscsiadm主要操作命令

linux基本命令iscsiadm,iscsiadm主要操作命令root xifenfei fdisk lDisk dev sda 21 4GB bytes255head 63sectors track 2610cylinder cylindersof1 512 bytesDeviceB

[root@xifenfei ~]# fdisk -l

Disk /dev/sda: 21.4 GB, bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1        2355       83  Linux

/dev/sda2            2356        2610     +  82  Linux swap / Solaris

Disk /dev/sdb: 21.4 GB, bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        2610    +  83  Linux

Disk /dev/sdc: 2147 MB, bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = bytes

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

Disk /dev/sdd: 21.4 GB, bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1         100      +  83  Linux

/dev/sdd2             101        1000       83  Linux

查看iscsi运行情况

[root@xifenfei ~]# rpm -aq|grep iscsi

iscsi-initiator-utils-6.2.0.872-10.0.1.el5

[root@xifenfei ~]#  chkconfig –list |grep iscsi

iscsi           0:off   1:off   2:on    3:on    4:on    5:on    6:off

iscsid          0:off   1:off   2:off   3:on    4:on    5:on    6:off

[root@xifenfei ~]# ps -ef|grep iscs

root      2753     2  0 Jun21 ?        00:00:00 [iscsi_eh]

root     15793     1  0 09:08 ?        00:00:00 brcm_iscsiuio

root     15800     1  0 09:08 ?        00:00:00 iscsid

root     15802     1  0 09:08 ?        00:00:00 iscsid

root     19533 15269  0 10:11 pts/1    00:00:00 grep iscs

配置iscsi存储

[root@xifenfei ~]# iscsiadm -m discovery -t sendtargets -p 192.168.1.254:3260

192.168.1.254:3260,1 iqn.2006-01.com.openfiler:tsn.32bb

[root@xifenfei ~]# iscsiadm -m node –T iqn.2006-01.com.openfiler:tsn.32bb -p 192.168.1.254:3260 -l

Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.32bb, portal: 192.168.1.254,3260]

Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.32bb, portal: 192.168.1.254,3260] successful.

[root@xifenfei ~]# iscsiadm -m node –T iqn.2006-01.com.openfiler:tsn.32bb -p 192.168.1.254:3260

>–op update -n node.startup -v automatic

当前包含磁盘

[root@xifenfei ~]# fdisk -l

Disk /dev/sda: 21.4 GB, bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1        2355       83  Linux

/dev/sda2            2356        2610     +  82  Linux swap / Solaris

Disk /dev/sdb: 21.4 GB, bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        2610    +  83  Linux

Disk /dev/sdc: 2147 MB, bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = bytes

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

Disk /dev/sdd: 21.4 GB, bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1         100      +  83  Linux

/dev/sdd2             101        1000       83  Linux

Disk /dev/sde: 1073 MB, bytes

34 heads, 61 sectors/track, 1011 cylinders

Units = cylinders of 2074 * 512 = bytes

Disk /dev/sde doesn’t contain a valid partition table

Disk /dev/sdf: 1073 MB, bytes

34 heads, 61 sectors/track, 1011 cylinders

Units = cylinders of 2074 * 512 = bytes

Disk /dev/sdf doesn’t contain a valid partition table

Disk /dev/sdg: 1073 MB, bytes

34 heads, 61 sectors/track, 1011 cylinders

Units = cylinders of 2074 * 512 = bytes

Disk /dev/sdg doesn’t contain a valid partition table

卸载iscsi存储

[root@xifenfei ~]# iscsiadm -m node –logoutall=all

Logging out of session [sid: 3, target: iqn.2006-01.com.openfiler:tsn.32bb, portal: 192.168.1.254,3260]

Logout of [sid: 3, target: iqn.2006-01.com.openfiler:tsn.32bb, portal: 192.168.1.254,3260] successful.

[root@xifenfei ~]# iscsiadm -m node –op delete –targetname iqn.2006-01.com.openfiler:tsn.32bb

当前包含磁盘

[root@xifenfei ~]# fdisk -l

Disk /dev/sda: 21.4 GB, bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1        2355       83  Linux

/dev/sda2            2356        2610     +  82  Linux swap / Solaris

Disk /dev/sdb: 21.4 GB, bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1        2610    +  83  Linux

Disk /dev/sdc: 2147 MB, bytes

255 heads, 63 sectors/track, 261 cylinders

Units = cylinders of 16065 * 512 = bytes

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

Disk /dev/sdd: 21.4 GB, bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = bytes

Device Boot      Start         End      Blocks   Id  System

/dev/sdd1               1         100      +  83  Linux

/dev/sdd2             101        1000       83  Linux

iscsi操作总结

增加iscsi存储

(1)发现iscsi存储:iscsiadm -m discovery -t st -p ISCSI_IP

(2)查看iscsi发现记录:iscsiadm -m node

(3)登录iscsi存储:iscsiadm -m node -T LUN_NAME -p ISCSI_IP -l

(4)开机自动: iscsiadm -m node –T LUN_NAME -p ISCSI_IP –op update -n node.startup -v automatic

删除iscsi存储

(1)登出iscsi存储 iscsiadm -m node -T LUN_NAME -p ISCSI_IP -u

(2)对出iscsi所有登录 iscsiadm -m node –logoutall=all

(3)删除iscsi发现记录:iscsiadm -m node -o delete -T LUN_NAME -p ISCSI_IP

登入需验证码的节点

(1)开启认证

iscsiadm -m node -T LUN_NAME -o update –name node.session.auth.authmethod –value=CHAP

*.使用-o同–op

(2)添加用户

iscsiadm -m node -T LUN_NAME –op update –name node.session.auth.username –value=[用户名]

(3)添加密码

iscsiadm –m node –T LUN_NAME –op update –name node.session.auth.password –value=[密码]

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/203436.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月19日 下午9:48
下一篇 2026年3月19日 下午9:48


相关推荐

  • setbackground参数_setcookie参数

    setbackground参数_setcookie参数setrequestproperty设置http请求头HttpURLConnection.setRequestProperty(Stringkey,Stringvalue);这个我居然都忘记了,哎~真是岁数大了,心好累。。。例如:下面就是一个完整的原始网络请求方式HttpURLConnectionconn=null;try{URLmy_url=newURL(log());//得…

    2025年10月22日
    6
  • Axure8授权码

    Axure8授权码AxureRP8 版本 1 被授权人 www jb51 net 授权密钥 smn B4H9oFf30K6s 企业版 2 被授权人 www jb51 net 授权密钥 PfIjTySgSBZe AM49Wsl OXbAzPBegmTx VKKkbOI0Vzxl 被授权人 zdfans com 授权密钥 gP5uuK2gH iIVO3YF

    2026年3月20日
    2
  • 层层递进打造你的重试机制

    层层递进打造你的重试机制重试机制在分布式系统中 或者调用外部接口中 都是十分重要的 重试机制可以保护系统减少因网络波动 依赖服务短暂性不可用带来的影响 让系统能更稳定的运行的一种保护机制 为了方便说明 先假设我们想要进行重试的方法如下 Slf4j Componentpub privatestati

    2026年3月17日
    2
  • Python 更换国内pip源

    Python 更换国内pip源-豆瓣:http://pypi.douban.com/simple/-中科大:https://pypi.mirrors.ustc.edu.cn/simple/-清华:https://pypi.tuna.tsinghua.edu.cn/simple一次性使用可以在使用pip的时候加参数-ihttps://pypi.tuna.tsinghua.edu.cn/simp…

    2022年6月3日
    40
  • python实现注册登录系统_python实现登录与注册系统「建议收藏」

    python实现注册登录系统_python实现登录与注册系统「建议收藏」本文实例为大家分享了python实现登录与注册系统的具体代码,供大家参考,具体内容如下实现功能1.调用文本文件里的用户信息2.可以将注册信息存储在文本文件里3.实现了密码格式的限制具体用户信息将如下格式存储在txt文本文件下转换后便于代码利用的格式(列表中嵌套字典)具体代码如下:#-*-coding=utf8-*-#@author:sololi#date:2020/11/3#文件说…

    2022年5月22日
    41
  • (精华)2020年6月28日 JavaScript高级篇 设计模式-发布订阅模式

    (精华)2020年6月28日 JavaScript高级篇 设计模式-发布订阅模式//发布订阅对象vareventObj={//缓存列表,存放订阅者的信息list:{},//添加订阅listen:function(key,fn){if(!this.list[key]){this.list[key]=[];}typeoffn===’function’&&this.list[key].push(fn);},//发布信息

    2022年8月20日
    8

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号