- 论坛徽章:
- 0
|
现在我手头上有这几台设备:ibm ds4300磁盘阵列存储(配有4块scsi硬盘,每块300g),ibm x3650服务器(每台配两块73g scsi硬盘,做raid1):test1、test2,安装redhat-as4.0-u4操作系统,用光纤将两台服务器同存储相连接
用ds4300的管理软件将存储设置为raid5,显示可使用容量为830g
连接好之后将两台服务器重启,检测存储空间。
奇怪的是:如果单机启动,不连接存储,我fdisk -l显示本机的磁盘设备均为/dev/sda
连接存储之后,test1服务器检查本机磁盘为/dev/sda,存储设备为/dev/sdb,而test2检查出的存储设备依然为/dev/sda,把本机的两块scsi磁盘认为/dev/sdb,
状态如下:
test1:
[root@test1 home]# fdisk -l
Disk /dev/sda: 73.2 GB, 73283928064 bytes
255 heads, 63 sectors/track, 8909 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 65 522081 83 Linux
/dev/sda2 66 6439 51199155 83 Linux
/dev/sda3 6440 6566 1020127+ 82 Linux swap
Disk /dev/sdb: 898.3 GB, 898387972608 bytes
255 heads, 63 sectors/track, 109222 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1400 11245468+ 83 Linux
/dev/sdb2 1401 2800 11245500 83 Linux
[root@test1 home]#
test2:
[root@test2 ~]# fdisk -l
Disk /dev/sda: 898.3 GB, 898387972608 bytes
255 heads, 63 sectors/track, 109222 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 1400 11245468+ 83 Linux
/dev/sda2 1401 2800 11245500 83 Linux
Disk /dev/sdb: 73.2 GB, 73283928064 bytes
255 heads, 63 sectors/track, 8909 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 65 522081 83 Linux
/dev/sdb2 66 6439 51199155 83 Linux
/dev/sdb3 6440 6694 2048287+ 82 Linux swap
这之后,我把test1,光纤拔掉,只让test2连接存储设备,重启后依然是这样
请问一下这种情况是正常的么?
问题2:
按照我的理解,存储是共享磁盘空间,对于存储中一个共享的分区(例如:在我这环境中对于test1为/dev/sdb1,对于test2为/dev/sda1),在其中一个节点上向里面写数据,对于另外一个节点上查看应该是可见的,于是我按下列步骤做了如下操作:
在test1上:
[root@test1 ~]#
[root@test1 ~]# mkfs -t ext3 /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
100576 inodes, 200804 blocks
10040 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=209715200
7 block groups
32768 blocks per group, 32768 fragments per group
14368 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@test1 ~]# mount /dev/sdb1 /home/test
[root@test1 ~]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 49G 7.9G 38G 18% /
/dev/sda1 494M 26M 444M 6% /boot
none 2.0G 0 2.0G 0% /dev/shm
/dev/sdb1 773M 17M 716M 3% /home/test
[root@test1 ~]# cd /home/test
[root@test1 test]# ls
lost+found
[root@test1 test]# vi 1.txt
[root@test1 test]# ls
1.txt lost+found
[root@test1 test]# ls -l
total 20
-rw-r--r-- 1 root root 24 Apr 22 10:39 1.txt
drwx------ 2 root root 16384 Apr 22 10:37 lost+found
[root@test1 test]#
在test2上:
[root@test2 home]# mount /dev/sda1 /home/test
[root@test2 home]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/sdb2 49G 7.4G 39G 17% /
/dev/sdb1 494M 29M 441M 7% /boot
none 2.0G 0 2.0G 0% /dev/shm
/dev/sda1 773M 17M 716M 3% /home/test
[root@test2 home]# cd /home/test
[root@test2 test]# ls
1.txt lost+found
[root@test2 test]# vi 2.txt
[root@test2 test]#
[root@test2 test]# ls -l
total 24
-rw-r--r-- 1 root root 24 Apr 22 10:39 1.txt
-rw-r--r-- 1 root root 1118 Apr 22 10:39 2.txt
drwx------ 2 root root 16384 Apr 22 10:37 lost+found
[root@test2 test]# cd ..
[root@test2 home]# du test
16 test/lost+found
28 test
[root@test2 home]# cd /test
bash: cd: /test: No such file or directory
[root@test2 home]# cd test
[root@test2 test]# ls
1.txt 2.txt lost+found
[root@test2 test]# cat 1.txt
dadf dfasdfasdfadfasd
[root@test2 test]# cat 2.txt
回到test1上:
[root@test1 test]# ls
1.txt lost+found
[root@test1 test]# du *
4 1.txt
16 lost+found
[root@test1 test]# cd ..
[root@test1 home]# umount /dev/sdb1 /home/test
umount: /dev/sdb1: not mounted
umount: /dev/sdb1: not mounted
[root@test1 home]# mount /dev/sdb1 /home/test
[root@test1 home]# cd test
[root@test1 test]# ls
1.txt 2.txt lost+found
[root@test1 test]# ls -l
total 20
-rw-r--r-- 1 root root 24 Apr 22 10:39 1.txt
?--------- ? ? ? ? ? 2.txt
drwx------ 2 root root 16384 Apr 22 10:37 lost+found
[root@test1 test]# cat 2.txt
cat: 2.txt: Input/output error
[root@test1 test]# vi 3
[root@test1 test]#
[root@test1 test]#
[root@test1 test]# ls
1.txt 2.txt 3 lost+found
在转入test2:
[root@test2 test]# ls
1.txt 2.txt lost+found
[root@test2 test]# cd ..
[root@test2 home]# umount /dev/sda1 /home/test
umount: /dev/sda1: not mounted
umount: /dev/sda1: not mounted
[root@test2 home]# cd test
[root@test2 test]# ls
[root@test2 test]# cd ..
[root@test2 home]# mount /dev/sda1 /home/test
[root@test2 home]# cd test/
[root@test2 test]# ls
1.txt 2.txt 3 lost+found
[root@test2 test]# cat 3
ddfasdfasdfasdfasdfasdfasdfasdfasdf
这个测试也就是说对于存储磁盘上的共享的存储空间,如果其中一个节点写入数据,另外一个节点需要从新挂载这个共享空间才能访问到新的数据,而且我刚做的这个实验对于.txt文件是报i/o错误的。
请帮忙分析一下原因。
[ 本帖最后由 lizisor 于 2008-4-22 11:10 编辑 ] |
|