============================================================
Oracle® Database 10g Release 2 (10.2.0) RAC for RedHat5.4工程实施实录
[ RHEL5.4+Oracle10gR2 RAC+OCFS2 ]
by : 王磊/菜小小~@2011/1/21 10:57 QQ:262477752
最后整理:王磊/菜小小~@2011/1/25 19:05
本文记录了RedHat Linux5.4环境下使用OCFS2配置Oracle10.2RAC的实施实录
============================================================
步骤概要
Red Hat Enterprise Linux Server release 5.4安装
网络规划&配置【/etc/sysconfig/network】【/etc/sysconfig/network-script/ifcfg-eth?】【/etc/hosts】
用户规划&配置【oinstall】【dba】【oracle】【nobody】【password】
系统参数&配置【/etc/sysctl.conf】【/etc/security/limits.conf】【/etc/pam.d/login】【/etc/rc.local】【package】
环境变量&目录【/etc/profile】【~root/bash_profile】【~oracle/bash_profile】【/u01】【/u02】
Oracle服务配置【OracleASM】【OracleOCFS】【service o2cb configure】【service oracleasm configure】
存储规划&配置【fdisk】【ocr】【votingdisk】【ocfs2console】【oracleasm createdisk】【partprobe】【/etc/fstab】【mount 】【chown chmod】
集群件安装【clusterware】【cluvfy/runcluvfy】【vipca】【crs_stat】
数据库建库【asm配置】【dbca】
零、软件准备
Oracle 10gR2 clusterware http://www.oracle.com/technology/software/products/database/index.html
Oracle 10gR2 database http://www.oracle.com/technology/software/products/database/index.html
OCFS2 (Oracle Cluster File System 2)
http://oss.oracle.com/projects/ocfs2/files/
http://oss.oracle.com/projects/ocfs2-tools/files/
一、RedHat5.5安装【略过不表】
二、配置linux网络环境【/etc/sysconfig/network】【/etc/sysconfig/network-script/ifcfg-eth?】【/etc/hosts】
分别在2个节点编辑/etc/sysconfig/network文件
[root@NEWORACLE1 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=NEWORACLE1
[root@NEWORACLE2 ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=NEWORACLE2
分别在2个节点编辑/etc/sysconfig/network-scripts/ifcfg-eth[?]文件
[root@NEWORACLE1 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth?
::::::::::::::
/etc/sysconfig/network-scripts/ifcfg-eth2
::::::::::::::
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth2
BOOTPROTO=none
HWADDR=e4:1f:13:e3:9e:f4
ONBOOT=yes
DHCP_HOSTNAME=NEWORACLE1
TYPE=Ethernet
IPADDR=130.0.100.115
NETMASK=255.255.0.0
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
GATEWAY=130.0.111.111
::::::::::::::
/etc/sysconfig/network-scripts/ifcfg-eth3
::::::::::::::
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth3
BOOTPROTO=none
HWADDR=E4:1F:13:E3:9E:F6
ONBOOT=yes
DHCP_HOSTNAME=NEWORACLE1
TYPE=Ethernet
IPADDR=10.0.0.1
NETMASK=255.255.255.0
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
[root@NEWORACLE2 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth?
::::::::::::::
/etc/sysconfig/network-scripts/ifcfg-eth2
::::::::::::::
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth2
BOOTPROTO=none
HWADDR=e4:1f:13:e3:a7:50
ONBOOT=yes
DHCP_HOSTNAME=NEWORACLE2
TYPE=Ethernet
IPADDR=130.0.100.116
NETMASK=255.255.0.0
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
GATEWAY=130.0.111.111
::::::::::::::
/etc/sysconfig/network-scripts/ifcfg-eth3
::::::::::::::
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth3
BOOTPROTO=none
HWADDR=E4:1F:13:E3:A7:52
ONBOOT=yes
DHCP_HOSTNAME=NEWORACLE2
TYPE=Ethernet
IPADDR=10.0.0.2
NETMASK=255.255.255.0
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
分别在2个节点编辑/etc/hosts文件【两节点内容一致】
[root@NEWORACLE1&2 ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 NEWORACLE2 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6i
130.0.100.110 SAN
130.0.100.120 NAS
130.0.100.115 NEWORACLE1
130.0.100.116 NEWORACLE2
130.0.100.125 NEWORACLE1-vip
130.0.100.126 NEWORACLE2-vip
10.0.0.1 NEWORACLE1-priv
10.0.0.2 NEWORACLE2-priv
三、配置操作系统参数
分别在2个节点安装数据库依赖软件包
[root@NEWORACLE1&2 ~]# rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel libXp
binutils-2.17.50.0.6-14.el5
compat-libstdc++-33-3.2.3-61
elfutils-libelf-0.137-3.el5
elfutils-libelf-devel-0.137-3.el5
elfutils-libelf-devel-static-0.137-3.el5
gcc-4.1.2-48.el5
gcc-c++-4.1.2-48.el5
glibc-2.5-49
glibc-common-2.5-49
glibc-devel-2.5-49
glibc-headers-2.5-49
kernel-headers-2.6.18-194.el5
ksh-20100202-1.el5
libaio-0.3.106-5
libaio-devel-0.3.106-5
libgcc-4.1.2-48.el5
libgomp-4.4.0-6.el5
libstdc++-4.1.2-48.el5
libstdc++-devel-4.1.2-48.el5
make-3.81-3.el5
sysstat-7.0.2-3.el5
unixODBC-2.2.11-7.1
unixODBC-devel-2.2.11-7.1
libXp-1.0.0-8.1.el5
分别在2个节点修改参数&变量
修改内核参数
[root@NEWORACLE1&2 ~]# vi /etc/sysctl.conf
添加
kernel.shmall = 17179869184
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
使更改立即生效
[root@NEWORACLE1&2 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 17179869184
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
设置oracle用户的shell limit
[root@NEWORACLE1&2 ~]# vi /etc/security/limits.conf
添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
接下来更改/etc/pam.d/login文件,添加下面的内容,使shell limit生效:
==32位环境==
[root@NEWORACLE1&2 ~]# vi /etc/pam.d/login
添加
session required /lib/security/pam_limits.so
session required pam_limits.so
==64位环境==
[root@NEWORACLE1&2 ~]# vi /etc/pam.d/login
添加
session required pam_limits.so
配置Hangcheck计时器
[root@NEWORACLE1&2 ~]# vi /etc/rc.local
增加:
modprobe hangcheck-timer hangcheck-tick=30 hangcheck_margin=180
四、配置用户、组、权限【oracle】【dba】【oinstall】
分别在2个节点创建用户与组
[root@NEWORACLE1&2 ~]# groupadd -g 1000 oinstall
[root@NEWORACLE1&2 ~]# groupadd -g 1001 dba
[root@NEWORACLE1&2 ~]# useradd -u 500 -g oinstall -G dba oracle
[root@NEWORACLE1&2 ~]# passwd oracle
Changing password for user oracle.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@NEWORACLE1&2 ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
分别在2个节点配置环境变量
[root@NEWORACLE1&2 ~]# vi /etc/profile
添加
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
PS1='[`date +%H:%M:%S `\u@\h \W]>'
[root@NEWORACLE1&2 ~]# vi /etc/csh.login
添加
if ( $USER == "oracle" ) then
limit maxproc 16384
limit descriptors 65536
endif
[oracle@NEWORACLE1&2 oracle]$ vi ~/.bash_profile
export ORACLE_BASE=/home/oracle
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORA_CRS_HOME/bin:$ORACLE_HOME/bin:.
umask 022
分别在2个节点配置Oracle用户等价性
[oracle@NEWORACLE1 oracle]$ >ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Created directory '/home/oracle/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
f3:c8:dd:14:99:0d:46:da:08:2b:a6:85:dc:8c:15:a4 oracle@node1.wanglei.com
[oracle@NEWORACLE1 oracle~]>cd .ssh
[oracle@NEWORACLE1 oracle .ssh]>cp id_dsa.pub authorized_keys
[oracle@NEWORACLE2 oracle ~]>ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/home/oracle/.ssh/id_dsa):
Created directory '/home/oracle/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/oracle/.ssh/id_dsa.
Your public key has been saved in /home/oracle/.ssh/id_dsa.pub.
The key fingerprint is:
f3:c8:dd:14:99:0d:46:da:08:2b:a6:85:dc:8c:15:a4 oracle@node1.wanglei.com
[oracle@NEWORACLE2 oracle~]>cd .ssh
[oracle@NEWORACLE2 oracle .ssh]>cp id_dsa.pub authorized_keys
然后分别在2个节点viauthorized_keys文件,将对方节点的id_dsa.pub信息添加进去,然后分别在两节点做如下测试:
[oracle@NEWORACLE1 oracle~]>ssh NEWORACLE1
[oracle@NEWORACLE1 oracle~]>ssh NEWORACLE2
[oracle@NEWORACLE1 oracle~]>ssh NEWORACLE1-priv
[oracle@NEWORACLE1 oracle~]>ssh NEWORACLE2-priv
[oracle@NEWORACLE2 oracle~]>ssh NEWORACLE1
[oracle@NEWORACLE2 oracle~]>ssh NEWORACLE2
[oracle@NEWORACLE2 oracle~]>ssh NEWORACLE1-priv
[oracle@NEWORACLE2 oracle~]>ssh NEWORACLE2-priv
五、配置共享磁盘(root权限执行)
|
目的 |
最小大小 (MB) |
标准化大小 (MB) |
磁盘设备 |
挂载点 |
|
Oracle Cluster Registry |
100 |
200 |
/dev/sdb1 |
/u02/ocfs_ocr |
|
Oracle CRS Voting disk |
20 |
50 |
/dev/sdb5 |
/u02/ocfs_vote |
|
Oracle data |
|
|
/dev/sdb7 |
/u02/ocfs_data |
|
Oracle |
|
|
|
|
在节点1分区
[root@NEWORACLE1 ~]# fdisk -l
Disk /dev/sda: 290.9 GB, 290984034304 bytes
255 heads, 63 sectors/track, 35376 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 255 2048256 83 Linux
/dev/sda2 256 4334 32764567+ 82 Linux swap / Solaris
/dev/sda3 4335 8158 30716280 83 Linux
/dev/sda4 8159 35376 218628585 5 Extended
/dev/sda5 8159 32827 198153711 83 Linux
/dev/sda6 32828 35376 20474811 83 Linux
Disk /dev/sdb: 4294 MB, 4294967296 bytes
133 heads, 62 sectors/track, 1017 cylinders
Units = cylinders of 8246 * 512 = 4221952 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 386.5 GB, 386584805376 bytes
255 heads, 63 sectors/track, 46999 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
Disk /dev/sdd: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Disk /dev/sdd doesn't contain a valid partition table
Disk /dev/sde: 644.3 GB, 644326883328 bytes
255 heads, 63 sectors/track, 78334 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sde doesn't contain a valid partition table
Disk /dev/sdf: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Disk /dev/sdf doesn't contain a valid partition table
Disk /dev/sdg: 34.3 GB, 34363932672 bytes
64 heads, 32 sectors/track, 32772 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/sdg doesn't contain a valid partition table
Disk /dev/sdh: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Disk /dev/sdh doesn't contain a valid partition table
Disk /dev/sdi: 4294 MB, 4294967296 bytes
133 heads, 62 sectors/track, 1017 cylinders
Units = cylinders of 8246 * 512 = 4221952 bytes
Disk /dev/sdi doesn't contain a valid partition table
Disk /dev/sdj: 386.5 GB, 386584805376 bytes
255 heads, 63 sectors/track, 46999 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdj doesn't contain a valid partition table
Disk /dev/sdk: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Disk /dev/sdk doesn't contain a valid partition table
Disk /dev/sdl: 644.3 GB, 644326883328 bytes
255 heads, 63 sectors/track, 78334 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdl doesn't contain a valid partition table
Disk /dev/sdm: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Disk /dev/sdm doesn't contain a valid partition table
Disk /dev/sdn: 34.3 GB, 34363932672 bytes
64 heads, 32 sectors/track, 32772 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Disk /dev/sdn doesn't contain a valid partition table
Disk /dev/sdo: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Disk /dev/sdo doesn't contain a valid partition table
Disk /dev/dm-0: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 386.5 GB, 386584805376 bytes
255 heads, 63 sectors/track, 46999 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-1 doesn't contain a valid partition table
Disk /dev/dm-2: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-2 doesn't contain a valid partition table
Disk /dev/dm-3: 644.3 GB, 644326883328 bytes
255 heads, 63 sectors/track, 78334 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-3 doesn't contain a valid partition table
Disk /dev/dm-4: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-4 doesn't contain a valid partition table
Disk /dev/dm-5: 34.3 GB, 34363932672 bytes
255 heads, 63 sectors/track, 4177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-5 doesn't contain a valid partition table
Disk /dev/dm-6: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/dm-6 doesn't contain a valid partition table
[root@NEWORACLE1 ~]# cd /dev/mapper/
[root@NEWORACLE1 mapper]# ls -l
鎬昏? 0
crw------- 1 root root 10, 63 01-20 17:21 control
brw-rw---- 1 root disk 253, 0 01-20 17:21 mpath2
brw-rw---- 1 root disk 253, 1 01-20 17:21 mpath3
brw-rw---- 1 root disk 253, 2 01-20 17:21 mpath4
brw-rw---- 1 root disk 253, 3 01-20 17:21 mpath5
brw-rw---- 1 root disk 253, 4 01-20 17:21 mpath6
brw-rw---- 1 root disk 253, 5 01-20 17:21 mpath7
brw-rw---- 1 root disk 253, 6 01-20 17:21 mpath8
[root@NEWORACLE1 mapper]# multipath -l
mpath2 (360a98000572d2f39564a615a62486b41) dm-0 NETAPP,LUN
[size=4.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
\_ 3:0:0:0 sdb 8:16 [active][undef]
\_ 4:0:0:0 sdi 8:128 [active][undef]
mpath8 (360a98000572d2f39564a615a63324f57) dm-6 NETAPP,LUN
[size=2.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
\_ 3:0:0:6 sdh 8:112 [active][undef]
\_ 4:0:0:6 sdo 8:224 [active][undef]
mpath7 (360a98000572d2f39564a615a62746c4f) dm-5 NETAPP,LUN
[size=32G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
\_ 3:0:0:5 sdg 8:96 [active][undef]
\_ 4:0:0:5 sdn 8:208 [active][undef]
mpath6 (360a98000572d2f39564a615a63372d41) dm-4 NETAPP,LUN
[size=2.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
\_ 3:0:0:4 sdf 8:80 [active][undef]
\_ 4:0:0:4 sdm 8:192 [active][undef]
mpath5 (360a98000572d2f39564a615a62724447) dm-3 NETAPP,LUN
[size=600G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
\_ 3:0:0:3 sde 8:64 [active][undef]
\_ 4:0:0:3 sdl 8:176 [active][undef]
mpath4 (360a98000572d2f39564a615a62775244) dm-2 NETAPP,LUN
[size=2.0G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
\_ 3:0:0:2 sdd 8:48 [active][undef]
\_ 4:0:0:2 sdk 8:160 [active][undef]
mpath3 (360a98000572d2f39564a615a627a7334) dm-1 NETAPP,LUN
[size=360G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=0][active]
\_ 3:0:0:1 sdc 8:32 [active][undef]
\_ 4:0:0:1 sdj 8:144 [active][undef]
[root@NEWORACLE1 mapper]# ls /dev/mapper
control mpath2 mpath3 mpath4 mpath5 mpath6 mpath7 mpath8
[root@NEWORACLE1 mapper]# fdisk /dev/mapper/mpath2
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/mapper/mpath2: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-522, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-522, default 522):
Using default value 522
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22:
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@NEWORACLE1 mapper]# fdisk /dev/mapper/mpath3
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 46999.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-46999, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-46999, default 46999):
Using default value 46999
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: 鏃犳晥鐨勫弬鏁?
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@NEWORACLE1 mapper]# fdisk /dev/mapper/mpath4
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: 鏃犳晥鐨勫弬鏁?
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@NEWORACLE1 mapper]# fdisk /dev/mapper/mpath5
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 78334.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-78334, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-78334, default 78334):
Using default value 78334
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: 鏃犳晥鐨勫弬鏁?
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@NEWORACLE1 mapper]# fdisk /dev/mapper/mpath6
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: 鏃犳晥鐨勫弬鏁?
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@NEWORACLE1 mapper]# fdisk /dev/mapper/mpath7
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
The number of cylinders for this disk is set to 4177.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-4177, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-4177, default 4177):
Using default value 4177
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: 鏃犳晥鐨勫弬鏁?
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@NEWORACLE1 mapper]# fdisk /dev/mapper/mpath8
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: 鏃犳晥鐨勫弬鏁?
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@NEWORACLE1 mapper]# fdisk -l
Disk /dev/sda: 290.9 GB, 290984034304 bytes
255 heads, 63 sectors/track, 35376 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 255 2048256 83 Linux
/dev/sda2 256 4334 32764567+ 82 Linux swap / Solaris
/dev/sda3 4335 8158 30716280 83 Linux
/dev/sda4 8159 35376 218628585 5 Extended
/dev/sda5 8159 32827 198153711 83 Linux
/dev/sda6 32828 35376 20474811 83 Linux
Disk /dev/sdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 522 4192933+ 83 Linux
Disk /dev/sdc: 386.5 GB, 386584805376 bytes
255 heads, 63 sectors/track, 46999 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 46999 377519436 83 Linux
Disk /dev/sdd: 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/sdd1 1 261 2096451 83 Linux
Disk /dev/sde: 644.3 GB, 644326883328 bytes
255 heads, 63 sectors/track, 78334 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 78334 629217823+ 83 Linux
Disk /dev/sdf: 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/sdf1 1 261 2096451 83 Linux
Disk /dev/sdg: 34.3 GB, 34363932672 bytes
255 heads, 63 sectors/track, 4177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdg1 1 4177 33551721 83 Linux
Disk /dev/sdh: 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/sdh1 1 261 2096451 83 Linux
Disk /dev/sdi: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdi1 1 522 4192933+ 83 Linux
Disk /dev/sdj: 386.5 GB, 386584805376 bytes
255 heads, 63 sectors/track, 46999 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdj1 1 46999 377519436 83 Linux
Disk /dev/sdk: 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/sdk1 1 261 2096451 83 Linux
Disk /dev/sdl: 644.3 GB, 644326883328 bytes
255 heads, 63 sectors/track, 78334 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdl1 1 78334 629217823+ 83 Linux
Disk /dev/sdm: 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/sdm1 1 261 2096451 83 Linux
Disk /dev/sdn: 34.3 GB, 34363932672 bytes
255 heads, 63 sectors/track, 4177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdn1 1 4177 33551721 83 Linux
Disk /dev/sdo: 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/sdo1 1 261 2096451 83 Linux
Disk /dev/dm-0: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/dm-0p1 1 522 4192933+ 83 Linux
Disk /dev/dm-1: 386.5 GB, 386584805376 bytes
255 heads, 63 sectors/track, 46999 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/dm-1p1 1 46999 377519436 83 Linux
Disk /dev/dm-2: 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/dm-2p1 1 261 2096451 83 Linux
Disk /dev/dm-3: 644.3 GB, 644326883328 bytes
255 heads, 63 sectors/track, 78334 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/dm-3p1 1 78334 629217823+ 83 Linux
Disk /dev/dm-4: 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/dm-4p1 1 261 2096451 83 Linux
Disk /dev/dm-5: 34.3 GB, 34363932672 bytes
255 heads, 63 sectors/track, 4177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/dm-5p1 1 4177 33551721 83 Linux
Disk /dev/dm-6: 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/dm-6p1 1 261 2096451 83 Linux
在节点2扫描变动
[root@NEWORACLE2 mapper]# partprobe
[root@NEWORACLE2 mapper]# fdisk -l
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24447726/viewspace-1807084/ ,如需转载,请注明出处,否则将追究法律责任。