Provides access to the logical volume device driver.
The logical volume device driver provides character (raw) access to logical volumes. The Logical Volume Manager associates a major number with each volume group and a minor number with each logical volume in a volume group.
Logical volume special file names can be assigned by the administrator of the system. However, /dev/lv1, /dev/lv2 and /dev/rlv1, /dev/rlv2 are the names conventionally chosen.
When performing character I/O, each request must start on a logical block boundary of the logical volume. The logical block size is 512 bytes. This means that for character I/O to a logical volume device, the offset supplied to the lseek subroutine must specify a multiple of 512 bytes. In addition, the number of bytes to be read or written, supplied to the read or write subroutine, must be a multiple of 512 bytes.
Block I/O requests cannot be larger than a logical track group (128KB) and must not cross a logical track group boundary.
Note: I/O requests should not be sent to the block special file interface when the logical volume is mounted. When a logical volume is mounted (that is, the block special file is opened by the file system), any I/O requests from the user made to that logical volume should be made only through the character special file.
Attention: Data corruption, loss of data, or loss of system integrity (system crashes) will occur if devices supporting paging, logical volumes, or mounted file systems are accessed using block special files. Block special files are provided for logical volumes and disk devices on the operating system and are solely for system use in managing file systems, paging devices and logical volumes. They should not be used for other purposes. Additional information concerning the use of special files may be obtained in "Understanding I/O Access through Special Files" in AIX Kernel Extensions and Device Support Programming Concepts.
The ext parameter for the readx and writex extended I/O subroutines indicates specific physical or logical operations, or both. The upper 4 bits of the ext parameter are reserved for internal LVDD use. The value of the ext parameter is defined by logically ORing values from the following list, as defined in the /usr/include/sys/lvdd.h file:
There are some restrictions when using this operation. To synchronize a whole logical partition (LP), a series of readx subroutines using the RESYNC_OP operation must be done. The series must start with the first logical track group (LTG) in the partition and proceed sequentially to the last LTG. Any deviation from this will result in an error. The length provided to each readx operation must be exactly 128KB (the LTG size).
Normal I/O can be done concurrently anywhere in the logical partition while the RESYNC_OP is in progress. If an error is returned, the series must be restarted from the first LTG. An error is returned only if resynchronization fails for every stale physical partition copy of any logical partition. Therefore, stale physical partitions are still possible at the end of synchronizing an LP.
Normal I/O operations do not need to supply the ext parameter and can use the read and write subroutines.
The IOCINFO ioctl operation returns the devinfo structure, as defined in the /usr/include/sys/devinfo.h file. The values returned in this structure are defined as follows for requests to the logical volume device driver:
The XLATE ioctl operation translates a logical address (logical block number and mirror number) to a physical address (physical device and physical block number on that device). The caller supplies the logical block number and mirror number in the xlate_arg structure, as defined in the /usr/include/sys/lvdd.h file. This structure contains the following fields:
The PBUFCNT ioctl operation increases the size of the physical buffer header, pbuf, pool that is used by LVM for logical-to-physical request translation. The size of this pool is determined by the number of active disks in the system, although the pool is shared for request to all disks.
The PBUFCNT ioctl operation can be issued to any active volume group special file, for example /dev/VolGrpName. The parameter passed to this ioctl is a pointer to an unsigned integer that contains the pbufs-per-disk value. The valid range is 16 - 128. The default value is 16. This value can only be increased and is reset to the default at IPL. The size of the pbuf pool is not reduced when the number of active disks in the system is decreased.
The PBUFCNT ioctl operation returns the following:
The LV_INFO ioctl operation returns information about the logical volume in question. This ioctl operation only applies to AIX Versions 4.2.1 and later.
The caller supplies the logical volume special file in the system open call and the information is returned via the lv_info structure, as defined in the /usr/include/sys/lvdd.h file. This structure contains the following fields:
The LV_INFO ioctl operation returns the following:
EFAULT | Indicates that the copy of the parameter failed. |
In addition to the possible general errors returned by the ioctl subroutine, the following errors can also be returned from specific ioctl operation types.
The lvdd special file is part of Base Operating System (BOS) Runtime.
The close subroutine, ioctl subroutine, lseek subroutine, open subroutine, read subroutine, write subroutine.
Logical Volume Storage Overview in AIX Version 4.3 System Management Guide: Operating System and Devices.