Quote:
|
Originally Posted by niw_uk1964 I was hoping there would be an easy implementation so that whenever my Mini booted I would have a ramdisk that was easily accessible as another drive....if that's possible.
Assuming I added in the line you mention, what or how would I need to point FF to this ramdisk? Linux doesn't assign drive letters like Windows does. Presumably it's just a case of entering the path? |
Well, a tmpfs is a little different than an actual ramdisk - however, it will serve for holding your browser cache quite well. You're right; Linux doesn't create drive letters like Windows. Instead it maps all drives to a folder (directory) inside the root filesystem of the
SSD... The
SSD becomes "/" (or the root) of the file system, and everything shows up in relation to that.
When you plug in a thumbdrive, it (most likely) shows up under /media/disk. (There are specific things which can change this - like having a disk label for the drive, but that's another post!) To implement a tmpfs for your browser cache, you can try this (as a warning, you *will* need to use the command line for some of this - this is not Windows, after all):
Gross Procedure:
- create mount point for your new cache
- edit /etc/fstab to include a tmpfs on your new mount point
- change Firefox's settings to use this new "location" for your browser's cache
Creating the mount point:
- open a terminal (Applications -> Accessories -> Terminal)
- enter the command:
sudo bash
(the command above makes you the root user)
- enter the command:
mkdir /opt/cache
(this command creates the mount point for your ram-based tmpfs)
- enter the command:
chmod 777 /opt/cache
(this command makes that mount point readable and writable for anyone on your Mini - if you want a more secure cache, you can make the mode 775, but it will add another command to the process...)
- if you chose to make your cache more secure, enter the command:
chown gerall:gerall /opt/cache
(adjust 'gerall' to be *your* login name - I use "gerall" for logging into my Mini, if your login name is "dingo", the line should read:
chown dingo:dingo /opt/cache)
(leave the Terminal open for the next step)
Create the tmpfs on your new mount point:
- from the Terminal you have open, enter the command:
cp /etc/fstab /etc/fstab.bak
(this creates an un-touched backup copy in case of problems)
- enter the command:
gedit /etc/fstab
(this will open the fstab configuration file for editing in the GUI text-editor equivalent of Notepad)
- at the end of the file, add the line:
none /opt/cache tmpfs size=64m,mode=777,users,nodev,nosuid 0 0
(this creates a 64-megabyte cache for Firefox. If you chose to make your cache secured, the mode should be 775 instead of 777, the rest of the options after mode are for security purposes - they keep malicious code from causing any trouble from inside the cache)
- File -> Save
- File -> Exit
- enter the command:
mount /opt/cache
(this should activate your new tmpfs under the /opt/cache directory - you should be able to browse there under Nautilus and create a new file, and just generally make a mess...)
Aim Firefox at your new cache
- open Firefox
- Edit -> Preferences -> Advanced -> Network -> click the "Clear Now" button under the section called "Offline Storage"
(this deletes the last of the cache from your
SSD - tidying things up before we move it)
- in the URL bar, enter
about:config
(this gets you to some deeper settings inside Firefox)
- if you get the screen saying "This might void your warranty!", click the button labeled "I'll be careful, I promise!"
(I have no idea why Mozilla put that screen there...)
- in the bar labeled "Filter:" at the top of the screen, type
browser.cache.disk
(no need to hit "Enter" - you should see the Preferences which begin with these words rendered below)
- you will need to make sure that
browser.cache.disk.enable is set to
true
(if not, double-click the 'Value' column, and it should change)
- set
browser.cache.disk.capacity to
64000
(we gave it 64 megabytes, remember?)
- right-click below the Preferences in the empty space and select New -> String
(this will pop-up a "New string value" dialog to create a new key/value pair of preferences)
- for Preference Name enter
browser.cache.disk.parent_directory and click OK
(this creates the new Preference and will pop-up a new dialog asking for the value of browser.cache.parent_directory)
- enter
/opt/cache for the location of the new cache and click OK
- restart Firefox
You should be able to open a Terminal and enter the command
df -h to see the new filesystem and it's size. Browse with Firefox and run the command again; you should see the used portion of the /opt/cache folder start to fill up. When you reboot the Mini, this directory should be empty again (as it is initialized from RAM on each boot).
Hope this doesn't intimidate anyone. :ugeek:
Edit: Since posting, I've performed the secure cache on my personal Mini. All's well, except the System Monitor doesn't show tmpfs file-systems by default. pete7919 noted it in a post below, so I've changed this one to reflect it. Pete got it going by telling System Monitor to show *all* filesystems...
-pax-