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.
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 5L Version 5.1 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 XLATE64 ioctl operation functions the same as the XLATE operation except that it uses the xlate_arg64 structure, in which the logical and physical block numbers and the device (major/minor) number fields are 64-bit wide.
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 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. |
LVM ioctl Operations Used to Modify Single Logical Volumes
LV_QRYBKPCOPY | Query for designated backup mirror copy. |
LV_SETBKPCOPY | Designate backup mirror copy. |
LV_FSETBKPCOPY | Force new designation for backup mirror copy. Used when there are stale partitions on either the active mirror or backup mirror. |
SET_SYNC_ON_RD | Causes the logical volume to go into MWCC_PASSIVE_RECOVERY mode. All reads from one mirror copy will cause non-read mirror copies to undergo a sync write. |
CLR_SYNC_ON_RD | Clears the MWCC_PASSIVE_RECOVERY mode of the logical volume, if it exists. This clear should not be exercised if mirror consistency is not guaranteed. |
The LV_INFO64 ioctl operation functions the same as the LV_INFO operation except that it uses the lv_info64 structure, in which the major_num and minor_num fields are 32-bit wide each and the num_blocks field is 64-bit wide.
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 5L Version 5.1 System Management Concepts: Operating System and Devices.