- Reading and writing temporary files will be much faster.
- Temporary files will be more securely removed on shutdown.
Standard practice for Linux is to store temporary files in /tmp . A quick edit of the file system table (located at /etc/fstab ) will make sure that the /tmp directory is mounted as a RAM disk using tmpfs. Open up /etc/fstab in an editor (vim, nano, gedit etc.) as a super user and append the following line:
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 2
Let's go over some of the syntax of the line we just entered. There are 6 parts to any fstab entry, each separated by whitespace:
Speed and security sounds like something I want Chromium to benefit from as well. To move Chromium's cache to our new tmpfs open up/usr/share/applications/chromium-browser.desktop . This is the configuration file for how Chromium appears in menus and is launched. Near the bottom will be a line starting with Exec similar to:
Change this to:
Now to make Firefox use our new RAM disk to store it's temporary files go toabout:config and add a new string entry for
and enter:
Credit goes to Fewt for inspiring this article, though he goes a little further by also moving logs to RAM, which doesn't seem the safest thing to do, but hey, whatever you want to do with your system...
device : This typically names the device or partition being mounted through either a/dev address or a UUID. Since our entry isn't a physical device we can give it any arbitrary name, I've chosen tmpfs.mount point : This is where our new file system is attached to the root file system.type : This is the type of filesystem we're creating.options : These are options we're giving to the filesystem. The options I've provided are:
default : Default file system optionsnoatime : Linux will update the access time property of a file whenever it is read or written, something that is really only useful on servers or if you use mutt for your email. I add this option to most of my file systems for a small performance boost.mode=1777 : This will give read and write permissions to everybody.
dump : If set to 1, dump will make backups of this file system. To not make backups we set to 0.pass : This is the order fsck will check each filesystem. 0 is skip, 1 is reserved for/root and 2 should be used for the rest.
Speed and security sounds like something I want Chromium to benefit from as well. To move Chromium's cache to our new tmpfs open up
Exec=chromium-browser %U
Change this to:
Exec=chromium-browser --disk-cache-dir="/tmp" %U
Now to make Firefox use our new RAM disk to store it's temporary files go to
browser.cache.disk.parent_directory
and enter:
/tmp
Credit goes to Fewt for inspiring this article, though he goes a little further by also moving logs to RAM, which doesn't seem the safest thing to do, but hey, whatever you want to do with your system...
0 comments:
Post a Comment