曾经在Red Hat Enterprise Linux 3 下配置百兆网卡利用 ISCSI 访问 NetApp。 感觉还是比较方便。性能倒没有多留意。

实战系统版本:

[root@trade /]# cat /etc/redhat-release

Red Hat Enterprise Linux AS release 3 (Taroon Update 7)

据资料介绍,redhat linux as3 从Update 4的版本开始,开始内置支持iscsi,集成iscsi-initiator。

[root@trade /]# rpm -qa|grep iscsi

iscsi-initiator-utils-3.6.3-3

step1:生成iSCSI

[root@trade /]# iscsi-iname

iqn.1987-05.com.cisco:01.d7e04ce46ca5

step2:配置/etc/iscsi.conf,里面参数可以很多,但是最简单就是:

#DiscoveryAddress=

DiscoveryAddress=172.16.35.228

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

step3:诊断、连接netapp

[root@trade /]#/etc/init.d/iscsi start ,如果长期使用,还需要用setup命令,把iscsi服务设置成开机自动启动。

Checking iscsi config: [ OK ]

Loading iscsi driver: [ OK ]

Starting iscsid: [ OK ]

还可以用dmesg命令观察lun的连接情况,确定lun的设备名。

#dmesg

iSCSI: 3.6.1 (22-Sep-2004) built for Linux 2.4.21-27.ELsmp

iSCSI: will translate deferred sense to current sense on disk command responses

iSCSI: control device major number 254

iSCSI: allocating task cache iscsi_0000729382 with reaping disabled

iSCSI: detected HBA f6aed100, host #2

scsi2 : iSCSI 3.6.1 (22-Sep-2004)

iSCSI: bus 0 target 0 = iqn.1992-08.com.netapp:sn.84192734

iSCSI: bus 0 target 0 portal 0 = address 172.16.35.228 port 3260 group 1

iSCSI: bus 0 target 0 trying to establish session c3ae8000 to portal 0, address 172.16.35.228 port 3260 group 1

iSCSI: bus 0 target 0 established session c3ae8000 #1, portal 0, address 172.16.35.228 port 3260 group 1

scsi singledevice 2 0 0 1

Vendor: NETAPP Model: LUN Rev: 0.2

Type: Direct-Access ANSI SCSI revision: 04

Attached scsi disk sdb at scsi2, channel 0, id 0, lun 1

iSCSI: session c3ae8000 recv_cmd f693aa00, cdb 0x0, status 0x2, response 0x0, senselen 18, key 06, ASC/ASCQ 29/00,

itt 3 task f6906f74 to (2 0 0 1), iqn.1992-08.com.netapp:sn.84192734

iSCSI: Sense f0000600 0000000a 00000000 29000000 0000

SCSI device sdb: 20971520 512-byte hdwr sectors (10737 MB)

sdb: unknown partition table

查看设备信息

此时可以使用iscsi-ls等命令查看相关Lun信息

# iscsi-ls

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

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

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

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

TARGET ALIAS :

HOST ID : 0

BUS ID : 0

TARGET ID : 0

TARGET ADDRESS : 172.16.35.228:3260,1

SESSION STATUS : ESTABLISHED AT Tue Nov 8 15:43:38 CST 2005

SESSION ID : ISID 00023d000001 TSIH 101

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

 step4:格式化设备待用

# fdisk /dev/sdb

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.

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)

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

Command (m for help): p

Disk /dev/sdb: 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

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-20480, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-20480, default 20480): +4096M

Command (m for help): p

Disk /dev/sdb: 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/sdb1 1 3907 4000752 83 Linux

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 2

First cylinder (3908-20480, default 3908):

Using default value 3908

Last cylinder or +size or +sizeM or +sizeK (3908-20480, default 20480):

Using default value 20480

Command (m for help): p

Disk /dev/sdb: 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/sdb1 1 3907 4000752 83 Linux

/dev/sdb2 3908 20480 16970752 83 Linux

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

# cd /

# mkdir netdisk 建立mount点

# mkfs /dev/sdb1

mke2fs 1.32 (09-Nov-2002)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

500960 inodes, 1000188 blocks

50009 blocks (5.00%) reserved for the super user

First data block=0

31 block groups

32768 blocks per group, 32768 fragments per group

16160 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or

180 days, whichever comes first. Use tune2fs -c or -i to override.

# mount /dev/sdb1 /netdisk

# df -k /netdisk

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sdb1 3937820 20 3737764 1% /data1

