- 最后登录
- 2015-10-8
- 在线时间
- 42 小时
- 威望
- 70
- 金钱
- 476
- 注册时间
- 2012-4-23
- 阅读权限
- 50
- 帖子
- 101
- 精华
- 2
- 积分
- 70
- UID
- 382
|
1#
发表于 2014-6-4 18:28:51
|
查看: 4153 |
回复: 2
本帖最后由 swgsw 于 2014-6-4 18:53 编辑
环境简述:
操作系统:Oracle linux 6.5
预装数据库版本:11.2.0.4
节点数:2
问题描述:
问题一、/dev/sda是一个2T的分区,在他下面划分了10子个分区所识别的scsi_id相同,是否可以利用udev来管理?
问题二、如果无法使用udev管理,还有其他的办法吗,希望大家能提供些思路?
自己认为最终的办法:重新在存储端规划10个disk挂给服务器,这样他们在操作系统上的scsi_id因该就是不同的了,不知大家还有其他方法吗?
环境详述:
一、从存储划分过来一个容量为2T的分区
[root@dqxlrac01 ~]# fdisk -l
Disk /dev/sdb: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000b5d8b
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 256 2048000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2 256 13004 102400000 83 Linux
/dev/sdb3 13004 23202 81920000 83 Linux
/dev/sdb4 23202 36405 106052608 5 Extended
/dev/sdb5 23203 29577 51200000 83 Linux
/dev/sdb6 29577 35951 51200000 82 Linux swap / Solaris
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 2537.3 GB, 2537251930112 bytes
255 heads, 63 sectors/track, 308469 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: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 1 267350 2147483647+ ee GPT
二、2T的这个分区利用parted 分区后
(parted) print
Model: up updisk (scsi)
Disk /dev/sda: 2537GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 250GB 250GB ASMDG1
2 250GB 500GB 250GB ASMDG1
3 500GB 750GB 250GB ASMDG2
4 750GB 1000GB 250GB ASMDG2
5 1000GB 1250GB 250GB ASMDG3
6 1250GB 1500GB 250GB ASMDG3
7 1500GB 1750GB 250GB ASMDG4
8 1750GB 2000GB 250GB ASMDG4
9 2000GB 2250GB 250GB ASMDG5
10 2250GB 2500GB 250GB ASMDG5
三、分区后得到的设备文件
[root@dqxlrac01 ~]# ll /dev/sda*
brw-rw----. 1 root disk 8, 0 Jun 4 18:05 /dev/sda
brw-rw----. 1 root disk 8, 1 May 9 17:52 /dev/sda1
brw-rw----. 1 root disk 8, 10 May 9 17:52 /dev/sda10
brw-rw----. 1 root disk 8, 2 May 9 17:52 /dev/sda2
brw-rw----. 1 root disk 8, 3 May 9 17:52 /dev/sda3
brw-rw----. 1 root disk 8, 4 May 9 17:52 /dev/sda4
brw-rw----. 1 root disk 8, 5 May 9 17:52 /dev/sda5
brw-rw----. 1 root disk 8, 6 May 9 17:52 /dev/sda6
brw-rw----. 1 root disk 8, 7 May 9 17:52 /dev/sda7
brw-rw----. 1 root disk 8, 8 May 9 17:52 /dev/sda8
brw-rw----. 1 root disk 8, 9 May 9 17:52 /dev/sda9
四、运行脚本
for i in a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done
结果如下:
for i in a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 ; do echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" ; done
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska1", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska2", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska3", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska4", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska5", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska6", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska7", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska8", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska9", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3604f9381008f40e3001ead8700000002", NAME="asm-diska10", OWNER="grid", GROUP="asmadmin", MODE="0660"
[root@dqxlrac01 ~]# scsi_id –whitelisted –replace-whitespace –device=/dev/sda1 ---无返回值
[root@dqxlrac01 ~]# scsi_id –whitelisted –replace-whitespace –device=/dev/sda2 ---无返回值
[root@dqxlrac01 ~]# scsi_id –whitelisted –replace-whitespace –device=/dev/sda3 ---无返回值
[root@dqxlrac01 ~]# scsi_id –whitelisted –replace-whitespace –device=/dev/sda4 ---无返回值
[root@dqxlrac01 ~]# blkid
/dev/sdb1: UUID="188e48a4-03c7-495a-8a10-9cfe79e70ffc" TYPE="ext4"
/dev/sdb2: UUID="3d024cad-29c7-4469-91c4-c48e33d6d9f2" TYPE="ext4"
/dev/sdb3: UUID="f9dd5717-8cf3-4e2c-9d95-b3933c4cd27a" TYPE="ext4"
/dev/sdb5: UUID="1a4cfad1-c63b-4d24-8ea7-3a98c57c94a0" TYPE="ext4"
/dev/sdb6: UUID="971e8eb7-e204-45ce-8d5b-4e289f35eff8" TYPE="swap"
[root@dqxlrac01 ~]# blkid /dev/sda1 ---无返回值
[root@dqxlrac01 ~]# dumpe2fs /dev/sda1 |grep 'UUID'
dumpe2fs 1.43-WIP (20-Jun-2013)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sda1
|
|