My Dell Mini Forum

Go Back   MyDellMini > Operating Systems > Unix / Linux Forums > Ubuntu Netbook Remix
Reload this Page Ramdisk on Mini 9 with Ubuntu (Dell flavour)
Connect with Facebook
Reply
 
LinkBack (1) Thread Tools Display Modes
  (#1) Old
Junior Member
 
Posts: 20
Join Date: Jan 2009
Location: Northern England
Send a message via ICQ to niw_uk1964 Send a message via MSN to niw_uk1964
Default Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-13-2009, 03:21 PM

Has anyone implemented a ramdisk on the Mini 9 using Dell's Ubuntu?

I would like use one for my browser cache to speed things up and reduce wear and tear on the ssd.

TIA.


2 cylinders is enough, but 3 is a fine compromise
www.twpdracing.com
www.twpd.co.uk
Dell Mini-9, Runcore 32GB ssd, 2GB RAM, Ubuntu 8.10
Reply With Quote
  (#2) Old
Senior Member
 
Posts: 241
Join Date: Oct 2008
Location: Beaumont, TX US
Send a message via Yahoo to GerallK
Default Re: Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-13-2009, 05:27 PM

From any given distribution that supports tmpfs, you can add a line to your /etc/fstab resembling this for a RAM-based temporary filesystem:

none /tmp tmpfs size=1g,mode=1777 0 0

The mount point is the 2nd parameter, and the 4th set of parameters define the size of the filesystem created as well as its access mode... The mount program will understand 'm' for megabytes, and 'g' for gigabytes.

This mode is specifically for the /tmp directory of my Mini; if you want to do something more for Firefox's cache, you'll probably want to go with mode=0770 or the like. Read over the manual page for 'chmod' if you need more information about how the access mode is defined.

We might also want to move this topic down to the Ubuntu-specific forums - what do you think?


Obsidian Mini 9 > 2gb ram, 16gb ssd, bluetooth, 1.3mp webcam, us-intl kbd
Internal Mods > usb hub, 16gb flash drive, 8gb flash drive, added webcam, changed kbd
Software Mods > Dellbuntu 8.04.1 | Gentoo 2008.0
Reply With Quote
  (#3) Old
Junior Member
 
Posts: 20
Join Date: Jan 2009
Location: Northern England
Send a message via ICQ to niw_uk1964 Send a message via MSN to niw_uk1964
Default Re: Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-14-2009, 12:21 PM

Yeah, moving it would be fine.
Although I've messed around with Linux for a few years I am far from proficient with it and tend to hide from the command line...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?

I'll give it a whirl this weekend when I have enough time to rectify any damage I do to my system! :lol:

I'll backup first!

Thanks for the input so far. I have 2GB of RAM so I figured I've plenty of room for a ramdisk.


2 cylinders is enough, but 3 is a fine compromise
www.twpdracing.com
www.twpd.co.uk
Dell Mini-9, Runcore 32GB ssd, 2GB RAM, Ubuntu 8.10
Reply With Quote
  (#4) Old
Junior Member
 
Posts: 26
Join Date: Dec 2008
Default Re: Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-14-2009, 04:07 PM

On my mini 9 with default DEll ubuntu 8.04, there is already ramdisk mounted on /var/run
(you can check it with a df).
It is dynamic ram disk, it extend till you have enough RAM

so you can link what you want (you can use command ln -s in terminal or right click-create link)
Reply With Quote
  (#5) Old
Senior Member
 
Posts: 241
Join Date: Oct 2008
Location: Beaumont, TX US
Send a message via Yahoo to GerallK
Default Re: Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-14-2009, 07:02 PM

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-


Obsidian Mini 9 > 2gb ram, 16gb ssd, bluetooth, 1.3mp webcam, us-intl kbd
Internal Mods > usb hub, 16gb flash drive, 8gb flash drive, added webcam, changed kbd
Software Mods > Dellbuntu 8.04.1 | Gentoo 2008.0
Reply With Quote
  (#6) Old
Junior Member
 
Posts: 26
Join Date: Dec 2008
Default Re: Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-14-2009, 07:47 PM

I tested the ramdisk for firefox, the only thing you need to do is to put in about:config :
browser.cache.disk.parent_directory , type : string, = /var/lock

/var/lock is a user writable tmpfs directory created at boot time by the system.
(/var/run is no writable by user)

you can check with about:cache that it is working.
You will see in /var/lock a new directory : Cache.

But I didn't felt big difference on the usage ...

EDIT: do not forget to delete everything in your old cache ,
something like : ~/.mozilla/web browser/611380dd.default/Cache/
Reply With Quote
  (#7) Old
Senior Member
 
Posts: 241
Join Date: Oct 2008
Location: Beaumont, TX US
Send a message via Yahoo to GerallK
Default Re: Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-14-2009, 07:58 PM

Quote:
Originally Posted by jpph
/var/lock is a user writable tmpfs directory created at boot time by the system.
Good catch! My only concern about this would be filling up /var/lock and leaving no room for lockfiles... How big is /var/lock? Will it accomodate the 50mb (default cache size) that Firefox is set with?

If so, your method is a lot quicker - but mine ensures the sizes match and the area is secure for a given user.

Either way, this redirects cache to a tmpfs drive. Your SSD will not be written to constantly by Firefox.

Was this what you were looking for, niw_uk1964?


Obsidian Mini 9 > 2gb ram, 16gb ssd, bluetooth, 1.3mp webcam, us-intl kbd
Internal Mods > usb hub, 16gb flash drive, 8gb flash drive, added webcam, changed kbd
Software Mods > Dellbuntu 8.04.1 | Gentoo 2008.0
Reply With Quote
  (#8) Old
Junior Member
 
Posts: 26
Join Date: Dec 2008
Default Re: Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-14-2009, 08:09 PM

no problems, it is dynamic :
Code:
>dd if=/dev/zero of=/var/lock/foobar bs=1M count=400
400+0 records in
400+0 records out
419430400 bytes (419 MB) copied, 1.25483 s, 334 MB/s
it only uses what it needs!

so there is enough for 64MB of cache ...
Reply With Quote
  (#9) Old
Junior Member
 
Posts: 2
Join Date: Jan 2009
Default Re: Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-16-2009, 04:42 PM

Thanks. I followed the longer set of instructions and it worked fine. The only hiccup I had as a complete Linux noob was this:

"You can look at the size of the new tmpfs area by going to System -> Administration -> System Monitor -> File Systems. Keep the Monitor open, and start browsing. You'll see it start filling up..."


In the system monitor I had to go into Edit>Preferences>File Systems and check the box "Show All File sytems" in order to see it listed.

Thanks for the steb-by-step. This mini is my first Linux experience so I'm really just getting started.

Pete
Reply With Quote
  (#10) Old
Senior Member
 
Posts: 241
Join Date: Oct 2008
Location: Beaumont, TX US
Send a message via Yahoo to GerallK
Default Re: Ramdisk on Mini 9 with Ubuntu (Dell flavour) - 01-16-2009, 06:45 PM

Quote:
Originally Posted by pete7919
In the system monitor I had to go into Edit>Preferences>File Systems and check the box "Show All File sytems" in order to see it listed.
I'm sorry about that...

I'll make an edit in the previous post to reflect the fact you have to enable tmpfs to be seen there. I wrote the how-to while away from my Mini (and I was pretty sure there was a way to see all of the filesystems anyway).

You could also use the command-line:

df -h

Which will list the various filesystems attached to your root device and how much are used on each.

Welcome to the forums, pete7919! Let us know how your Mini experience goes.


Obsidian Mini 9 > 2gb ram, 16gb ssd, bluetooth, 1.3mp webcam, us-intl kbd
Internal Mods > usb hub, 16gb flash drive, 8gb flash drive, added webcam, changed kbd
Software Mods > Dellbuntu 8.04.1 | Gentoo 2008.0
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://www.mydellmini.com/forum/ubuntu-netbook-remix/2435-ramdisk-mini-9-ubuntu-dell-flavour.html
Posted By For Type Date
arod0405 - Bookmarks | Diigo This thread Refback 05-16-2009 02:17 PM

UMPC Topsites
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2
Copyright © 2008-2010 MyDellMini.com. Hosted on a CatN vCluster.