General discussion

Locked

Linux and RAM drive

By CyberGod ·
I need to create a RAM drive and to redirect writing processes to it, like /tmp and /var directory. How to do this ?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Linux and RAM drive

by embassy_16 In reply to Linux and RAM drive

A drive? Lets call it a device. Description: Lets call it RAM. This is a block device that will access the ram disk in raw mode. Command to creat this device:

mknod -m 660 /dev/ram b 1 1
chown root:disk /dev/ram

Then I would create a link to this new device to redirect your files.

ln -s /tmp or /var

Hope this helps you out.

Collapse -

Linux and RAM drive

by CyberGod In reply to Linux and RAM drive

Poster rated this answer

Collapse -

Linux and RAM drive

by SpiderErrol In reply to Linux and RAM drive

If you are using a 2.4.x kernel ("uname -r" will display the current version), then you can use tmpfs: "mount -t tmpfs -o size=64M none /tmp" this will create a RAM only filesystem, which will take up no more than 64Mb of physical memory, and mount it on to your "/tmp" directory.

CAUTION: Always specify the size option, and leave enough memory for you system to run in! tmpfs will absorb all you memory if you let it, and lock up your system.

Also note that tmpfs will never be swapped out to disc - it will only use real memory.

New processes will write to this filesystem just as they would any other.

Collapse -

Linux and RAM drive

by CyberGod In reply to Linux and RAM drive

Poster rated this answer

Collapse -

Linux and RAM drive

by CyberGod In reply to Linux and RAM drive

This question was closed by the author

Back to Linux Forum
5 total posts (Page 1 of 1)  

Operating Systems Forums