首页 > 其他 > 详细

centos7.5 连接存储配置iscsi

时间:2021-04-26 15:55:53      阅读:29      评论:0      收藏:0      [点我收藏+]

 

 

linux 安装iscsi包

 

[root@localhost ~]# yum  list | grep iscs
iscsi-initiator-utils.x86_64            6.2.0.874-7.el7                cr       
iscsi-initiator-utils-iscsiuio.x86_64   6.2.0.874-7.el7                cr       
libiscsi.x86_64                         1.9.0-7.el7                    cr       
libvirt-daemon-driver-storage-iscsi.x86_64
[root@localhost ~]# yum install iscsi-initiator-utils
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 iscsi-initiator-utils.x86_64.0.6.2.0.874-7.el7 将被 安装
--> 正在处理依赖关系 iscsi-initiator-utils-iscsiuio >= 6.2.0.874-7.el7,它被软件包 iscsi-initiator-utils-6.2.0.874-7.el7.x86_64 需要
--> 正在检查事务
---> 软件包 iscsi-initiator-utils-iscsiuio.x86_64.0.6.2.0.874-7.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=======================================================================================================================================================================
 Package                                                 架构                            版本                                        源                           大小
=======================================================================================================================================================================
正在安装:
 iscsi-initiator-utils                                   x86_64                          6.2.0.874-7.el7                             cr                          422 k
为依赖而安装:
 iscsi-initiator-utils-iscsiuio                          x86_64                          6.2.0.874-7.el7                             cr                           90 k

事务概要
=======================================================================================================================================================================
安装  1 软件包 (+1 依赖软件包)

总下载量:512 k
安装大小:2.6 M
Is this ok [y/d/N]: y
Downloading packages:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                    17 MB/s | 512 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
  正在安装    : iscsi-initiator-utils-6.2.0.874-7.el7.x86_64                                                                                                       1/2 
  正在安装    : iscsi-initiator-utils-iscsiuio-6.2.0.874-7.el7.x86_64                                                                                              2/2 
  验证中      : iscsi-initiator-utils-iscsiuio-6.2.0.874-7.el7.x86_64                                                                                              1/2 
  验证中      : iscsi-initiator-utils-6.2.0.874-7.el7.x86_64                                                                                                       2/2 

已安装:
  iscsi-initiator-utils.x86_64 0:6.2.0.874-7.el7                                                                                                                       

作为依赖被安装:
  iscsi-initiator-utils-iscsiuio.x86_64 0:6.2.0.874-7.el7                                                                                                              

完毕!
[root@localhost ~]# systemctl enable iscsi
[root@localhost ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.1994-05.com.redhat:b5f8f023e12e

 

查看linux iqn存储上面配置映射

 

技术分享图片

 

 

存储划分50t

 

技术分享图片

 

 

发现存储映射,

[root@localhost ~]# iscsiadm -m discovery -t sendtargets -p 192.168.130.101:3260
192.168.130.101:3260,1 iqn.2002-09.com.lenovo:thinksystem.6d039ea00017d07900000000607eb8a4
[fe80:0000:0000:0000:d239:eaff:fe1c:f4d5]:3260,1 iqn.2002-09.com.lenovo:thinksystem.6d039ea00017d07900000000607eb8a4
192.168.131.101:3260,1 iqn.2002-09.com.lenovo:thinksystem.6d039ea00017d07900000000607eb8a4
192.168.130.102:3260,2 iqn.2002-09.com.lenovo:thinksystem.6d039ea00017d07900000000607eb8a4
192.168.131.102:3260,2 iqn.2002-09.com.lenovo:thinksystem.6d039ea00017d07900000000607eb8a4

 

连接存储

[root@localhost ~]# iscsiadm -m node -T iqn.2002-09.com.lenovo:thinksystem.6d039ea00017d07900000000607eb8a4 -p 192.168.130.101 -l                       
Logging in to [iface: default, target: iqn.2002-09.com.lenovo:thinksystem.6d039ea00017d07900000000607eb8a4, portal: 192.168.130.101,3260] (multiple)
Login to [iface: default, target: iqn.2002-09.com.lenovo:thinksystem.6d039ea00017d07900000000607eb8a4, portal: 192.168.130.101,3260] successful.
[root@localhost ~]# fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

磁盘 /dev/sda:3998.0 GB, 3997997989888 字节,7808589824 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):65536 字节 / 131072 字节
磁盘标签类型:gpt
Disk identifier: DAAB1D88-0795-4EC3-89D7-2171BDD4AB12


#         Start          End    Size  Type            Name
 1         2048      1026047    500M  EFI System      EFI System Partition
 2      1026048      2050047    500M  Microsoft basic 
 3      2050048   7808587775    3.7T  Linux LVM       

磁盘 /dev/mapper/centos-root:214.7 GB, 214748364800 字节,419430400 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):65536 字节 / 131072 字节


磁盘 /dev/mapper/centos-swap:17.2 GB, 17179869184 字节,33554432 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):65536 字节 / 131072 字节


磁盘 /dev/mapper/centos-ava_app:3765.0 GB, 3765016985600 字节,7353548800 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):65536 字节 / 131072 字节


磁盘 /dev/sdb:8095 MB, 8095006720 字节,15810560 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0xcad4ebea

   设备 Boot      Start         End      Blocks   Id  System
/dev/sdb4   *         256    15810559     7905152    b  W95 FAT32
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

磁盘 /dev/sdc:54975.6 GB, 54975581388800 字节,107374182400 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 4096 字节
I/O 大小(最小/最佳):4096 字节 / 4096 字节
磁盘标签类型:gpt
Disk identifier: E8286D05-FA93-4CE0-82F2-573F930EB840


#         Start          End    Size  Type            Name
 1           34 107374180447     50T  Microsoft basic primary
Partition 1 does not start on physical sector boundary.

磁盘 /dev/sdd:20 MB, 20971520 字节,40960 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节

[root@localhost ~]#

存储空间上次分过区了,这里显示有一个主分区。

 

如果是没分区的话,可以使用parted进行分区(设立不介绍分区步骤了,参考parted 命令)

 

挂载分区,设置开机自动挂载

 

[root@localhost ~]# mkdir /DATA
[root@localhost ~]# mount /dev/sdc
sdc   sdc1  
[root@localhost ~]# mount /dev/sdc1 /DATA
[root@localhost ~]# vi /etc/fstab 
[root@localhost ~]# cat /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Mon Apr 26 10:27:26 2021
#
# Accessible filesystems, by reference, are maintained under /dev/disk
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
/dev/sdc1 /DATA                       xfs     defaults        0 0
/dev/mapper/centos-ava_app /ava_app                xfs     defaults        0 0
UUID=c6488b46-0004-4511-9fa1-3fbe2bcdfe40 /boot                   xfs     defaults        0 0
UUID=50D8-7F59          /boot/efi               vfat    umask=0077,shortname=winnt 0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0
[root@localhost ~]# 

 

centos7.5 连接存储配置iscsi

原文:https://www.cnblogs.com/wenxiao1-2-3-4/p/14704025.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!