iscsi 挂载教程_Ubuntu iSCSI服务-Windows挂载-简易教程 - IT客栈

本文提供了一步一步的Ubuntu iSCSI服务配置教程,包括安装tgt服务,创建Target和LUN,以及允许所有人连接。此外,还介绍了如何在Windows上通过iSCSI发起程序连接到Ubuntu服务器,实现磁盘挂载。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以下为安装tgt服务,(SCSI Target服务)

#apt install tgt -y

以下命令为创建一个Target其tid为1名称为iqn.2020-11.com:cmtg

#tgtadm --lld iscsi --mode target --op new --tid 1 --targetname iqn.2020-11.com:cmtg

以下命令为查看Target记录是否已创建

#tgtadm --lld iscsi --mode target --op show

Target 1: iqn.2020-11.com:cmtg

System information:

Driver: iscsi

State: ready

I_T nexus information:

LUN information:

LUN: 0

Type: controller

SCSI ID: IET 00010000

SCSI SN: beaf10

Size: 0 MB, Block size: 1

Online: Yes

Removable media: No

Prevent removal: No

Readonly: No

SWP: No

Thin-provisioning: No

Backing store type: null

Backing store path: None

Backing store flags:

Account information:

ACL information:

以下命令让任何人都能连接到该Target

#tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL

以下命令为创建一个新的LUN号,/dev/sda可以是一个硬盘,或分区,或卷组,或RAID

#tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/sda

以下命令查看icssi服务状态

#tgtadm --lld iscsi --mode target --op show

Target 1: iqn.2020-11.com:cmtg

System information:

Driver: iscsi

State: ready

I_T nexus information:

LUN information:

LUN: 0

Type: controller

SCSI ID: IET 00010000

SCSI SN: beaf10

Size: 0 MB, Block size: 1

Online: Yes

Removable media: No

Prevent removal: No

Readonly: No

SWP: No

Thin-provisioning: No

Backing store type: null

Backing store path: None

Backing store flags:

LUN: 1

Type: disk

SCSI ID: IET 00010001

SCSI SN: beaf11

Size: 500108 MB, Block size: 512

Online: Yes

Removable media: No

Prevent removal: No

Readonly: No

SWP: No

Thin-provisioning: No

Backing store type: rdwr

Backing store path: /dev/sda

Backing store flags:

Account information:

ACL information:

ALL

直接Windows搜索iSCSI发起程序(没有启动服务器回提醒你启动下的)

输入服务器IP快速连接就OK了~,记录2020/11/12

补充:(2020/11/16)

如果配置正确的话可以使用以下命令保存到配置

tgt-admin --dump > /etc/tgt/targets.conf

版权声明:若无特殊注明,本文皆为《

CM部落 》原创,转载请保留文章出处。

本文链接:Ubuntu iSCSI服务-Windows挂载-简易教程 https://itkz.cn/note/138.html

正文到此结束

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值