Using ASM with files (either locally or via NFS)
From time to time i need to configure additional and temporary storage for data migration or just testing purposes. Raw Devices are not recommended to use from 11g onwards.
So why not use the loopback device for that? With this scenario you can even place these disks on NFS and use it across nodes in a cluster:
1. Create the file
dd if=/dev/zero bs=1024k count=1000 of=/disk1
2. Setup loopback driver
losetup /dev/loop1 /disk1
3. Label device
oracleasm createdisk LOOP1 /dev/loop1
4. Use it with ASM
Categories: Oracle ASM, Oracle in general
Regarding 11gR2 RAC, ASM, and NFS, it is my understanding that NFS mounted file systems are mounted as anonymous file systems rather than block devices and ASM requires block devices. The only way I know of to have Linux treat an anonymous file system mounted over NFS as a block device is to subsequently mount it as a loop device as shown in your article. However, the Oracle 11gR2 documentation specifically states, “ASM does not support loop devices”.
How do I mount NFS file systems as block devices so ASM will use them?
Without creating the loop device, oracleasm createdisk complains the given file is not a block device when i run
/usr/sbin/oracleasm createdisk DISK1 /u01/oradata/data_disk_01
where /u01/oradata is an NFS mount from a NetApp volume defined in /etc/fstab.
When I use the asmca, it does not find any candidate disks even with the search path set.