Thursday, October 16, 2014

Create a small RAM disk for ultra fast I/O

In this simple guide I will explain how to create a virtual ram disk based on ext3 file system to be used for very fast I/O.

This example is very useful though it has important limitations, for example:



  • It does not allow big ram drives, as far as I know, the limit is 64 MB
  • Whatever is stored in the ram drive, is destroyed as soon as your system is restarted



In this example, we create a ram drive of 64 MB, we mount and set permissions so that your current user is the owner of the newly created file system.

Step 1: create the new file system, based on memory:

sudo mkfs -t ext3 -q /dev/ram1 65536

As you can see, the disk size is 64 MB, we use as device the /dev/ram1 (you can use by default up to ram15) and the file system used is ext3.



Step 2: Create the directory to be used to mount the new file system

sudo mkdir -p /ramdrive


Step3: Mount the file system

sudo mount /dev/ram1 /ramdrive -o defaults,rw



Step4: take the ownership of the new file system

sudo chown [USERNAME] /ramdrive -R



Replace the [USERNAME] part with your actual user name.....if you don't know who you are, try to check it with the whoami command.


This article, very simple, has a lot of limitations due to the small size of the disks you can create.
Planning to write an article on how to create bigger volumes with  tmpfs.

Side Note: Nowadays, using a 64bit OS, having a lot of RAM on your PC allows you to create quite big ram drives having incredible performances during read/write operations, sometimes it is useful to leverage on this to have ultra fast user experience.

Lenovo Thinkpad T410 and Ubuntu 12.10

(This article is rather old and was posted on another personal blog, I think it could help people anyway). Just as a side note, I stopped using Ubuntu since a while due to Unity. Now I work on Fedora 20 and Gnome 3, I love it.



 I have upgraded my laptop, a Lenovo T410 mounting integrated intel graphics, to Ubuntu 12.10.

As soon as the OS started I started getting errors on the xorg server about the drivers installed. The only option was to start the PC in low resolution. In addition to that many other problems were there like support for external monitors and so on.

Checking the ubuntu unity support utility the "Unity 3D supported"  was reported as No and the overall system performances were very bad.

I have luckily solved the problem in very long manner and therefore I want to write here what I have done to solve my problems hoping to help anyone having the same isse.

To start with, the drivers installed by UBUNTU (the gallium one) are not the right one, they doe their job but don't cover all the aspects of the system configuration.

To solve the issue I have done the following.



1. Install the required packages for the next steps:

Run in a terminal the following command:

 


sudo apt-get install build-essential libtool xutils-dev bison flex libx11-dev x11proto-gl-dev x11proto-dri2-dev libxext-dev libxdamage-dev libxdamage-dev libxfixes-dev libx11-xcb-dev libxcb-glx0-dev libxcb-dri2-0-dev libudev-dev libxcb-xfixes0-dev llvm-dev

This step is required in order to prepare the environment for the actual compile of the other components.



2. Go the intel OpenSource Technology website

https://01.org/linuxgraphics/downloads



3. In the download page, download the packages MESA, libdrm and xf86-video-intel - 2.20.12.

4. extract the content of the 3 files into separate directories.

5. Build and install of the libdrm package

 

    sudo ./configure
    sudo make
    sudo make install



6. Build and install the video intel (the 3rd package you downloaded)

 

    sudo ./configure
    sudo make
    sudo make install




7. Do the same for MESA (last one), it will take a very long time

 
   
    sudo ./configure
    sudo make
    sudo make install






8. Restart your ubuntu machine. At this point, going into the system settings/details applet of your ubuntu client you will notice that ubuntu will use a new driver (and you should notice the new look and feel too!)

If everything is OK, you should have something like this: