Tivemos um problema recente no red hat 4 ES, mas que foi resolvido com o script

Documentacao
– Sobre o ASM – Download
http://www.oracle.com/technology/tech/linux/asmlib/index.html
– Instalacao
http://www.oracle.com/technology/tech/linux/asmlib/install.html

Com o script abaixo conseguimos prosseguir com a instalacao do ASM, lembrando que esta somente criando arquivos fisicos com o proposito de laboratorio do curso WS2.

# http://oss.oracle.com/projects/oracleasm/dist/documentation/asm-install.txt# /etc/init.d/oracleasm configure
# Copie o script para /home/oracle/script.sh
# Para rodar o script: sh /home/oracle/script.sh

service rawdevices stop

rm -rf /dev/raw

cd /dev

MAKEDEV raw

rm -rf /u01/asmdisks/*
cd /u01/asmdisks

dd if=/dev/zero of=dd if=/dev/zero of=asm_disk2 bs=1024k count=400
dd if=/dev/zero of=asm_disk3 bs=1024k count=400
dd if=/dev/zero of=asm_disk4 bs=1024k count=400
dd if=/dev/zero of=asm_disk5 bs=1024k count=400

chmod 777 asm_disk*

losetup -d /dev/loop1
losetup -d /dev/loop2
losetup -d /dev/loop3
losetup -d /dev/loop4
losetup -d /dev/loop5

losetup /dev/loop1 asm_disk1
losetup /dev/loop2 asm_disk2
losetup /dev/loop3 asm_disk3
losetup /dev/loop4 asm_disk4
losetup /dev/loop5 asm_disk5

echo “/dev/raw/raw1 /dev/loop1” >> /etc/sysconfig/rawdevices
echo “/dev/raw/raw2 /dev/loop2” >> /etc/sysconfig/rawdevices
echo “/dev/raw/raw3 /dev/loop3” >> /etc/sysconfig/rawdevices
echo “/dev/raw/raw4 /dev/loop4” >> /etc/sysconfig/rawdevices
echo “/dev/raw/raw5 /dev/loop5” >> /etc/sysconfig/rawdevices

chown oracle:oinstall /dev/raw/raw[1-5]
# chown root:oinstall /dev/raw/raw[1-5]
chmod 660 /dev/raw/raw[1-5]
chown root:oinstall /dev/loop[1-5]
chmod 660 /dev/loop[1-5]

service rawdevices restart
./localconfig reset
./localconfig delete
./localconfig add
/etc/init.d/oracleasm restart

asmtool -C /u01/asmdisks/asm_disk1 -n disco1 -s /dev/loop1 -l /dev/oracleasm/asmtool -C /u01/asmdisks/asm_disk2 -n disco2 -s /dev/loop2 -l /dev/oracleasm/asmtool -C /u01/asmdisks/asm_disk3 -n disco3 -s /dev/loop3 -l /dev/oracleasm/asmtool -C /u01/asmdisks/asm_disk4 -n disco4 -s /dev/loop4 -l /dev/oracleasm/asmtool -C /u01/asmdisks/asm_disk5 -n disco5 -s /dev/loop5 -l /dev/oracleasm/ls /dev/oracleasm/disks

### alterar na mao o arquivo
# /etc/udev/permissions.d/50-udev.permissions
# raw devices
# raw/*:oracle:oinstall:0660

raw -qa

chmod 777 /dev/raw/*
chown oracle.dba /dev/raw/*
chown oracle.dba /u01/asmdisks/*

cd /home/oracle/oracle/product/10.2.0/db_1/bin

###########################################################################################

Ou RODAR O SCRIPT ABAIXO:
Crie um arquivo e deixe-o no arquivo:

/etc/init.d/S99asdisk

Conteudo do arquivo:

#!/bin/bash
#set -xv

export DESTASMDISKS=”/u01/asmdisks”
export ASMDISKNAME=”asm_disk”
export LO0P=”/dev/loop”
export RAW=”/dev/raw/raw”
export ORACLE_HOME=”/home/oracle”
chowns(){
chown oracle:oinstall -R $1
}
mkdir -p $DESTASMDISKS
for i in 1 2 3 4 5
do
dd if=/dev/zero of=${DESTASMDISKS}/$ASMDISKNAME${i} bs=1024k count=400
sleep 2
chmod 777 ${DESTASMDISKS}/$ASMDISKNAME${i}
sleep 2
losetup /dev/loop${i} ${DESTASMDISKS}/$ASMDISKNAME${i}
sleep 2
raw $RAW${i} /dev/loop${i}
sleep 2
chowns $RAW${i}
sleep 2
done

[ ! -d /stage/OSB ] && mkdir -p /stage/OSB
chowns /stage/OSB
chowns $DESTASMDISKS
chmod 777 /dev/raw/raw*
chmod 777 /u01/asmdisks/*

mv labs solutions $ORACLE_HOME
mv bash_profile-oracle $ORACLE_HOME/.bash_profile

chowns $ORACLE_HOME/labs
chowns $ORACLE_HOME/solutions
chowns $ORACLE_HOME/.bash_profile

set +xv