在 linux 系统下安装和配置 iSCSI 教程
测试系统为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。
c) 使用命令rpm --qa | grep iscsi确认系统中已经成功安装了iscsi Initiator。并且在/etc下会产生iscsi文件夹,该文件夹下同时生成两个文件initiatorname.iscsi、iscsid.conf。
d) 使用命令chkconfig --list查看iscsi、iscsid服务在运行级别3、5中是否属于自动启动状态。(注意:如果不是可以使用chkconfig --level将其设置为自动启动。
如果iscsid和iscsi没有随系统的启动而启动,则用chkconfig设置这两个服务在系统运行级别为3和5时随系统启动而启动
# chkconfig iscsi --level 345 on # chkconfig iscsid --level 345 on
2、 执行Target发现。
a) 首先使用命令/etc/init.d/iscsid start启动iscsi守护进程。
b) 用命令iscsiadm –m discovery –t sendtargets –p 192.168.1.92发现192.168.1.92上的iscsi资源。
c) 使用命令iscsiadm –m node查看已发现的所有iscsi资源(该步骤可选)
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如图:
4、 启动iscsi服务,将通过iscsi挂载的磁盘分区格式化。
a) 使用命令/etc/init.d/iscsi start启动iscsi服务,此时将会挂载iscsi设备,如图。
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.
上一篇: Samba 配置文件常用参数详解
下一篇: 检测十位和百位上 n 位数的重复数字
推荐阅读
-
在 Windows 上安装和配置 Maven [图解教程
-
使用 winzip 生成的扩展名为 -ZIP 的压缩文件通常使用".zip "扩展名,其 MIME 格式为 application/zip。(推荐学习:phpstorm) 目前,ZIP 格式属于几种主流压缩格式之一,其竞争对手包括 RAR 格式和开源的 7z 格式。 从性能对比来看,RAR 和 7z 格式比 ZIP 格式压缩率更高,而 7-Zip 由于提供免费压缩工具而逐渐在更多领域得到应用。 微软从 Windows ME 操作系统开始就内置了对 zip 格式的支持,即使用户没有在电脑上安装解压软件,也可以打开和创建 zip 格式的压缩文件,OS X 和流行的 Linux 操作系统也提供了类似的 zip 格式支持。 因此,如果要在网络上传播和分发文件,zip 格式往往是最常见的选择。
-
pytorch 安装 GPU 版本(Cuda12.1)教程:在 Windows、Mac 和 Linux 系统中快速安装 PyTorch for GPU (CUDA 12.1)
-
在 Windows 上安装和配置 Redis(图解教程)
-
Linux redis 安装过程和配置详细教程 [以 5.0.5 为例]。
-
完整教程:Windows 环境下 Jupyter Notebook 的安装、运行和工作文件夹配置
-
在 Linux 下使用 alsamixer 配置系统默认声卡设备(默认音频输出设备、输入设备、系统音量
-
在 Linux 下使用 alsamixer 配置系统默认声卡设备(默认音频输出设备、输入设备、系统音量
-
VASP学习】在Ubuntu系统中安装vasp.5.4.4的全过程(包括VASP官方学习资料、安装过程中相关编辑器的配置、VASP的编译和VASP测试)
-
在 Windows 上安装、部署和连接 MongoDB 7.x(命令行启动、配置文件启动和将启动命令安装为系统服务启动) - 启动 MongoDB