linux iscsi
DESCRIPTION
TestTRANSCRIPT
![Page 1: Linux Iscsi](https://reader035.vdocuments.site/reader035/viewer/2022081908/552cc05c550346910f8b4877/html5/thumbnails/1.jpg)
Lun(iSCSI) setup with Linux example
1. Test 환경OS Lun size software License IP
Server Centos 5.4 - iSCSI initiator - 220.117.55.226Storage DataOntap
7.3.21g - iSCSI 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 showcontroller: lun-pathname device filename adapter protocol lun size lun state F270: /vol/iscsi/linux/lun.0 /dev/sdb host2 iSCSI 1g (1073741824) GOOD
# fdisk /dev/sdb[root@netapp santools]# fdisk /dev/sdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent won't be recoverable.
![Page 2: Linux Iscsi](https://reader035.vdocuments.site/reader035/viewer/2022081908/552cc05c550346910f8b4877/html5/thumbnails/2.jpg)
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 bytes34 heads, 61 sectors/track, 1011 cylindersUnits = cylinders of 2074 * 512 = 1061888 bytes
Device Boot Start End Blocks Id System
Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1 First cylinder (1-1011, default 1): Using default value 1Last 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 bytes34 heads, 61 sectors/track, 1011 cylindersUnits = cylinders of 2074 * 512 = 1061888 bytes
Device Boot Start End Blocks Id System/dev/sdb1 1 1011 1048376+ 83 Linux
Command (m for help): wThe partition table has been altered!
Calling ioctl() to re-read partition table.Syncing disks.
# mkfs.ext3 /dev/sdb1[root@netapp ~]# mkfs.ext3 /dev/sdb1mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)131072 inodes, 262094 blocks13104 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=2684354568 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376
Writing inode tables: done Creating journal (4096 blocks): doneWriting superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 25 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.
7. 부팅시 iscsi 서비스 시작(server)# chkconfig --add iscsi# chkconfig --list iscsi