Productive Linux


 Subscribe via Feedburner in a reader

Enter your email address:

Delivered by FeedBurner


Don't have an account?
Sign up to
Forgot your password?

Installing Linux on a Thinkpad X40 with a CF Drive
8 April 2010 @ 12:17 BST
by root

The IBM ThinkPad X40 was one of the greatest lightweight ultra-portables of the time. They're aging now, but that only adds to their coolness.

One big disadvantage of the original X40 was that the hard drive bay only had enough room for a rare 1.8" Hitachi hard drive. This drive was slow. Replacements were always very expensive. Nowadays, they are unavailable. Occasionally, it is possible to find flash-based disks that fit into that X40 hard drive slot. Unfortunately, these are also very expensive - putting one into an old computer seems nonsensical.

The X40 in my possession had a completely wrecked hard disk. Replacing the hard drive either with an original Hitachi 1.8" drive or a flash-based drive was out of the question. Fortunately, there is an alternative.

This is to use a bog-standard compact flash card and a compact flash-to-IDE adapter. These two items are small enough to fit into the X40's hard drive slot. For the adapter, there are a number of options, however, the consensus on the Internet is that the safest bet is the Addonics AD44MIDE2CF. It is not the cheapest and, it is not that easy to source, but it works.

The second part of the solution is to find a suitable compact flash card. People wanting to install Windows have a problem with some cards, but it seems that Linux works on anything. I decided on a Pretec 32GB 233x, on the basis that it seemed a sensible price/performance ratio for something I didn't know 100% would work!

The CF card slips easily into the adapter. However, insuring the adapter sits properly in the drive bay is far from easy. It it is simply crucial to ensure the pins line up and the adapter is pushed right in.

The only way I could make sure was to unscrew part of the cover, push the adapter in trying to make sure that the pins lined up correctly and then then slotting the CF card into the adapter.

If when booting, the hard drive isn't recognised it's probably because the adapter isn't sitting properly in the drive bay.

If you can't power on the X40, then it will be because the pins of the adapter aren't lined up. If you can power on the X40, and the LED on the adapter is on continuously, you haven't got the pins properly aligned.

Booting a X40 with no Hard Drive and installing

These days, the usual way to boot a computer with no OS is to use a bootable CD-ROM drive. Like a netbook, the X40 has no built-in CD-ROM drive. Luckily, however, the BIOS was advanced enough that it can boot off a USB stick.

I used unetbootin to install various bootable versions of Linux onto a USB stick. DamnSmallLinux worked like a dream. I also tried Arch, however, for some reason the installer would not set the network up properly, even when I dropped into the shell and manually configured the network interface with ifconfig. These seems to be something to do with the way that dhcpcd works, but I didn't explore this further.

The Debian Netinstall image, though, worked like a dream. At this stage followed the usual Debian install process and chose the desktop and notebook options for the installer.

This part was extremely easy.


Works fine.


Works out of the box.


Different X40s, seem to have different Wifi chips. This X40, 2371-6JG, has an Intel Pro 2100. The 'ipw2100' module that is needed to run this is compiled into the default Debian kernel. However, it also requires proprietary firmware.

The firmware is available here. When you have downloaded it, untar it and drop the files into /lib/firmware/. It then works.

Linux tuning the CF card

Following advice I tuned the X40 to for better performance.

  • Don't write access times to disk, by adding this to /etc/fstab:

/dev/hda1 / ext3 errors=remount-ro,noatime 0 1

  • Increase writeback time by adding this /etc/rc.local:

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

  • Comment out the swap line from /etc/fstab.


If you like to tinker and have a X40 on hand I can recommend using a CF card and an adapter to replace a toasted hard drive. The X40 now boots and runs faster than it ever did, but then this is the first time it has Linux installed on it.

I have one, too. Mine came without hard disk, and the Compact Flash method is really the best choice here.

You can actually use quite cheap adapters ("V.B1"). I bought one from ebay for 3 USD. Delivery takes time however.

If you want to fine tune your Linux setup, try using a root partition with BTRFS and COMPRESSION. Gives twice the space and a SUBSTANTIAL speed increase on any SSD. (Very useful if you buy a smaller and less expensive CF card, with just 2 to 8 GB.) All current Linux kernels support btrfs, it works well, it's just that you have extra effort to set it up manually. It's really worth it, however.

So really, before you buy a netbook, look if you can find a cheap X40 or X41. (The X30 is similar and almost as fast, but often lacks WiFi.)

Posted by mario on 2010-04-09 15:43:56.

that's what I'm going to be doing with the next Ubuntu release I have an older 12" Dell X1 and the old mobile celeron runs better than the new atom netbooks. I'm swapping the drives to see if I can get better battery life and cool it down a bit

Posted by dan on 2010-04-09 15:48:57.

Thank you for sharing your experience & knowledge about IBM X40.

My X20 is running Ubuntu 9.04. These lightweight machines are a credit to the company & the industry.

Posted by jorma on 2010-04-12 09:31:21.

Last year I bought a used ThinkPad X40 to use as a lightweight alternative to my heavy MacBook Pro. One of the best investments I've ever made, I LOVE this machine! And as Mario said here, the keyboard is so much better than a netbook, even if Dave Winer shot me down in flames for suggesting so on ;).

The original 40GB HDD still works in mine, but I'm intrigued about what performance improvement I'd get from using a CF card and a ZIF-CF adaptor. The general responsiveness of FreeBSD and Fedora are both fine, but booting is a bit slow and initial booting takes a while.

Thanks for your post, I'll be checking this out :)

Posted by Ruben on 2010-05-30 14:30:02.

After the hdd on my X40 started to die I installed a 8GB 600X transcend CF card using a addonics ide2cf adapter. (Together about €85 including S&H) I found that the ubuntu desktop and alternative iso installers gave a problem with the graphics card, so I used a dedicated iso with custom kernel module for the Intel 855GM graphics card that I found here: (german only)

Now boot time from pressing the power on button until the login screen takes less than 30 seconds and after logon less than 10 seconds. Hdparm reports 69.5MB/s read speed. All in all a huge improvement, the machine's responsiveness and program startup speed also increased. Gimp startup for example is really fast now as well as firefox.

For now the 8GB card provides sufficient space for browsing and reading email etc. Later I can always add a second cf card because I bought the 2 channel ide2cf adapter.

Posted by martin on 2010-06-09 12:21:49.

Erratum: it should read 85 EUROs in my previous post.

Posted by martin on 2010-06-09 12:23:18.

firmware in Debian: Add non-free to your sources list and:

apt-get update && apt-get install firmware-ipw2x00

Posted by ShaineT on 2010-08-11 10:45:23.

I forgot to say; 'Thanks for this awesome CF drive tutorial', I'll use it if my HDD dies :-)

Posted by ShaineT on 2010-08-11 10:47:46.
Comments disabled