搭建一个测试环境,能够进行ASM的管理学习:
Normal
0
7.8 磅
0
2
false
false
false
EN-US
ZH-CN
X-NONE硬件配置
IBM Xseries 346
Xen 3.6G,4G内存,70G硬盘+36G+36G硬盘2
软件配置
RHEL 5.3,Oracle10g
for Linux 64bit
环境说明
本环境使用IBM服务器上安装RHEL 5.3的64位系统,硬盘两块,分别为76G和36G。其中76G空间为操作系统和,36G为第二块硬盘分区作为ASM盘。
规划方案:计划将第二块硬盘分为三个分区,各个分区大小相等。每个分区作为一个ASM盘,名称分别为VOL1、VOL2和VOL3。
安装操作系统和oracle
10g软件不用说了,网上大把。
系统分区:
[root@Enmo ~]# df -h
FilesystemSizeUsed Avail Use% Mounted on
/dev/sda363G9.8G50G17% /
/dev/sda199M25M70M26% /boot
tmpfs2.0G02.0G0% /dev/shm
磁盘分区情况为:
[root@Enmo ~]# fdisk -l
Disk /dev/sda: 73.4 GB, 73407488000 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280
bytes
Device
BootStartEndBlocksIdSystem
/dev/sda1*11310439183Linux
/dev/sda214535419296582Linux swap / Solaris
/dev/sda3536892467384642+83Linux
Disk /dev/sdb: 36.4 GB, 36401479680 bytes
64 heads, 32 sectors/track, 34715 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device
BootStartEndBlocksIdSystem
进行ASM盘分区
根据规划方案,对sdb盘进行分区格式化操作。在linux上,可以使用fdisk命令,在交互的方式下进行磁盘分区:
[root@Enmo ~]# fdisk /dev/sdb--命令方式:fdisk
The number of cylinders for this disk is set to
34715.
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)
Command (m for help): m–查看以下命令方式
Command action
atoggle a bootable flag
bedit bsd disklabel
ctoggle the dos compatibility flag
ddelete a partition
llist known partition types
mprint this menu
nadd a new partition
ocreate a new empty DOS partition table
pprint the partition table
qquit without saving changes
screate a new empty Sun disklabel
tchange a partition's system id
uchange display/entry units
vverify the partition table
wwrite table to disk and exit
xextra functionality (experts only)
Command (m for help): n–新建立一个分区
Command action–要求输入新建主分区还是扩展分区,注意:一块硬盘上只能有四个主分区
eextended
pprimary partition (1-4)
p
Partition number (1-4): 1//输入主分区编号
First cylinder (1-34715, default 1): 1//分区起始柱面,该硬盘可用的范围是1-34715;
Last cylinder or +size or +sizeM or +sizeK
(1-34715, default 34715): 11571//分区截止柱面
Command (m for help): m
Command action
。。。。。。
Command (m for help): n
Command action
eextended
pprimary partition (1-4)
p
Partition number (1-4): 2//输入第二个分区
First cylinder (11572-34715, default 11572):
11572
Last cylinder or +size or +sizeM or +sizeK
(11572-34715, default 34715): 23142
Command (m for help): m
Command action
。。。。。。
Command (m for help): n
Command action
eextended
pprimary partition (1-4)
p
Partition number (1-4): 3//输入第三个分区
First cylinder (23143-34715, default 23143):
Using default value 23143
Last cylinder or +size or +sizeM or +sizeK
(23143-34715, default 34715):
Using default value 34715
--注意:此时分区信息还没有正式写入,要求输入w命令后才能写入!
Command (m for help):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
查看分区结果:
[root@Enmo ~]# fdisk -l
Disk /dev/sda: 73.4 GB, 73407488000 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280
bytes
Device
BootStartEndBlocksIdSystem
/dev/sda1*11310439183Linux
/dev/sda214535419296582Linux swap / Solaris
/dev/sda3536892467384642+83Linux
Disk /dev/sdb: 36.4 GB, 36401479680 bytes
64 heads, 32 sectors/track, 34715 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device
BootStartEndBlocksIdSystem
/dev/sdb11115711184868883Linux
/dev/sdb211572231421184870483Linux
/dev/sdb323143347151185075283Linux
分区建立之后,还要用特定的文件系统格式进行分区格式化。
[root@Enmo ~]# mkfs.ext3/dev/sdb1
-bash: mkfs.ext3/dev/sdb1: No such file or
directory
[root@Enmo ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
1482208 inodes, 2962172 blocks
148108 blocks (5.00%) reserved for the super
user
First data block=0
Maximum filesystem blocks=3036676096
91 block groups
32768 blocks per group, 32768 fragments per
group
16288 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting
information: done
This filesystem will be automatically checked
every 31 mounts or
180 days, whichever comes first.Use tune2fs -c or -i to override.
剩下两个分区 /dev/sdb2和/dev/sdb3类似。
准备好分区磁盘之后,就可以进行ASM驱动安装和ASM disk配置构建了。