คำสั่งเกี่ยวกับ iscsi-initiator-utils
mrgill | January 7, 2011 | 215 Views
วันนี้เก็บเอาคำสั่งเกี่ยวกับ iscsi-initiator-utils มาเก็บไว้กันลืมครับ
ก็เป็นพวกคำสั่ง discovery target การ login เข้าใช้ target แล้วก็คำสั่งลบ target ที่ไม่ต้องการ
ตามนี้ครับ
[root@rac1 ~]# iscsiadm -m discovery -t sendtargets -p 10.30.1.140 #คำสั่ง discovery
10.30.1.140:3260,1 iqn.1994-05.com.redhat:rac1
10.30.1.140:3260,1 iqn.1994-05.com.redhat:rac2
[root@rac1 ~]#
[root@rac1 ~]# /etc/init.d/iscsi restart
Logging out of session [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Logout of [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
Stopping iSCSI daemon:
iscsid dead but pid file exists [ OK ]
Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Logging in to [iface: default, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260]
Login to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
Login to [iface: default, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260]: successful
[ OK ]
[root@rac1 ~]#
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3263 26105625 8e Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 10240 10485744 83 Linux
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 10240 10485744 83 Linux
Disk /dev/sdd: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 10240 10485744 83 Linux
Disk /dev/sde: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 10240 10485744 83 Linux
[root@rac1 ~]#
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac2 -o delete
iscsiadm: This command will remove the record [iface: default, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260], but a session is using it. Logout session then rerun command to remove record.
iscsiadm: Could not execute operation on all records. Err 22.
[root@rac1 ~]#
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac2 -u #คำสั่ง logout จาก target
Logging out of session [sid: 2, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260]
Logout of [sid: 2, target: iqn.1994-05.com.redhat:rac2, portal: 10.30.1.140,3260]: successful
[root@rac1 ~]#
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac2 -o delete #คำสั่งลบ target
[root@rac1 ~]#
[root@rac1 ~]# /etc/init.d/iscsi restart #คำสั่ง restart iscsi-initiator-utils
Logging out of session [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Logout of [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
Stopping iSCSI daemon:
iscsid dead but pid file exists [ OK ]
Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Login to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
[ OK ]
[root@rac1 ~]#
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3263 26105625 8e Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 10240 10485744 83 Linux
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 10240 10485744 83 Linux
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac1 -u
Logging out of session [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Logout of [sid: 1, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
[root@rac1 ~]#
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3263 26105625 8e Linux LVM
[root@rac1 ~]# iscsiadm -m node -p 10.30.1.140 -T iqn.1994-05.com.redhat:rac1 -l #คำสั่ง login เข้าใช้งาน target
Logging in to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]
Login to [iface: default, target: iqn.1994-05.com.redhat:rac1, portal: 10.30.1.140,3260]: successful
[root@rac1 ~]#
[root@rac1 ~]# fdisk -l #คำสั่งแสดง partition
Disk /dev/sda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3263 26105625 8e Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 10240 10485744 83 Linux
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 10240 10485744 83 Linux
[root@rac1 ~]#
Comments
Category : Daily command,Daily tips,Linux,Ubuntu


1 Comment Leave a Comment
1.
occupational therapy | January 11, 2011 at 11:51 PM
I’ve recently started a blog, the information you provide on this site has helped me tremendously. Thank you for all of your time & work.
Leave a Comment
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
TrackBack URL | RSS feed for comments on this post.