Ram disks are used very often to hold the root file system of embedded systems. They have several advantages:

well-known

well-supported by the Linux kernel

simple to build

simple to use - you can even combine the ramdisk
with the Linux kernel into a single image file

RAM based, thus pretty fast

writable file system

original state of file system after each reboot = easy
recovery from accidental or malicious data corruption etc.

On the other hand, there are several disadvantages, too:

big memory footprint:
you always have to load the complete filesystem into RAM,
even if only small parts of are actually used

slow boot time: you have to load (and uncompress) the whole
image before the first application process can start

only the whole image can be replaced (not individual files)

additional storage needed for writable persistent data

Actually there are only very few situations where a ramdisk image is the
optimal solution. But because they are so easy to build and use we will discuss them here anyway.

In almost all cases you will use an ext2 file system in your ramdisk
image. The following steps are needed to create it:

Create a directory tree with the content of the target root filesystem.
We do this by unpacking our master tarball:

$ mkdir rootfs
$ cd rootfs
$ tar zxf /tmp/rootfs.tar.gz

We use the genext2fs tool to create the ramdisk image
as this allows to use a simple
text file to describe which devices shall be created in the
generated file system image.
That means that no root permissions are required at all.
We use the following device table
rootfs_devices.tab: