Вы находитесь на странице: 1из 3

Lun(iSCSI) setup with Linux example

1. Test
OS Server Storage Centos 5.4 DataOntap 7.3.2 Lun size 1g software iSCSI initiator License iSCSI IP 220.117.55.226 220.117.55.225

2. iscsi initiator (server)


1) yum yum # yum list iscsi* # yum install iscsi-initiator* 2) rpm ( OS ) # rpm -qa | grep iscsi* # rpm Uvh --aid iscsi-initiator-utils*

2. Host Utility (server)


-> version 5.0 # tar -xvf netapp_linux_host_utilities_5_0.tar.gz # cd netapp_linux_host_utilities_5_0 # ./install

3. IQN (server)
# iscsiadm -m discovery -t sendtargets -p 220.117.55.225 220.117.55.225:3260,1000 iqn.1992-08.com.netapp:sn.84203700 -> Storage IQN # more /etc/iscsi/initiatorname.iscsi InitiatorName=iqn.1994-05.com.redhat:5c4516d4863c -> Server IQN

4. igroup lun (storage)


> igroup create -i -t linux linux_ig iqn.1994-05.com.redhat:5c4516d4863c > lun create -s 1g -t linux -o noreserve /vol/iscsi/linux/lun.0 > lun map /vol/iscsi/linux/lun.0 linux_ig 0

5. Lun discover(server)

# service iscsi start # iscsiadm -m node -T iqn.1992-08.com.netapp:sn.84203700 -p 220.117.55.225 -l # iscsiadm -m session rescan

6. Lun format(server)
# fdisk -l # /opt/netapp/santools/sanlun lun show
[root@netapp ~]# /opt/netapp/santools/sanlun lun show controller: lun-pathname device filename adapter host2 protocol iSCSI lun size 1g (1073741824) lun state GOOD F270: /vol/iscsi/linux/lun.0 /dev/sdb

# fdisk /dev/sdb
[root@netapp santools]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): p Disk /dev/sdb: 1073 MB, 1073741824 bytes 34 heads, 61 sectors/track, 1011 cylinders Units = cylinders of 2074 * 512 = 1061888 bytes Device Boot Start End Blocks Id System

Command (m for help): n Command action e p p Partition number (1-4): 1 First cylinder (1-1011, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-1011, default 1011): Using default value 1011 Command (m for help): p Disk /dev/sdb: 1073 MB, 1073741824 bytes 34 heads, 61 sectors/track, 1011 cylinders Units = cylinders of 2074 * 512 = 1061888 bytes extended primary partition (1-4)

Device Boot /dev/sdb1

Start 1

End 1011

Blocks

Id System

1048376+ 83 Linux

Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.

# mkfs.ext3 /dev/sdb1
[root@netapp ~]# mkfs.ext3 /dev/sdb1 mke2fs 1.39 (29-May-2006) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 131072 inodes, 262094 blocks 13104 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=268435456 8 block groups 32768 blocks per group, 32768 fragments per group 16384 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 25 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.

7. iscsi (server)
# chkconfig --add iscsi # chkconfig --list iscsi