linux安装iscsi设备,linux系统下安装配置iSCSI教程

本文档详细介绍了如何在Redhat 5.4系统上安装并配置iSCSI Initiator,包括安装iscsi-initiator-utils软件包、启动iscsi服务、执行Target发现、设置Initiator Name以及格式化iscsi挂载的磁盘分区。步骤清晰,适用于系统管理员进行远程存储配置。
摘要由CSDN通过智能技术生成

测试系统为Redhat 5.4,内核版本为2.6.18,iSCSI Server已经配置好,此处不再说明。

1、  安装iSCSI Initiator

a) 使用命令mount /dev/cdrom /media挂载Redhat5.4安装光盘到/media下。

b) 使用命令rpm --ivh /media/Server/iscsi-initiator-utils-6.2.0.871-0.7.el5.i386.rpm安装iscsi Initiator。

971bef051517cab8dc0a87a5c040999e.png

c) 使用命令rpm --qa | grep iscsi确认系统中已经成功安装了iscsi Initiator。并且在/etc下会产生iscsi文件夹,该文件夹下同时生成两个文件initiatorname.iscsi、iscsid.conf。

d) 使用命令chkconfig --list查看iscsi、iscsid服务在运行级别3、5中是否属于自动启动状态。(注意:如果不是可以使用chkconfig --level将其设置为自动启动。

a6672d72ae25c28d08c0373a02f3384d.png

如果iscsid和iscsi没有随系统的启动而启动,则用chkconfig设置这两个服务在系统运行级别为3和5时随系统启动而启动# chkconfig iscsi --level 345 on

# chkconfig iscsid --level 345 on

2、  执行Target发现。

a) 首先使用命令/etc/init.d/iscsid start启动iscsi守护进程。

031981248e48d39eb823dd0f9af006e2.png

b) 用命令iscsiadm –m discovery –t sendtargets –p 192.168.1.92发现192.168.1.92上的iscsi资源。

434db69fda1b0e729bb06853a265d8cb.png

c) 使用命令iscsiadm –m node查看已发现的所有iscsi资源(该步骤可选)

90d8ab003772cfa6ce88ee3dac6a09f7.png

3、  设置Initiator Name。

a) 编辑/etc/iscsi/initiatorname.iscsi文件,将“InitiatorName=”后的内容改为之前发现的iscsi资源名,如图:

b) 编辑/etc/iscsi/iscsid.conf文件,将“# isns.address = 192.168.0.1”前的“#”去掉,并将IP地址改为ISCSI Server的IP地址192.168.1.92。将“isns.port = 3205”前的“#”去掉并将端口号改为3260如图:

c5b3c2242df4ca7e857312215e7961be.png

4、  启动iscsi服务,将通过iscsi挂载的磁盘分区格式化。

a) 使用命令/etc/init.d/iscsi start启动iscsi服务,此时将会挂载iscsi设备,如图。

5598690f70e7dbee6e1dbf0fe2fe797f.png

b) 使用fdisk –l可以查看到系统中多了一块硬盘/dev/sdb,这便是通过iscsi挂载而来。

如果显示 disk /dev/sdb doesn’t contain a vilid partition table

需要运行以下命令进行挂载# fdisk /dev/sdf

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1009, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-1009, default 1009):

Using default value 1009

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

The kernel still uses the old table.

The new table will be used at the next reboot.

Syncing disks.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值