HP-UX Reference (11i v2 07/12) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

r
ramdisc(7) ramdisc(7)
NAME
ramdisc - RAM disk device driver
DESCRIPTION
The ramdisc driver supports numerous RAM disk devices that are created by the system either during
the boot process or during normal system operation. One RAM disk volume is created during the boot pro-
cess. Up to 15 RAM disk volumes can be created during normal system operation. RAM disk volumes
created during normal system operation can be swappable or nonswappable volumes.
Nonswappable RAM disk volumes reserve the kernel space memory of the system during their creation.
The size of kernel space memory reserved is the same as the size of the RAM disk volume created. This
reserved memory can only be used by read and write operations on the RAM disk volume. The reserved
memory is freed when the nonswappable RAM disk volume is deallocated. Nonswappable RAM disk
volumes can be created using ramutil (see ramutil(1M)).
Swappable RAM disk volumes reserve the user space memory of the system during their creation. The size
of user space memory reserved is the same as the size of the RAM disk volume created. The reserved user
space memory is swappable when there is memory contention on the system. Swappable RAM disk
volumes can be created using
ramutil (see ramutil(1M)).
Minor Number Format
Minor number format for a RAM disk volume is:
Bits 20-23: Volume Number. This is a value from 0 to 14.
Bits 4-19: Size of the RAM disk volume. Used in conjunction with the flags bits to specify the size of
the RAM disk volume.
Bits 0-3: Flags. They are defined as:
#define RAM_64KB_UNITS 0x1
#define RAM_NOCACHE_BIT 0x2
#define RAM_GB_UNITS 0x4
#define RAM_NEW 0x8
DEVICE SPECIAL FILES
The following device special files are associated with RAM disk volumes:
/dev/dsk/ram volume_number block device special files for RAM disk volumes
/dev/rdsk/ramvolume_number raw device special files for RAM disk volumes
Each RAM disk volume can be accessed either as a block device or as a raw device. When a RAM disk
volume is accessed as a block device, the normal buffering mechanism is used when reading from and writ-
ing to the device without regard to physical disk records. Accessing the RAM disk volume as a raw device
enables direct transmission between the disk and the read or write buffer. A single read or write call usu-
ally results in a single I/O operation, meaning that raw I/O is more efcient when many bytes are transmit-
ted.
ERRORS
ramdisc returns the following errors:
[EAGAIN] Cannot allocate resource for RAM disk. Try again later.
[EBUSY] Cannot deallocate RAM disk volume because it is in use.
[EFAULT] Buffer address is a bad address.
[EINVAL] The argument is invalid.
[EIO] An I/O error occurred.
[ENXIO] The device did not exist during opening.
WARNINGS
HP-UX 11i v2 (11.23) Ramdisc version 1 has not been certified for use with HP’s Logical Volume Manager
(LVM) in mirrored configurations. HP does not support such configurations since there is a possibility of
data loss from a redundancy failure of a physical disk or disk interface component. Other LVM mirrored
configuration failure modes may exist that may further impact data integrity. Note: RAM disk data is not
persistent across system reboots.
134 Hewlett-Packard Company 1 HP-UX 11i Version 2: December 2007 Update