- [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系统中
复制内容到剪贴板
- [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、对映射出来的磁盘进行分区
由于存储容量是12T 大于2T,不能用不同分区 fdisk ,只能用GPT分区
parted /dev/sdb 对/dev/sdb进行分区
print 打印信息,从中可以看出这个磁盘大小和分区格式
mklabel gpt
mkpart primary 0% 100%
print 从中可以看出这个磁盘分区格式已经变了成GPT了
7、分区之后进行格式化
复制内容到剪贴板
- [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、挂载分区
复制内容到剪贴板
- [root@qionghai11g ~]# cd /var/www/html/
-
- [root@qionghai11g html]# mkdir kk1 kk2
-
- [root@qionghai11g mnt]# mount /dev/sdb1 /var/www/html/kk1/