Iscsi configuration, linuxiscsi Configuration

Source: Internet
Author: User
Tags server memory

Iscsi configuration, linuxiscsi Configuration

I. Installation

[Root @ server05 Desktop] # yum install scsi-target-utils-y

Ii. Server

# [Root @ server05 Desktop] # vim/etc/tgt/targets. conf

[Root @ server05 Desktop] # service tgtd start

Open the help document:

[Root @ server05 Desktop] # man tgtadm

Copy:

Tgtadm -- lld iscsi -- mode target -- op new -- tid 1 -- targetname iqn.2007-03: virtual-dvd: 'hostname'

Modify Name:

[Root @ server05 Desktop] # tgtadm -- lld iscsi -- mode target -- op new -- tid 1 -- targetname iqn.2014-09.com. example: server_target

 

Split a disk into sdb1:

View:

[Root @ server05 Desktop] # ll/dev/sdb

Sdb sdb1

Sdb1 created successfully

[Root @ server05 Desktop] # man tgtadm

[Root @ server05 Desktop] # tgtadm -- lld iscsi -- op new -- mode logicalunit -- tid 1 -- lun 1 -- bstype = sg -- device-type = pt -- backing-store =/dev /sg4

Modify:

[Root @ server05 Desktop] # tgtadm -- lld iscsi -- op new -- mode logicalunit -- tid 1 -- lun 1 -- backing-stor =/dev/sdb1

 

Query:

[Root @ server05 Desktop] # tgt-admin -- dump

Default-driver iscsi

 

& Lt; target iqn.2014-09.com. example: server_target & gt;

Backing-store/dev/sdb1

</Target>

 

Redirect the above configuration to the configuration file:

[Root @ server05 Desktop] # tgt-admin -- dump>/etc/tgt/targets. conf

 

Sharing:

[Root @ server05 Desktop] # tgtadm -- lld iscsi -- mode target -- op bind -- tid 1 -- initiator-address 192.168.4.203

 

[Root @ server05 Desktop] # tgt-admin -- dump

You can see more

Initiator-address 192.168.4.203 line

[Root @ server05 Desktop] # tgt-admin -- dump>/etc/tgt/targets. conf

 

[Root @ server05 Desktop] #/etc/init. d/tgtd restart

 

Disable firewall,

The server is complete.

 

Iii. Client

 

[Root @ station3 Desktop] # yum install iscsi-initiator-utils.x86_64

 

[Root @ station3 Desktop] # man iscsiadm

Copy and change the IP address under EXAMPLES to the server address

Root @ station3 Desktop] # iscsiadm -- mode discoverydb -- type sendtargets -- portal 192.168.4.103 -- discover

 

[Root @ station3 Desktop] # man iscsiadm

Copy content:

[Root @ station3 Desktop] # iscsiadm -- mode node -- targetname iqn.2001-05.com. doe: test -- portal

To:

[Root @ station3 Desktop] # iscsiadm -- mode node -- targetname iqn.2014-09.com. example: server_target -- portal 192.168.4.103: 3260 -- login

(Modify ipn and address)

[Root @ station3 Desktop] # fdisk-l

One more hard disk

This disk can be partitioned, formatted, mounted, and used.

 

Exit:

[Root @ station3 Desktop] # iscsiadm -- mode node -- targetname iqn.2014-09.com. example: server_target -- portal 192.168.4.103: 3260 -- logout

 

Return to server:

[Root @ server05 Desktop] # fdisk-cu/dev/sdb1

Command (m for help): p

You can see:

Device Boot Start End Blocks Id System

/Dev/sdb1p1 62 2101923 1050931 83 Linux

 


How to configure windows iscsi Server

Install windows 2008 r2 and then download the iscsi software target. After installation, you can release the disk. The released disk can now be used by other computers.
On other computers, there are directly iscsi initiator programs in win7 or 08, which can be found in the management tools. If it is in xp or 03, you need to install the iscsi initiator program.
Run the iscsi initiator to connect to the disk you released earlier. After the connection, it can be used like a local hard disk.
Another one is very good for iscsi. This is based on the FreeBSD system. FreeNAS is very powerful.

Configure WINDOWS2003 for the ISCSI network disk. If you reinstall it, how can we retrieve the data in the original ISCSI disk (ISCSI cannot be shared by multiple machines by default)

The ip san storage is similar to a new hard disk connected to the local server. It cannot write data to the same partition at the same time. Otherwise, the file is inconsistent, resulting in a file system crash in the partition.
Based on the test, A writes data, which is not visible in partition B. It may be that data of A is first written to the server memory and then written to the physical disk, when B is running, A data is still in the cache or B does not scan the partition data again.
If the data has been written to the ISCSI partition disk, the data will be saved in the disk for a while, just as if the data is stored in a USB flash drive. After the system is re-installed, if there are no operating system restrictions, data in B can be read normally.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.