ISCSI客户端配置:

  1. yum install iscsi-initiator-utils

  2. vim /etc/iscsi/initiatorname.iscsi

    InitiatorName = iqn.2014-11...:Desktop0

  3. systemctl restart iscsid.service

    systemctl enable iscsid(与服务器通讯)

    systemctl restart iscsi(读取iscsi文件)

    systemctl enable iscsi

  4. iscsiadm -m discovery -t st(send target) -p server0 可以man iscsiadmin 查看

  5. yum -y install tree

    tree /var/lib/iscsi/

  6. systemctl restart iscsi

  7. fdisk -l 可看到/dev/sda的盘,只要保证iscsi开启并且/var/lib/iscsi里的内容还在,那么开机后就会有iscsi的盘

  8. fdisk /dev/sda; n,p,+500M,w,partprobe

    mkfs.xfs /dev/sda1

    mkdir /iscsidisk; blkid  获取UUID,用来挂载

  9. vim /etc/fstab

    UUID = "..." /iscsidisk xfs defaults, _netdev 0 0

  10. mount -a 重启后查看是否挂载

  11. 出错时可以用: rm -rf /var/lib/iscsi/*  再重新做一遍