Using ram like disk space

Asked by Duje Šimic

Hello I am new at the Linux.

I'm interested in Linux can make ram partition that could be used for anything such as load some movies from the Hdd and the play movies from the RAM or things like that with that you want load into the ram. If this is possible this would be great. I have a little older computer and I run 32bit Ubuntu 10.10 without swap. Configuration of pc e6600 6Gb of ram 4TB of Hdd space. My ubuntu max usage of RAM is 600Mb that is nothing so i want to use extra space. I was very surprised by the ubuntu and i'm using it since october 2010. My disc usage is 0% and i want to stay when i play movies because they require constant disc usage for playing.

Srry about my bad English and Thanks for any help

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu mountall Edit question
Assignee:
No assignee Edit question
Solved by:
Duje Šimic
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
mycae (mycae) said :
#1

Its known as a "ramdisk". You can use the "tmpfs" module to create a ramdisk pseudo- device, then "mount" the new device as per normal.

http://megabytemorsels.blogspot.com/2009/05/using-tmpfs-for-tmp-with-ssd-in-ubuntu.html

Revision history for this message
Duje Šimic (duje-mostwanted) said :
#2

Can you guide me step by step in creating a Ramdisk. I searched all over the forum but i didint find what i was looking for because i dont want to save tmp files but my personal files if that is possible. This link i will try to do it to speed up things but i want more

Revision history for this message
mycae (mycae) said :
#3

>save tmp files but my personal files if that is possible.

As long as you don't care that if your computer ever shuts down, you lose everything, you can do this. As for speeding things up, it won't speed up anything but temporary accesses, as if you need to *save* the file from power-downs, you need to use a hard drive -- thats what they are there for -- persistent memory.

You cant do "more" than create the ramdrive.... Anyway, most applications simply load your file into memory and manipulate it there, so ramdisks wont make you faster in that respect.

Revision history for this message
Duje Šimic (duje-mostwanted) said :
#4

Ok
I want to save my personal files so i need a guide.
This previous link that you given me doesnt work for me so i want that you to write me exact procedure how to create RAMDISK if you now how or give me another link. I dont mind losing my personal files if suddenly computer shut down or reboot. I just want to be able to create ram disk and move some my personal files. AND THAT'S all.
I use ext4 partition on my disk drive.
No offense
Do you get my problem now. I dont now how to create RAMDISK and tmp files i want to be in RAM

Revision history for this message
Duje Šimic (duje-mostwanted) said :
#5

Ok
I want to save my personal files so i need a guide.
This previous link that you given me doesnt work for me so i want that you to write me exact procedure how to create RAMDISK if you now how or give me another link. I dont mind losing my personal files if suddenly computer shut down or reboot. I just want to be able to create ram disk and move some my personal files. AND THAT'S all.
I use ext4 partition on my disk drive.
No offense
Do you get my problem now. I dont now how to create RAMDISK and tmp files i want to be in RAM

Revision history for this message
mycae (mycae) said :
#6

The method is exactly the same.

Instead of mounting to /tmp, change that to

/home/YOURUSERNAME/SOMEFOLDER

this folder must exist.

so

    tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

becomes
    tmpfs /home/YOURUSERNAME/SOMEFOLDER tmpfs defaults,noatime,user,mode=1777 0 0

Note that unless you disable swap, tmpfs will use the normal memory pool, which includes swap.
http://man.cx/tmpfs

Revision history for this message
Duje Šimic (duje-mostwanted) said :
#7

ok you get my problem but there appeared a new problem.
tmpfs command not found writes mi back in console. I created a folder like you said all but command not found.

Revision history for this message
mycae (mycae) said :
#8

the above is not a command, its an entry in your /etc/fstab file -- please read the original link more closely, or search for tmpfs tutorials

Revision history for this message
Duje Šimic (duje-mostwanted) said :
#9

First
Thanks for your patience to explain some stuff to the N00B
I read your post for better understand and i found out that i dont have realtime to replace with noatime in fstab file.
In first link guy uses ext3 file format but I use ext4. I just placed a new entry in fstab file just like this in next row.
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
AND Nothing happend.
IF You want still to explain a little better I would be grateful
MANY THANKS

Revision history for this message
mycae (mycae) said :
#10

>I just placed a new entry in fstab file just like this in next row.
>tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

If you re-mount your /tmp then you will be using a ramdisk for your temporary files folder. You can check what is going on by issuing the command

mount

this will provide a listings of all filesystems and the devices they are mapped to.

Try using the modification I suggested above, instead of cutting and pasting from that link.

tmpfs /home/YOURUSERNAME/SOMEFOLDER tmpfs defaults,noatime,user,mode=1777 0 0

Revision history for this message
mycae (mycae) said :
#11

>I read your post for better understand and i found out that i dont have realtime to replace with noatime in fstab file.

This is not important, the noatime means "do not update access times when accessing files", and is a slight optimisation that means you don't need to issue a write when you read a file.

Revision history for this message
Duje Šimic (duje-mostwanted) said :
#12

Thanx. It works now. Temp files goes into ram and I manage to create a my folder that saves data in RAM
Many thanks.
See yaa