linux如何查看iqn名称,iSCSI节点名称定义及其他

iSCSI节点名称有两种格式,即 iqn-type 格式和 eui-type 格式。

iqn-type的格式为:

iqn.yyyy-mm.backward_naming_authority:unique_device_name

在Linux上的格式为:

iqn.1987-05.com.cisco:RandomNumber

通常我们可以把RandomNumber更改为具有意义的名称如主机名称等。

缺省的,生成的节点名称可以在/etc/initiatorname.iscsi 得到.

InitiatorName=iqn.1987-05.com.cisco:01.ed671bf29e

我们可以修改为:

InitiatorName=iqn.1987-05.com.cisco:test2

重新启动iscsi服务后,Netapp端就能够正确识别initiator.

76f475be35ad442947a2c2ade2efe275.png

此时可以从主机上获得相关SCSI设备信息:

iscsi-sfnet: Loading iscsi_sfnet version 4:0.1.11-1

iscsi-sfnet: Control device major number 254

iscsi-sfnet:host3: Session established

scsi3 : SFNet iSCSI driver

scsi: unknown device type 31

Vendor: NETAPP Model: LUN Rev: 0.2

Type: Unknown ANSI SCSI revision: 04

Vendor: NETAPP Model: LUN Rev: 0.2

Type: Direct-Access ANSI SCSI revision: 04

SCSI device sda: 41943040 512-byte hdwr sectors (21475 MB)

SCSI device sda: drive cache: write through

sda: sda1 sda2

Attached scsi disk sda at scsi3, channel 0, id 0, lun 1

可以通过fdisk来分区使用iscsi设备:

[root@test2 ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 20480.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 21.4 GB, 21474836480 bytes

64 heads, 32 sectors/track, 20480 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

Device Boot Start End Blocks Id System

/dev/sda1 1 3907 4000752 83 Linux

/dev/sda2 3908 20480 16970752 83 Linux

Command (m for help): q

使用iscsi-ls命令可以看到更为详细的磁盘信息:

[root@test2 ~]# iscsi-ls -l

*******************************************************************************

SFNet iSCSI Driver Version ...4:0.1.11(12-Jan-2005)

*******************************************************************************

TARGET NAME : iqn.1992-08.com.netapp:sn.84192734

TARGET ALIAS :

HOST ID : 3

BUS ID : 0

TARGET ID : 0

TARGET ADDRESS : 172.16.35.228:3260,1

SESSION STATUS : ESTABLISHED AT Tue Nov 15 09:46:27 CST 2005

SESSION ID : ISID 00023d000001 TSIH 113

DEVICE DETAILS:

---------------

LUN ID : 0

Vendor: NETAPP Model: LUN Rev: 0.2

Type: ANSI SCSI revision: 04

LUN ID : 1

Vendor: NETAPP Model: LUN Rev: 0.2

Type: Direct-Access ANSI SCSI revision: 04

page83 type3: 60a98000686f6c504f34314e45774239

page80: 686f6c504f34314e457742390a

Device: /dev/sda

*******************************************************************************

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值