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:

    # mkramdisk size

    A block device /dev/ramdisk[0-63] and a character device /dev/rramdisk[0-63] are created. A maximum of 64 ramdisks is allowed.

  2. Create links to the RAM disk:

    # ln /dev/ramdisk0 /dev/ramdiskname
    # ln /dev/rramdisk0 /dev/rramdiskname
  3. Add the RAM disk as a foreign device to VxVM:

    # vxddladm addforeign blockpath=/dev/ramdiskname 
    charpath=/dev/rramdiskname
  4. Discover the RAM disk:

    # vxdisk scandisks

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.