Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic uses of iscsiadm

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail what the basic usage of iscsiadm is. The content of the article is of high quality. Therefore, Xiaobian shares it with you as a reference. I hope that after reading this article, you will have a certain understanding of relevant knowledge.

# rpm -ivh iscsi-initiator-utils-6.2.0.742-0.5.el5.i386.rpm

iSCSI initiator and iscsiadm installed on the server

Iscsiadm is a command-line-based iscsi administration tool that provides operations on iscsi nodes, sessions, connections, and discovery records.

Instructions for iscsiadm can be found in/usr/share/doc/iscsi-initiator-utils-6.2.0.742/README, or you can run man iscsiadm or iscsiadm --help

use

Here are the steps to connect iscsi devices:

1 Start the iscsi daemon

#service iscsi start

By default, this process runs automatically after system startup

2 Target detected

By default, the iscsi initiator and target are connected via port 3260. Assuming that the IP of the target of iscsi is known to be 192.168.1.1, run the following command:

#chkconfig iscsi on;chkconfig iscsi --list (view ISCSI startup status)

#iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260

At this point, you have a target.

192.168.1.1:3260,1 iqn.1997-05.com.test:raid

Discovered objects are also called nodes.

3 Entry points

Take, for example, the target found above.

# iscsiadm -m node -T iqn.1997-05.com.test:raid -p 192.168.1.1:3260 -l

where iqn.1997-05.com.test:raid is the target name

If you want to log in automatically at system startup

# iscsiadm -m node -T iqn.1997-05.com.test:raid -p 192.168.1.1:3260 --op update -n node.startup -v automatic

After logging in, run

#fdisk -l

You should be able to see the target's storage device information, such as

Disk /dev/sdb: 3489.8 GB, 3489862254592 bytes

255 heads, 63 sectors/track, 424284 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

/dev/sdb is the attached iscsi storage device

To log in to a node that requires a Captcha:

(1) Open certification

iscsiadm -m node -T [install] -o update --name node.session.auth.authmethod --value=CHAP

*. Use-o with--op

(2) Adding users

iscsiadm -m node -T [device] --op update --name node.session.auth.username --value=[username]

(3) Add password

iscsiadm -m node -T [device] -op update -name node.session.auth.password -value=[password]

4 Format equipment

To format your device as an ext3 file system, run

# mkfs.ext3 /dev/sdb

5 Attachment devices

Create iscsi directory under/mnt

Run mount command:

# mount -t /dev/sdb /mnt/iscsi

Special mount options for iscsi devices

Run df -h to see:

/dev/sdb 3.4T186M 3.4T 1% /mnt/iscsi

The iscsi device was successfully attached and can be used as a regular storage device.

If you want to hook up automatically at system startup

edit the/etc/fstab

Insert a line:

/dev/sdb /mnt/iscsi ext3 default 0 0

6 Logout node

First unhook.

#umount /mnt/iscsi

logout

# iscsiadm -m node -T iqn.1997-05.com.test:raid -p 192.168.1.1:3260 -u

About iscsiadm basic usage what to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report