Manual pages › Devices and drivers (7)
ramdisk(7)
the RAM disk: the boot loader's miniroot and two scratch disks
Package: ramdisk46, added for amigaux.
NAME
ramdisk - the RAM disk: the boot loader's miniroot and two scratch disks
SYNOPSIS
/dev/dsk/ram0
/dev/dsk/ram1
/dev/dsk/ram2
DESCRIPTION
ramdisk is a block driver with three units, each a disk held in memory.
- ram0
- the miniroot image the boot loader placed in memory, when there is one. A medium that boots from a RAM disk (a CD, a floppy, a network install) carries the image, and the kernel mounts its root from this unit. The memory is the loader's: the kernel never uses it for anything else, and the driver never frees it. The unit can be written to; its contents are lost at power-off. Without an image the unit does not exist.
- ram1
- a scratch disk of size1 KiB, 512 by default.
- ram2
- a scratch disk of size2 KiB, 2048 by default.
A scratch disk's memory is taken when the unit is first opened (or mounted) and given back when the last user closes it; a fresh scratch disk reads as zeros. It is taken in pieces of at most 256 KiB. When the kernel cannot give it, the open fails with ENOMEM and can simply be tried again later. A unit whose size is 0 does not exist.
Every transfer is a copy by the CPU. There is no raw (character) device.
The driver is the loadable module ramdisk, of the root class: the boot loader places it with the kernel, and it is linked before the root file system is mounted. It replaces the stock ram driver on the same block major, with the stock sizes for units 1 and 2. It is never unloaded.
PARAMETERS
DIAGNOSTICS
An open of a unit that does not exist gives ENXIO, an open of a scratch disk the kernel has no memory for ENOMEM. A transfer past the end of a unit gives ENXIO; a read that starts exactly at the end reads nothing. At load the console says where unit 0's image is (ramdisk: unit 0 is the image at...).
EXAMPLES
mkfs /dev/dsk/ram2 4096 mount /dev/dsk/ram2 /mnt
FILES
- /dev/dsk/ram0, ram1, ram2
- block major 20, minors 0 to 2, mode 0600, owner root.
- /etc/conf/mod.d/ramdisk
- the module.
- /etc/conf/modreg.local.d/ramdisk
- the box's own parameters, which no package owns.
| 31 October 2026 | ramdisk |