openfiler 2.99 install 
ISCSI && NFS
 
 
setup os
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
reboot
 
 
 
 
 
 
default user/password:   openfiler/password
 
 
 
 
configuration:
 
iscsi target:
enable &running iscsi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modify cylinder
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
win7 connect openfiler iscsi
 
 
 
 
 
 
centos 6.3 connect operfiler iscsi
 
[root@msyql1 Packages]# yum install iscsi*
 
[root@msyql1 pam.d]# service iscsid force-start
Starting iscsid:                                           [ OK ]
[root@msyql1 pam.d]# service iscsid status
iscsid (pid 3025) is running...
[root@msyql1 pam.d]#
 
 
 
 
[root@msyql1 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.160.135
192.168.160.135:3260,1 iqn.2006-01.com.openfiler:tsn.6270c809f234
192.168.160.135:3260,1 iqn.2006-01.com.openfiler:tsn.104be2976b3d
[root@msyql1 ~]#
 
[root@msyql1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.6270c809f234 -p 192.168.160.135 -l
 
or mysql2 connet:
 
[root@mysql2 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.6270c809f234 -p 192.168.160.135 -l
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6270c809f234, portal: 192.168.160.135,3260] (multiple)
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.6270c809f234, portal: 192.168.160.135,3260] successful.
 
 
 
se-up automount
 
[root@msyql1 ~]# cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
 
touch /var/lock/subsys/local
[root@msyql1 ~]# vim /etc/rc.d/rc.local
[root@msyql1 ~]# cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
 
touch /var/lock/subsys/local
iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.6270c809f234 -p 192.168.160.135 -l
 
[root@msyql1 ~]#
 
 
 
 
[root@msyql1 ~]# fdisk -l
 
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000820e3
 
   Device Boot      Start         End      Blocks   Id System
/dev/sda1   *           1        1148     9216000   83 Linux
/dev/sda2            1148        1275     1024000   82 Linux swap / Solaris
 
Disk /dev/sdb: 2785 MB, 2785017856 bytes
86 heads, 62 sectors/track, 1020 cylinders
Units = cylinders of 5332 * 512 = 2729984 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
 
[root@msyql1 ~]#
 
 
[root@msyql1 ~]# fdisk /dev/sdb
 
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1020, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1020, default 1020): 1020
 
Command (m for help): w
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
Syncing disks.
[root@msyql1 ~]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
[root@msyql1 ~]# mkfs.ext
mkfs.ext2     mkfs.ext3     mkfs.ext4     mkfs.ext4dev
[root@msyql1 ~]# fdisk -l
 
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000820e3
 
   Device Boot      Start         End      Blocks   Id System
/dev/sda1   *           1        1148     9216000   83 Linux
/dev/sda2            1148        1275     1024000   82 Linux swap / Solaris
 
Disk /dev/sdb: 2785 MB, 2785017856 bytes
86 heads, 62 sectors/track, 1020 cylinders
Units = cylinders of 5332 * 512 = 2729984 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb7f0d02e
 
   Device Boot      Start         End      Blocks   Id System
/dev/sdb1               1        1020     2719289   83 Linux
[root@msyql1 ~]# mkfs.ext4
mkfs.ext4     mkfs.ext4dev
[root@msyql1 ~]# mkfs.ext4 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
170016 inodes, 679822 blocks
33991 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=696254464
21 block groups
32768 blocks per group, 32768 fragments per group
8096 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912
 
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
 
This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@msyql1 ~]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
[root@msyql1 ~]# fdisk -l
 
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000820e3
 
   Device Boot      Start         End      Blocks   Id System
/dev/sda1   *           1        1148     9216000   83 Linux
/dev/sda2            1148        1275     1024000   82 Linux swap / Solaris
 
Disk /dev/sdb: 2785 MB, 2785017856 bytes
86 heads, 62 sectors/track, 1020 cylinders
Units = cylinders of 5332 * 512 = 2729984 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb7f0d02e
 
   Device Boot      Start         End      Blocks   Id System
/dev/sdb1               1        1020     2719289   83 Linux
 
[root@msyql1 ~]# mkdir /lab1
[root@msyql1 ~]# mount /dev/sdb1 /lab1/
[root@msyql1 ~]# ls /lab1/
lost+found
[root@msyql1 ~]#
 
 
 
 
 
 
 
 
 
 
 
 
configure NFS:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
linux mount NFS:
 
[root@msyql1 ~]# mount -t nfs 192.168.160.135:/mnt/nfs/test/test /media/
[root@msyql1 ~]# ls /media/
111 1112
[root@msyql1 ~]# mount
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sdb1 on /lab1 type ext4 (rw)
192.168.160.135:/mnt/nfs/test/test on /media type nfs (rw,addr=192.168.160.135)
[root@msyql1 ~]#
 
 
 
 
 
 
 
summary:
 
一 craete iscsi in openfiler:
   1,create partition (block drivers)
   2,create volume groups
   3,add volume
   4,iscsi targets
二 create nfs in openfiler:
   1,create partition (block drivers)
   2,create volume groups
   3,add volume
   4,share && privilege
 
 
 
change openfiler password:
 
[root@localhost ~]# passwd openfiler
Changing password for user openfiler.
New UNIX password:
BAD PASSWORD: it does not contain enough DIFFERENT characters
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@localhost ~]#
 
 
 
craete partitions only extended,it has error:
inode_size (128) * inodes_count (0) too big for a   filesystem with 0 blocks, specify higher inode_ratio (-i)   or lower inode count (-N).