Linux on Compact Flash

Recently I bought an used odd Thinkpad X40 in Ebay, it has a French keyboard (ugh!) and a DIY touchscreen, Bluetooth but no WLAN. Since its hard disk was starting to fail I decided to try out and insert a Compact Flash as hard disk. I ordered a 8GB super fast x133 online, but this weekend I could not wait and since 4GB SanDisk's Ultra II were at 24€, I decided to try it now!
I already had a 1.8 inch IDE to compact flash adapter (bought earlier here), in hardware terms it is really plug and play! The BIOS and the computer think that they have a normal (although not hitachi) 4GB hard drive.

I managed to install Suse 10.3 and perform all the updates, it had to be a small install to fit in 4GB but enough to run the familiar KDE and OpenOffice. The installation goes slower than with the normal hard drive, but once you get to the Network update speed is about the same.
Then I edited the file /etc/fstab as according to this page.
Here's what I did:

vi /etc/fstab

Then edited the line with the line

xxxdisk-idxxxxx / ext3 relatime,errors=remount-ro 0 1

adding the noatime option. Normally every time you read a file, the time is written back to the drive. The noatime option disables this.

xxxdisk-idxxxxx / ext3 relatime,errors=remount-ro 0 1

Then added the following lines. They move most temporary files to a ram disk.

tmpfs /tmp tmpfs defaults,noatime 0 0
tmpfs /var/run tmpfs defaults,noatime 0 0
tmpfs /var/log tmpfs defaults,noatime 0 0
tmpfs /var/lock tmpfs defaults,noatime 0 0
tmpfs /var/tmp tmpfs defaults,noatime 0 0
tmpfs /var/lib/dhcp3 tmpfs defaults,noatime 0 0

I did not write the line for Mozilla Firefox because I am not sure if Novell/Suse whatever have changed the temporary directory. Another site that looks like having good information is this one.
After the installation and configuration I tested the hard drives for read speed, and the Compact Flash does not come very far behind! But the big test is endurance rather than speed. Here are the screenshots, the top one reports on the current X40 (with magnetic hard drive), the bottom one the test on the compact flash and the listing of the /etc/fstab.

As SU you must run the command:
# hdparm -t /dev/sda1

Timing buffered disk reads: 56 MB in 3.08 seconds = 18.21 MB/sec
The CF disk reported 14 MB/s, which is 22% less... I still think it is not a big gap as with a bigger investment €€€ one could get better transfer rates (there are 8GB cards on the market advertising 30MB/s and more).

I think a good idea would be to have a mixed system on the same card, a compact flash on one side and a 1Gb dram on the other (for temp files, var, log, etc). One of the adapters that I found has a second connector on the back of the card, maybe it could be used with a small microcontroller, FPGA or CPLD to connect to a cheap SDRAM and provide a second volatile disk for all the changing data.

No comments: