This procedure is used to define an area of physical and logical disk space that is under the direct control of an application rather than under control of the operating system and file system. The applications use character (raw) input and output rather than the block input and output of file systems, which require more software overhead. Bypassing the file system overhead enables applications to perform better. Raw logical volumes are most commonly used with database applications because of their need for high performance. While there is ordinarily a significant increase in performance, the actual amount of the increase depends on the database size and the driver provided by the application.
To prepare a raw logical volume, you simply create an ordinary logical volume without creating a file system on it.
Note: Do not be too concerned with the name of the application or how its documents use raw storage. The term used could be any one of the following: partition, slice, file system, raw access, raw disk, or logical volume. The important naming concerns are dealt with as follows:
- Use the correct command to define and name the device for the operating system. For a logical volume, use the mklv command to create /dev/rLVName and /dev/LVName (for example, /dev/rhdX and /dev/hdX).
- Provide the application with the character or block special device file as appropriate. The application will link to this device when performing opens, reads, writes, and so on.
Attention: Each logical volume has a logical-volume control block (LVCB) located in the first 512 bytes. Data begins in the second 512-byte block. Take care when reading and writing directly to the logical volume, as is done with raw logical volumes, because the LVCB is not protected from raw-logical-volume access. If the LVCB is overwritten, commands that try to update the LVCB will fail and give a warning message. Although the logical volume will continue to operate correctly and the overwrite of the LVCB is an allowable event, it is not recommended that the LVCB be destroyed by raw-logical-volume I/O.
Be sure to read the following before attempting to create a raw logical volume:
To find the free physical partitions (PPs) where you can create the raw logical volume, use Web-based System Manager (type wsm, then select lvm) or the SMIT fast path as follows:
mklv -y LVname VGName 38
In this example, -y indicates that you are going to name the logical volume instead of using a system name. The number 38 represents the number of 4 MB physical partitions. The raw volume capacity in this example is thus 152 MB. The raw logical volume you have created is now ready for your application to use.
For the next step, consult your application's instructions on how to use the raw space created. The instructions include how to open /dev/LVName and how to use it.