linux外接NetApp存储,实战RH Linux下配置百兆网卡iSCSI 访问NetApp相关推荐

  1. Linux 高并发服务器实战 - 2 Linux多进程开发

    Linux 高并发服务器实战 - 2 Linux多进程开发 进程概述 概念1: 概念2: 微观而言,单CPU任意时刻只能运行一个程序 并发:两个队列交替使用一台咖啡机 并行:两个队列同时使用两台咖啡机 ...

  2. Windows和Linux双启动,并用在Windows下配置CoLinux启动

    http://www.cppblog.com/newclear/archive/2009/09/27/97327.html Windows和Linux双启动,并用在Windows下配置CoLinux启 ...

  3. ThinkPHP6使用七牛云存储,不改代码,改下配置就上七牛

    ThinkPHP6使用七牛云存储,不改代码,改下配置就上七牛 介绍 ThinkPHP6中使用flysystem作为文件处理类,flysystem是一个php文件处理库,可以使用相同的接口连接本地,ft ...

  4. Linux 高并发服务器实战 - 1 Linux系统编程入门

    Linux 高并发服务器实战-1Linux系统编程入门 在本机和服务器端设置公共密钥(配置免密登录) 在本机cmd里输入 ssh-keygen -t rsa,生成本机的公密钥 在服务器端里也配置 ss ...

  5. linux服务器运维实战记录,linux运维好书推荐《高性能Linux服务器运维实战》

    本书整体分为4个篇幅,以Linux运维平台下的开源应用软件为中心,涉及Linux运维的各个方面,主要从系统基础运维(命令.shell编程).系统性能调优.智能运维监控平台构建.运维实战案例四个方面展开 ...

  6. linux两个网段默认网关_Linux下配置多网卡多网关

    原标题:Linux下配置多网卡多网关 大家好,今天给大家介绍一下Linux下配置多网卡多网关的方法.@Hi-Linux 场景一 多运营商线路 比较典型的一种场景:一台 Linux 服务器上有三个网口并 ...

  7. linux创建django项目,Ubuntu 16.04下配置Django项目

    记录一次在全新服务器下配置Django项目说明: Linux操作系统:Ubuntu 16.04 Django版本:1.8.7 Python版本:2.7.12 运行模式:Ubuntu+Django+Ap ...

  8. Linux从安装到实战+学校Linux+瑞吉外卖Linux项目部署

    1.0初识Linux 1.1虚拟机介绍 1.2VMware Workstation虚拟化软件 下载CentOS; 1.3远程链接Linux系统 &FinalShell 链接finalshell ...

  9. linux添加ipv6静态路由命令,Debian下配置IPV6和静态路由

    一.编辑网卡文件 vi /etc/network/interfaces 二.修改网卡文件# This file describes the network interfaces available o ...

最新文章

  1. 美博士环保聚焦“限漆令”出台之后的涂料行业
  2. word2vector 讲的比较好的文章
  3. nginx与apache详细性能对比
  4. luogu P2470 [SCOI2007]压缩
  5. 前端学习(2919):v-bind属性绑定
  6. 属性文法和语法制导翻译
  7. Linux环境搭建 | 全能终端神器——MobaXterm
  8. oracle查询 view,oracle view
  9. can总线一帧多少字节多少位_汽车CAN总线数据帧解析---汽车语言知多少
  10. excel的IRR函数
  11. µC/OS-II Release Notes
  12. 如何经营咖啡加盟店和独立咖啡店?用好国外成功经营咖啡馆四大法则
  13. JS中删除数组中重复的元素
  14. c语言state用法,常见设计模式的解析和实现—State模式
  15. eclipse + pydev远程调试OpenStack
  16. 2009,新展望!站得稳雄得起!
  17. URP——后期处理特效——运动模糊Motion Blur
  18. 2013年03月26日
  19. 电机驱动芯片L298N和L293D区别
  20. 保姆级NodeJS安装环境配置优化

热门文章

  1. 现在新能源汽车可以取代传统燃油车吗?
  2. OBM ODM OEM 含义
  3. 【MySQL数据库之多表关联关系(一对一、一对多、多对多)】
  4. ENVI Classic:如何进行图像融合(HSV变换/Brovey变换/PC变换)?
  5. 《公共政策学》重点整理
  6. 公告栏模板php代码,PHP_destoon调用自定义模板及样式的公告栏,destoon中默认的首页公告栏调用 - phpStudy...
  7. 各家银行信用卡分期付款手续费一览表
  8. 【案例】利用 SolidWorks 对连续式碳纤维 3D 打印技术进行创新设计
  9. 科大讯飞语音集成,非常详细的使用讲解
  10. SpringBoot 之Profiles