柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!
全部博文(1669)
分类: 服务器与存储
2014-06-04 20:03:20
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
[root@node4 ~]# yum install scsi-target-utils -y
[root@node4 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vgsrv 1 3 0 wz--n- 8.78g 4.69g
[root@node4 ~]# lvcreate -L 1GB -n lv0 vgsrv
Logical volume "lv0" created
[root@node4 ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
home vgsrv -wi-ao 256.00m
lv0 vgsrv -wi-a- 1.00g
root vgsrv -wi-ao 3.31g
swap vgsrv -wi-ao 544.00m
[root@node4 ~]# ls /dev/vgsrv/lv0
/dev/vgsrv/lv0
|
1
2
3
|
backing-store /dev/vgsrv/lv0
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
[root@node4 ~]# service tgtd start
Starting SCSI target daemon: [ OK ]
[root@node4 ~]# tgt-admin --show
Target 1: iqn.2013-05.com.clovem:target1
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: 1074 MB, Block size: 512
Online: Yes
Removable media: No
Readonly: No
Backing store type: rdwr
Backing store path: /dev/vgsrv/lv0
Backing store flags:
Account information:
ACL information:
ALL
|
1
2
3
4
|
[root@desktop26 ~]# rpm -q iscsi-initiator-utils
iscsi-initiator-utils-6.2.0.872-34.el6.x86_64
[root@desktop26 ~]# which iscsiadm
/sbin/iscsiadm
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
[root@desktop26 ~]# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sda3
[root@desktop26 ~]# iscsiadm -m discovery -t sendtargets -p 172.18.26.4:3260
172.18.26.4:3260,1 iqn.2013-05.com.clovem:target1
[root@desktop26 ~]# iscsiadm -m node -T iqn.2013-05.com.clovem:target1 -l
Logging in to [iface: default, target: iqn.2013-05.com.clovem:target1, portal: 172.18.26.4,3260] (multiple)
Login to [iface: default, target: iqn.2013-05.com.clovem:target1, portal: 172.18.26.4,3260] successful.
[root@desktop26 ~]# ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2 /dev/sda3 /dev/sdb
[root@desktop26 ~]# ls /dev/disk/by-path/
ip-172.18.26.4:3260-iscsi-iqn.2013-05.com.clovem:target1-lun-1 pci-0000:00:07.1-scsi-1:0:1:0-part1
pci-0000:00:07.1-scsi-1:0:0:0 pci-0000:00:07.1-scsi-1:0:1:0-part2
pci-0000:00:07.1-scsi-1:0:1:0 pci-0000:00:07.1-scsi-1:0:1:0-part3
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
[root@desktop26 ~]# iscsiadm -m session -P1
Target: iqn.2013-05.com.clovem:target1
Current Portal: 172.18.26.4:3260,1
Persistent Portal: 172.18.26.4:3260,1
**********
Interface:
**********
Iface Name: default
Iface Transport: tcp
Iface Initiatorname: iqn.1994-05.com.redhat:59585542a2c
Iface IPaddress: 172.18.26.254
Iface HWaddress:
Iface Netdev:
SID: 2
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
[root@desktop26 ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.2013-05.com.clovem:node1
[root@desktop26 ~]# iscsiadm -m node -T iqn.2013-05.com.clovem:target1 -u
Logging out of session [sid: 10, target: iqn.2013-05.com.clovem:target1, portal: 172.18.26.4,3260]
Logout of [sid: 10, target: iqn.2013-05.com.clovem:target1, portal: 172.18.26.4,3260] successful.
[root@desktop26 ~]# service iscsid stop
Stopping iscsid:
[root@desktop26 ~]# iscsiadm -m discovery -t sendtargets -p 172.18.26.4:3260
Starting iscsid: [ OK ]
172.18.26.4:3260,1 iqn.2013-05.com.clovem:target1
[root@desktop26 ~]# iscsiadm -m node -T iqn.2013-05.com.clovem:target1 -l
Logging in to [iface: default, target: iqn.2013-05.com.clovem:target1, portal: 172.18.26.4,3260] (multiple)
Login to [iface: default, target: iqn.2013-05.com.clovem:target1, portal: 172.18.26.4,3260] successful.
[root@desktop26 ~]# iscsiadm -m session -P1
Target: iqn.2013-05.com.clovem:target1
Current Portal: 172.18.26.4:3260,1
Persistent Portal: 172.18.26.4:3260,1
**********
Interface:
**********
Iface Name: default
Iface Transport: tcp
Iface Initiatorname: iqn.2013-05.com.clovem:node1
Iface IPaddress: 172.18.26.254
Iface HWaddress:
Iface Netdev:
SID: 11
iSCSI Connection State: LOGGED IN
iSCSI Session State: LOGGED_IN
Internal iscsid Session State: NO CHANGE
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
[root@node4 ~]# tgt-admin --show
Target 1: iqn.2013-05.com.clovem:target1
System information:
Driver: iscsi
State: ready
I_T nexus information:
I_T nexus: 11
Initiator: iqn.2013-05.com.clovem:node1
Connection: 0
IP Address: 172.18.26.254
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: 1074 MB, Block size: 512
Online: Yes
Removable media: No
Readonly: No
Backing store type: rdwr
Backing store path: /dev/vgsrv/lv0
Backing store flags:
Account information:
ACL information:
ALL
|
1
2
3
4
5
6
7
8
|
< backing-store /dev/vgsrv/lv0>
vendor-id clovemfong, Inc.
scsi_id target1
scsi_sn s01
initiator-address 172.18.26.254
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
[root@node4 ~]# tgt-admin --show
Target 1: iqn.2013-05.com.clovem:target1
System information:
Driver: iscsi
State: ready
I_T nexus information:
I_T nexus: 1
Initiator: iqn.2013-05.com.clovem:node1
Connection: 0
IP Address: 172.18.26.254
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: target1
SCSI SN: s01
Size: 1074 MB, Block size: 512
Online: Yes
Removable media: No
Readonly: No
Backing store type: rdwr
Backing store path: /dev/vgsrv/lv0
Backing store flags:
Account information:
ACL information:
172.18.26.254
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
[root@desktop26 ~]# parted /dev/sdb mklabel gpt
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes
Information: You may need to update /etc/fstab.
[root@desktop26 ~]# parted /dev/sdb mkpart rh436 200m 300m
Information: You may need to update /etc/fstab.
[root@desktop26 ~]# parted /dev/sdb print
Model: IET VIRTUAL-DISK (scsi)
Disk /dev/sdb: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 200MB 300MB 99.6MB rh436
[root@desktop26 ~]# mkfs.ext4 /dev/sdb1 > /dev/null 2>&1
[root@desktop26 ~]# parted /dev/sdb print
Model: IET VIRTUAL-DISK (scsi)
Disk /dev/sdb: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 200MB 300MB 99.6MB ext4 rh436
[root@desktop26 ~]# mkdir /rh436 ; mount /dev/sdb1 /rh436 ; df -H |grep rh436
/dev/sdb1 97M 5.8M 86M 7% /rh436
|