Linux Ramdisk And Tmpfs

ramdisk
2.6 kernal have 16 ramdisk device. under /dev/ram*.

  mke2fs /dev/ram0
  mount -t ext2 /dev/ram0 /mnt/ram0

the default size of ramdisk is 64M.
change boot parameter ramdisk_size(kb) such as grub.conf.

default=1
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.9-13)
        root (hd0,1)
        kernel /vmlinuz-2.4.9-13 ro root=/dev/hda3 hdc=ide-scsi ramdisk_size=65536
...

tmpfs
tmpfs is fs, needn't mkfs, and maybe use swap. dynamic allocation.

  mkdir /mount/ramdisk
  mount -t tmpfs tmpfs /ramdisk -o size=32m
  chown user:user /ramdisk

tmpfs can mount to exist mount point without umount.

  monut -t tmpfs tmpfs /tmp -o size=50m