http://blog.chinaunix.net/u2/89813/showart_2063370.html
一 安装Open Filer
1.下载openfiler
http://nchc.dl.sourceforge.net/sourceforge/openfiler/openfiler-2.3-x86-disc1.iso
共 314M
2.VMware创建Linux服务器
3.用openfiler.iso文件引导
第一个屏幕是 Openfiler 引导屏幕。在 boot: 提示符处按 [Enter] 键启动安装过程。
4.介质检测
反正闲着,检测就检测吧
5.检测完成
6.按Continue继续以下安装
7.进入GUI安装模式
在几秒钟后,安装程序将会检测视频卡、显示器和鼠标。然后安装程序进入 GUI 模式
8.键盘设置
下一个屏幕将提示进行键盘设置
9.磁盘分区设置
在此选择手动分区
询问是否否真的要删除所有分区。单击 [Yes] 回复这一警告
10.分区情况
/boot 100M ,swap 1200M ,其余空间分配给/根目录
11.网络配置
首先,确保将每个网络设备设置为 [Active on boot];并设定IP地址和子网,主机名等
12.时区选择
13.设置根口令
输入一个根口令,然后单击 [Next] 继续。
14.关于安装
本屏幕主要是一个确认屏幕。单击 [Next] 开始安装。
15.安装过程
16.安装完成
单击 [Reboot] 重新引导系统
17.重新引导完成
引导完成后,进入OPENFILER界面
二 配置Openfiler
要将 Openfiler 用作 iSCSI 存储服务器,需要执行三个主要任务:设置 iSCSI 服务、配置网络访问以及创建物理存储。
1.登录Openfiler Storage Control Center
IE输入Openfiler服务器的URL:
https://IP:446/
从 Openfiler Storage Control Center 主页,以管理员身份登录。Openfiler 的默认管理员登录凭证为:
用户名openfiler
口令password
2.启用ISCSI服务
要控制服务,导航到 [Services] / [Enable/Disable]
要启用 iSCSI 服务,单击“iSCSI target”服务名称下面的“Enable”。之后,“iSCSI target”状态应更改为“Enabled”。
3.创建物理存储
导航到 [volumes]
对物理磁盘进行分区
导航到 [volume group management],创建卷组
创建逻辑卷
导航到 [Volumes] / [Create New Volume]
4.Lun mapping
导航到[target configuration],按ADD添加target IQN
导航至[Lun mapping],点击MAP
导航至[System],设置需要MAP主机的IP地址和网络、主机名,type为share
三 Windows连接Openfiler
1.安装windows initiator
在WINDOWS上安装initiator程序
2.配置iscsi initiator属性
在target portals中,点击add添加iscsi target.输入openfiler的IP地址及socket 3260
点击Advancetd,选择如下
Connect by using:Microsoft iscsi initiator
Local adapter:本主机IP地址
3.Logon iscsi target
单击logon,点击当系统启动时自动连接iscsi target
Target 状态为connected
4.主机识别存储
打开“磁盘管理器”,即弹出磁盘初始化的窗口,点击下一步
初始化完成后,即可在磁盘0下面出现一个磁盘1,格式化后就可以对该磁盘进行读写操作了
四 Linux连接Openfiler
1.安装iscsi initiator
#rpm –ivh iscsi.initiator.rpm
2.编辑iscsi配置文件
编辑/etc/iscsi.conf加入以下行
DiscoveryAddress=172.16.11.250
Continuous=yes
SendAsyncText=yes
其中172.16.11.250是OPENFILER的IP地址
3.启动iscsi服务
[root@mylinux etc]# chkconfig iscsi on
[root@mylinux etc]# chkconfig --list |grep scsi
iscsi 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@mylinux etc]# service iscsi restart
Searching for iscsi-based multipath maps
Found 0 maps
Stopping iscsid: iscsid not running
Checking iscsi config: [ OK ]
Loading iscsi driver: [ OK ]
mknod: `/dev/iscsictl': File exists
Starting iscsid: [ OK ]
[root@mylinux etc]# iscsi-ls
*******************************************************************************
SFNet iSCSI Driver Version ...4: 0.1.11 -4(15-Jan-2007)
*******************************************************************************
TARGET NAME : iqn.2006-01.com.openfiler:ricky.vote
TARGET ALIAS :
HOST ID : 1
BUS ID : 0
TARGET ID : 0
TARGET ADDRESS : 172.16.11.250:3260,1
SESSION STATUS : ESTABLISHED AT Thu Oct 1 00:00:07 CST 2009
SESSION ID : ISID 00023d000001 TSIH 100
*******************************************************************************
[root@mylinux etc]# iscsi-rescan
Rescanning host1
4.识别openfiler存储
[root@mylinux openfiler]# iscsi-iname
iqn.1987-05.com.cisco:01.a1577bbb48ad
[root@mylinux etc]# fdisk -l
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 89 610470 82 Linux swap
/dev/sda3 90 1044 7671037+ 83 Linux
Disk /dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 261 2096451 5 Extended
/dev/sdb5 1 74 594342 83 Linux
/dev/sdb6 75 136 497983+ 83 Linux
/dev/sdb7 137 173 297171 83 Linux
/dev/sdb8 174 186 104391 83 Linux
/dev/sdb9 187 199 104391 83 Linux
/dev/sdb10 200 206 56196 83 Linux
/dev/sdb11 207 213 56196 83 Linux
/dev/sdb12 214 220 56196 83 Linux
/dev/sdb13 221 223 24066 83 Linux
Disk /dev/sdc: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 261 2096451 5 Extended
/dev/sdc5 1 7 56164+ 83 Linux
/dev/sdc6 8 20 104391 83 Linux
/dev/sdc7 21 27 56196 83 Linux
/dev/sdc8 28 30 24066 83 Linux
/dev/sdc9 31 33 24066 83 Linux
Disk /dev/sdd: 100 MB, 100663296 bytes
4 heads, 48 sectors/track, 1024 cylinders
Units = cylinders of 192 * 512 = 98304 bytes
Disk /dev/sdd doesn't contain a valid partition table
[root@mylinux etc]#
[root@mylinux etc]# iscsi-device /dev/sdd
/dev/sdd is an iSCSI device
[root@mylinux etc]#
5.分区并创建文件系统
[root@mylinux etc]# fdisk /dev/sdd
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1024, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1024, default 1024):
Using default value 1024
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@mylinux etc]# fdisk -l /dev/sdd
Disk /dev/sdd: 100 MB, 100663296 bytes
4 heads, 48 sectors/track, 1024 cylinders
Units = cylinders of 192 * 512 = 98304 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 1024 98280 83 Linux
[root@mylinux etc]# mkfs -t ext3 /dev/sdd1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
24576 inodes, 98280 blocks
4914 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
12 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@mylinux etc]#
6.读写测试
[root@mylinux etc]# mount /dev/sdd1 /openfiler
[root@mylinux etc]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 7.3G 3.5G 3.5G 51% /
/dev/sda1 99M 8.6M 86M 10% /boot
none 157M 0 157M 0% /dev/shm
/dev/sdd1 93M 5.6M 83M 7% /openfiler
[root@mylinux etc]#
[root@mylinux /]# tar -cvf /openfiler/var.tar /var
/var/www/manual/mod/module-dict.html.ko.euc-kr
/var/www/manual/mod/index.html.de
/var/www/manual/mod/mpm_winnt.html.es
/var/www/manual/mod/mod_info.html.ja.euc-jp
/var/www/manual/mod/mod_dav.html
/var/www/manual/mod/mpm_winnt.html.en
/var/www/manual/mod/mod_imap.html
/var/www/manual/mod/mod_status.html.ja.euc-j
[root@mylinux openfiler]# ls
lost+found var.tar
[root@mylinux openfiler]#
[root@mylinux openfiler]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 7.3G 3.5G 3.5G 51% /
/dev/sda1 99M 8.6M 86M 10% /boot
none 157M 0 157M 0% /dev/shm
/dev/sdd1 93M 75M 14M 85% /openfiler
[root@mylinux openfiler]#