iscsi常用命令

2021-09-12 05:16:37 字數 2160 閱讀 2756

1.檢視target 資訊

# tgt-admin  --show

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

target 1: iqn.2010-10.org.openstack:volume-00000008

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

readonly: no

backing store type: null

backing store path: none

backing store flags: 

lun: 1

type: disk

scsi id: iet     00010001

scsi sn: beaf11

size: 10737 mb, block size: 512

online: yes

removable media: no

readonly: no

backing store type: rdwr

backing store path: /dev/nova-volumes/volume-00000008

backing store flags: 

account information:

acl information:

all2.手動發現target,偵測 172.26.80.5 這部 iscsi 裝置的相關資料

#iscsiadm -m discovery -t sendtargets -p 172.26.80.5

3.顯示系統所有target

#iscsiadm -m node

172.26.80.5:3260,1 iqn.2010-10.org.openstack:volume-00000008

4.登入target

# iscsiadm -m node -t iqn.2010-10.org.openstack:volume-00000008  --login

logging in to [iface: default, target: iqn.2010-10.org.openstack:volume-00000008, portal: 172.26.80.5,3260]

login to [iface: default, target: iqn.2010-10.org.openstack:volume-00000008, portal: 172.26.80.5,3260]: successful

#fdisk -l 可以檢視到多了乙個新的磁碟,大小和volume-00000008一樣大

5.登出target

# iscsiadm -m node -t iqn.2010-10.org.openstack:volume-00000008  --logout

logging out of session [sid: 1, target: iqn.2010-10.org.openstack:volume-00000008, portal: 172.26.80.5,3260]

logout of [sid: 1, target: iqn.2010-10.org.openstack:volume-00000008, portal: 172.26.80.5,3260]: successful

6.檢視建立的session

#iscsiadm -m session

tcp: [3] 172.26.80.5:3260,1 iqn.2010-10.org.openstack:volume-00000008

只有登入target才能看到會話

7.刪除target

#iscsiadm -m node -o delete -t iqn.2010-10.org.openstack:volume-00000008

只有logout後,才能刪除target

docker常用命令 Docker 常用命令筆錄

格式docker run 選項 映象 命令 引數.示例docker run it rm ubuntu 16.04 bash 示例解釋 it 這是兩個引數,乙個是 i,表示互動式操作,乙個是 t表示終端 rm 這個引數是說容器退出後隨之將其刪除 ubuntu 16.04 這是指用ubuntu 16.0...

常用命令 Git 常用命令大全

安裝教程可參照 廖雪峰老師的安裝教程。git config 在git中,使用git config 命令來配置 git 的配置檔案,git配置級別主要有3類 1 倉庫級別 local 本地 git 倉庫級別配置檔案,作用於當前倉庫。優先順序最高 2 使用者級別 global,全域性配置檔案,作用於所有...

Linux常用命令 vi vim常用命令介紹

vi vim是linux系統自帶的乙個功能豐富的文字編輯器 命令字元 介紹dd 雙擊d 剪下當前行 num dd 雙擊d 剪下當前行 例如10dd可以刪除10行 yy拷貝當前行 p將內容貼上至游標所示位置 命令 說明 set number 頁面顯 hi 檢視當前系統提供的高亮模式 match col...