## Defining a raw logical volume 

A raw logical volume is an area of physical and logical disk space that is under the direct control of an application, such as a database or a partition, rather than under the direct control of the OS or a file system. 

Bypassing the file system can yield better performance from the controlling application, especially from database applications. However, the amount of improvement depends on factors such as the size of a database or the application’s driver, so you must provide the application with the character or block special device file for the new raw logical volume. The application links to this device file when it attempts opens, reads, writes, and so on. 

Each logical volume has a logical volume control block (LVCB) in the first block. The size of LVCB is the block size of the PVs within the VG. Data begins in the second block of the PV. In a raw logical volume, the LVCB is not protected. If an application overwrites the LVCB, commands that normally update the LVCB fail and generate a message. Although the logical volume might continue to operate correctly and the overwrite can be an allowable event, overwriting the LVCB is not  recommended. 

The following instructions use SMIT and the command-line interface (CLI) to define a raw logical volume. The information in this how-to scenario was tested by using specific versions of AIX. The results that you obtain might vary depending on your version and level of AIX. 

1. With root authority, find the free PPs on which you can create the raw logical volume by using the SMIT fast path that is shown in Example 7-4. 

# smitty lspv 

2. Select the disk, accept the default in the second dialog status, and click OK . 

3. Multiply the value in the FREE PPs  field by the value in the PP SIZE  field to get the total number of megabytes that are available for a raw logical volume on the selected disk. 

If the amount of free space is not adequate, select a different disk until you find one that has enough available free space, and exit the SMIT menu. 

4. Run the mklv command to create the raw logical volume. 

Example 7-5 creates a raw logical volume that is named lvdb2003 in the db2vg VG by using thirty-eight 4 MB PPs. 

mklv -y lvdb2003 db2vg 38 

Now, the raw logical volume is created. If you list the contents of your VG, a raw logical volume is shown with the default type, which is JFS. This type entry for a logical volume is simply a label. It does not indicate that a file system is mounted for your raw logical volume. 

To learn how to open /dev/rawLVname  and use this raw space, see your application’s instructions. 

