Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I would like to know if it is at all possible to create a virtual file system on the Random Access Memory using any utility available in Linux. That is, assign a space on the RAM and use it as a virtual disk - quite the opposite of virtual memory management! This is for efficient message passing between independent processes, that is, processes not created by forking. It is of course possible to use the disk to do this, but I am looking for speed and utilising RAM instead of disk reads.
With regards,
Arindam Banerjee. adda1234@bigpond.com
It's easy to do this, using tmpfs. Create a directory at the desired mount point, just like any other mount point. Then, in your /etc/fstab, make an entry like one of these:
That's taken directly from my usual fstab entry. Note that /tmp and /var/tmp are standard temporary file locations, so the directories already exist. I like using these entries because it reduces disc access--a big improvement for diskless workstations where every disc access consumes network bandwidth.
Note that tmpfs file systems always start off empty when mounted. Thus, any reboot will inherently delete the contents. For the above temporary directories, this behavior is actually desirable.
Thanks. Is tmpfs an utility? I checked my /etc and did not find any /fstab. The "man" command also does not understand tmpfs. How can I install this /fstab - is it free or is there some vendor?
Funny...do you know what sort of version of Linux you're using. There should be a file named "/etc/fstab". It's free...part of the basic file system stuff without which Linux can't really function. I don't know if tmpfs is included in all distributions base systems, but it would surprise me if it weren't included in all of them.
The only problem using RAM for data storage is the consistency. I suggest using ECC memory because your files will become corrupted if you do not use ECC memory. Hard drives do ECC by default.
You could use Gigabyte's I-RAM but I do not know how well it works at this time. What I read, is Gigabyte did not include a few commands that the kernel uses to see the I-RAM device as a drive.
tmpfs comes from the kernel so the vendor is kernel.org. It is a filesystem that has some limited features. If you type man mount, it should be in there.
The file /etc/fstab should be there. If it is not, Linux will not be able to boot. If you type man fstab, it should give information how it should be written.
Electro, what Arindam is asking for is actually different from what the subject line says. He's asking for a file system in RAM, for temporary files used locally, rather than a file "server".
Electro, what Arindam is asking for is actually different from what the subject line says. He's asking for a file system in RAM, for temporary files used locally, rather than a file "server".
Dah I read it.
The problems with tmpfs is there is no buffering and it can actually be slower. A filesystem like XFS uses a lot of RAM for cache, so it has instant access and very high throughput. Another filesystem to consider is JFS.
I have used tmpfs for both /tmp and /var/tmp and other tasks like compiling. The speed is not fast as it should be. Choosing a disk node is a lot faster because both caching and buffering can be done. If tmpfs is not limited to a desire size or if the size is twice the RAM and included swap partitions, tmpfs can slow down Linux to a crawl when tmpfs consumes all the space that it was given.
If Gigabyte I-RAM works in Linux, caching and buffering can be done. Also it will be very, very fast accessing data. tmpfs will not even match the performance of I-RAM even though I-RAM is connected to SATA and then to the bus which does increase latency. I predict about 1 millisecond accessing time for I-RAM versus 20 to 30 milliseconds accessing time when using either IDE or SATA.
BTW, you have a flaw in your setup. You will need to provide mode=1777 for /tmp and /var/tmp.
The application in question is for message passing between some custom application's processes! Obviously the desired size is nowhere near the amount of RAM (if it were, then the original poster wouldn't be asking how to do it in RAM).
Oh, what is the deal with mode=1777? I never bothered checking, but I presumed that the /tmp and /var/tmp directories were already world writeable during the initial setup. Then I manually added those /etc/fstab entries without doing anything special to create those directories for the mount points.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.