27.2. iSCSI Initiator Creation


An iSCSI initiator is the client who wishes to access the storage on a target, or server. The IP address of the target needs to be known for this process.

过程 27.2. Create an iSCSI Initiator

  1. Install iscsi-initiator-utils.
    ~]# yum install iscsi-initiator-utils
  2. Discover the target. Use the target's IP address, the one used below serves only as an example.
    ~]# iscsiadm -m discovery -t sendtargets -p 192.168.1.1
    Starting iscsid:     [ OK ]
    192.168.1.1:3260,1 iqn.2015-06.com.example.test:target1
    
    The above shows the target's IP address and IQN address. It is the IQN address that is needed for future steps.
  3. Connect to the target.
    ~]# iscsiadm -m node -T iqn.2015-06.com.example:target1 --login
    Logging in to [iface: default, target: iqn.2015-06.com.example:target1, portal: 192.168.1.1,3260] (multiple)
    Login in to [iface: default, target: iqn.2015-06.com.example:target1, portal: 192.168.1.1,3260] successful.
    
  4. Find the iSCSI disk name.
    ~]# grep "Attached SCSI" /var/log/messages
    Jun 19 01:30:26 test kernel: sd 7:0:0:1 [sdb] Attached SCSI disk
    
  5. Create a file system on that disk.
    ~]# mkfs.ext4 /dev/sdb
  6. Mount the file system.
    ~]# mkdir /mnt/iscsiTest
    ~]# mount /dev/sdb /mnt/iscsiTest
    
  7. Make it persistent across reboots by editing the /etc/fstab file.
    ~]# blkid /dev/sdb
    /dev/sdb: UUID="766a3bf4-beeb-4157-8a9a-9007be1b9e78" TYPE="ext4"
    ~]# vim /etc/fstab
    UUID=766a3bf4-beeb-4157-8a9a-9007be1b9e78	/mnt/iscsiTest	ext4	_netdev	0 0
    
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.