[Bootcd-user] tmpfs instead of ramdisk

Michael Lee andro@mailandnews.com
Tue, 22 Jun 2004 16:37:09 -0400


Hi
>From the documentation, bootcd uses ramdisks.
I think using tmpfs instead of ramdisk is a better idea.
Let me list Pros and Cons of tmpfs and ramdisk:

RAMDISK
  PROS:
    Supports kernels from 2.2 up, thus more portable
  CONS:
    Each ramdisk is limited by the same size
    You have to format it to use it
    Not swappable
TMPFS
  PROS:
    Each instance can have different size limit
    You don't have to format it to use it.
    Swappable to swapspace/virtual memory
  CONS:
    Supported by kernels from 2.4 up

How do you think about using TMPFS instead of RAMDISK?
In case of using tmpfs, one can first mount tmpfs like this:

  mount -t tmpfs tmpfs /tmp
  mount -t tmpfs -o size=4m,mode=755 tmpfs /root
  mount -t tmpfs -o size=16m,mode=755 tmpfs /home
  mount -t tmpfs -o size=32m,mode=755 tmpfs /var

In the example, maximum size of /tmp is limited by 
half the physical memory.
/root, /home and /var are limited to 4 megs, 16 megs, and 
32 megs each and they initially have mode 755.
In my case, I mount DEVFS on /dev so TMPFS is not needed for /dev.

After mounting TMPFS, one can extract the contents of each mounted
directories from tarballs stored on bootcd.