Wednesday, September 9, 2009

Howto Create A RAMDISK in Ubuntu / debian Linux

Some times we need to create Ramdisk for temporary use. Very easily you can make a ramdisk. it is lightning fast, because it is in RAM.

Open a Terminal


$ sudo mkdir /mnt/ramdisk

$ sudo mount -t tmpfs none /mnt/ramdisk

10 comments:

  1. A ramdisk lets you directly store files in physical memory as if it was on your hard drive.

    ReplyDelete
  2. How to set up a size of a ramdisk ?

    ReplyDelete
  3. How to set up a size of a ramdisk ?

    ReplyDelete
  4. sudo mkfs -t ext3 -q /dev/ram1 65536
    sudo mkdir -p /ramdisk
    sudo mount /dev/ram1 /ramdisk -o defaults,rw

    ReplyDelete
  5. change the number "65536" for a larger or smaller ramdisk, alter /dev/ram1 to another RAM device if you are creating multiple ramdisks

    ReplyDelete
  6. Is bad the following realization of a ramdisk ?

    $ sudo mkdir /media/ramdisk
    $ sudo mount -t ramfs -o size=64m ramfs /media/ram

    ReplyDelete
  7. I played with the ram disk on my Mac in Snow Leopard's terminal, but there is an icon for a ram disk on the desktop that makes it easier. Where on the Ubuntu menu in Karmic Koala can I find the ram disk that this creates? And can I save files directly from Open Office into the ram disk if I follow Panayara's code

    sudo mkfs -t ext3 -q /dev/ram1 65536
    sudo mkdir -p /ramdisk
    sudo mount /dev/ram1 /ramdisk -o defaults,rw

    I assume that I have to reinstall the ram disk each time I reboot--though comment on Ubuntu forums implies that Ubuntu has a ram disk in the directory dev/shm How do I mount that in Ubuntu so I can save files in it directly from Open Office or from one of the USB drives I have plugged in?

    ReplyDelete
  8. There's an easy way to create and mount a RAM disk in ubuntu explained here: http://www.techtach.org/using-and-mounting-a-ram-disk-in-ubuntu-the-easy-way

    ReplyDelete