Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to make a partition that is made of ram ...

Example

In windows 7 you can make a partition that is made of ram

enter image description here

I have created 1 GB of partition in ram . using Primo RamDisk

Is there any good Alternative in Ubuntu ?

share|improve this question
    
Ubuntu comes with tmpfs. You need not create a RAMDISK. –  mixdev Mar 30 at 4:03

2 Answers 2

up vote 10 down vote accepted

This will show you how to make a RAMDISK super fast and easily. With a RAMDISK you can use your memory for temporary space and it’s also a lot quicker than your hard drive.

Now lets start by using the next 2 commands to make your RAMDISK.

Put whatever you want your RAMDISK to be called where I wrote “nameme”.

mkdir -p /media/nameme

mount -t tmpfs -o size=2048M tmpfs /media/nameme/
The above commands would use 2GB of my RAM for the RAMDISK. If you don’t have as much ram as I do I would use 512MB or 1GB. So next were going to create a command for Terminal that will automatically create the RAMDISK for you.

Source: How To Create A RAMDISK In Linux

share|improve this answer

The tmpfs filesystem is a RAMDISK. The following will create a 2G RAMDISK that will always be available.

sudo mkdir -p /media/ramdisk
sudo mount -t tmpfs -o size=2048M tmpfs /media/ramdisk

The ramdisk folder is owned by root as it is to be available on reboot. The ramdisk permissions should be writeable by everyone. The tmpfs default permissions (chmod 1777) are correct.

drwxrwxrwt 2 root root 180 Apr 23 07:34 /media/ramdisk

To make the ramdisk permanently available, add it to /etc/fstab.

grep /media/ramdisk /etc/mtab | sudo tee -a /etc/fstab

You will see the line moved from mtab to fstab. It will look something like this.

tmpfs /media/ramdisk tmpfs rw,size=2048M 0 0

The RAMDISK won't consume memory until you use it. Double check your memory requirements during maximum system load. If the RAMDISK is too large, your system will consume swap storage to make up the difference.

To adjust the size of the RAMDISK, edit /etc/fstab and verify by remounting the ramdisk (you will lose your current RAMDISK content as you will on reboot). The following will change the size of the ramdisk to 512M

# Check the existing ramdisk size.
df /media/ramdisk
# change size=512M for a 512 megabyte ram drive.
sudo vi /etc/fstab
# Remount the ramdisk, you will lose any existing content.
sudo mount -a /media/ramdisk
# Verify the new ramdisk size.
df /media/ramdisk
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.