RAM disk support in VxVM

Some systems support the creation of RAM disks. A RAM disk is a device made from system memory that looks like a small disk device. Often, the contents of a RAM disk are erased when the system is rebooted. RAM disks that are erased on reboot prevent VxVM from identifying physical disks. This is because information stored on the physical disks (now erased on reboot) is used to identify the disk.

nopriv devices have a special feature to support RAM disks: a volatile option which indicates to VxVM that the device contents do not survive reboots. Volatile devices receive special treatment on system startup. If a volume is mirrored, plexes made from volatile devices are always recovered by copying data from nonvolatile plexes.

To use a RAM disk with VxVM, both block and character device nodes must exist for the RAM disk.

To create a RAM disk with VxVM

  1. Create the RAM disk:

    # ramdiskadm -a ramdiskname size
  2. Create links to the RAM disk:

    # ln -s /dev/ramdisk/ramdiskname /dev/dsk/ramdiskname
    # ln -s /dev/rramdisk/rramdiskname /dev/rdsk/rramdiskname
  3. Add the RAM disk as a foreign device to VxVM:

    # vxddladm addforeign blockpath=/dev/ramdiskname 
  4. Define the RAM disk using the vxdisk define command:

    # vxdisk scandisks
    # vxdisk define ramdiskname type=nopriv volatile len=size
  5. Add the RAM disk to a diskgroup:

    # vxdg -g diskgroup adddisk ramdiskname


    An existing diskgroup must exist in order to validate configuration copies.

  6. Create VxVM volumes on the RAM disk:

    # vxassist -g diskgroup make volume size ramdiskname

Normally, VxVM does not start volumes that are formed entirely from plexes with volatile subdisks. That is because there is no plex that is guaranteed to contain the most recent volume contents.

Some RAM disks are used in situations where all volume contents are recreated after reboot. In these situations, you can force volumes formed from RAM disks to be started at reboot by using the following command:

# vxvol set startopts=norecov volume

This option can be used only with volumes of type gen.

See the vxvol(1M) manual page.