How To Set Up Oracle ASM on Ubuntu Gutsy Gibbon
I’ve recently moved to Ubuntu Linux, and this post describes my attempt to play around with Oracle ASM on Ubuntu. For this demonstration, I used Oracle 11.1.0.6 on Gutsy Gibbon. I hope it will be useful to somebody out there.
Important Notice: What I describe below is among the worst thing you can ever do with ASM. You can use it to play around but never use it with anything other than test data. If you lose something because of me, you’ll be the only one to blame !
Question #1: How do you simulate a disk from a file?
(See here for more details.)
If you have a free partition or disk to be used as an ASM disk, just skip this step. If you don’t, you can create a file with the dd command and create a device that actually loops to the file with the losetup command.
Let’s assume you’ve created a directory named /asmdisks (and you have write access to it). Run the command below to create a file named disk1 that is 3GB in size:
$ dd if=/dev/zero of=/asmdisks/disk1 bs=1024k count=3072 3072+0 records in 3072+0 records out 3221225472 bytes (3.2 GB) copied, 80.9113 seconds, 39.8 MB/s
Once you’ve created the file, map it to a device named loopN in /dev. You can list the used loop devices with the losetup -a command.
Once you’ve made sure the one you plan to used is free, e.g. /dev/loop1, you can map the device to the file with the following commands (you have to be root) :
# losetup /dev/loop1 /asmdisks/disk1 # losetup -a /dev/loop1: [0802]:7438407 (/asmdisks/disk1)

