- [root@qionghai11g Packages]# rpm -Uvh iscsi-initiator-utils-6.2.0.873-2.el6.x86_64.rpm
2、啟動iscsi服務并設置開機自啟動
復制內容到剪貼板
- [root@qionghai11g Packages]# service iscsi start
-
- [root@qionghai11g Packages]# chkconfig --list | grep iscsi
3、查找存儲對外提供的邏輯卷
復制內容到剪貼板
-
- [root@qionghai11g ~]# iscsiadm -m discovery -t sendtargets -p 192.16.10.188:3260
-
- Starting iscsid: [ OK ]
-
- 192.16.10.188:3260,1 iqn.2004-01.com.storbridge:block02-wt
-
- 192.16.10.188:3260,1 iqn.2004-01.com.storbridge:block01-wt
-
4、映射邏輯卷到Linux系統(tǒng)中
復制內容到剪貼板
- [root@qionghai11g ~]# iscsiadm -m node -T iqn.2004-01.com.storbridge:block01-wt -p 192.16.10.188:3260 -l
-
- Logging in to [iface: default, target: iqn.2004-01.com.storbridge:block01-wt, portal: 192.16.10.188,3260] (multiple)
-
- Login to [iface: default, target: iqn.2004-01.com.storbridge:block01-wt, portal: 192.16.10.188,3260] successful.
-
- [root@qionghai11g ~]# iscsiadm -m node -T iqn.2004-01.com.storbridge:block02-wt -p 192.16.10.188:3260 -l
-
- Logging in to [iface: default, target: iqn.2004-01.com.storbridge:block02-wt, portal: 192.16.10.188,3260] (multiple)
-
- Login to [iface: default, target: iqn.2004-01.com.storbridge:block02-wt, portal: 192.16.10.188,3260] successful.
-
5、設置開機自動映射
復制內容到剪貼板
- [root@qionghai11g ~]# iscsiadm -m node -T iqn.2004-01.com.storbridge:block02-wt -p 192.16.10.188:3260 --op update -n node.startup -v automatic
-
- [root@qionghai11g ~]# iscsiadm -m node -T iqn.2004-01.com.storbridge:block01-wt -p 192.16.10.188:3260 --op update -n node.startup -v automatic
-
這兩個是開機自動映射
6、對映射出來的磁盤進行分區(qū)
由于存儲容量是12T 大于2T,不能用不同分區(qū) fdisk ,只能用GPT分區(qū)
parted /dev/sdb 對/dev/sdb進行分區(qū)
print 打印信息,從中可以看出這個磁盤大小和分區(qū)格式
mklabel gpt
mkpart primary 0% 100%
print 從中可以看出這個磁盤分區(qū)格式已經(jīng)變了成GPT了
7、分區(qū)之后進行格式化
復制內容到剪貼板
- [root@oracle11g ~]# mkfs.ext3 /dev/sdb
-
- mke2fs 1.39 (29-May-2006)
-
- /dev/sdb is entire device, not just one partition!
-
- Proceed anyway? (y,n) y
-
- Filesystem label=
-
- OS type: Linux
-
- Block size=4096 (log=2)
-
- Fragment size=4096 (log=2)
-
- 1708998656 inodes, 3417968064 blocks
-
- 170898403 blocks (5.00%) reserved for the super user
-
- First data block=0
-
- Maximum filesystem blocks=4294967296
-
- 104309 block groups
-
- 32768 blocks per group, 32768 fragments per group
-
- 16384 inodes per group
-
- Superblock backups stored on blocks:
-
- 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
-
- 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
-
- 102400000, 214990848, 512000000, 550731776, 644972544, 1934917632,
-
- 2560000000
-
-
-
- Writing inode tables: done
-
- Creating journal (32768 blocks): done
-
- Writing superblocks and filesystem accounting information: done
-
- done
-
- This filesystem will be automatically checked every 23 mounts or
-
- 180 days, whichever comes first. Use tune2fs -c or -i to override.
-
8、掛載分區(qū)
復制內容到剪貼板
- [root@qionghai11g ~]# cd /var/www/html/
-
- [root@qionghai11g html]# mkdir kk1 kk2
-
- [root@qionghai11g mnt]# mount /dev/sdb1 /var/www/html/kk1/