Converting an IBM X40 to Flash
You may have heard something about Solid State Drives (SSDs), such as the one available as an option for Apple's MacBook Air. You can think of this project as sort of a poor-man's version of these products.
While most CF drives are relatively small and expensive, there are a few products that seem to sacrifice speed for capacity. This may seem sub-optimal, but the drive it will be replacing is astonishingly slow to begin with. According to hdparm, it can do buffered reads at 18 MB/sec, but in practice that seems pretty optimistic.
If I understand correctly, the Compact Flash interconnect standard is basically a subset of IDE. So, you just need a little passive adapter board, and you can plug a CF card directly into an IDE port. I used a D44MIDECF adapter card from Addonics. At $20, it's a little overpriced. There are no active components, and the board contains only the CF plug, the 44 pin IDE pinout, a jumper, a surface mount resistor, a surface mount capacitor, and a surface mount LED. On the other hand, it is something of a specialty part, so I suppose I should be happy that they bothered to sell it to me at all. For the CF card, I found this monster on NewEgg.
The X40 doesn't have removable media (other than the SD/MMC reader). I've always hated fiddling around with boot floppies and installers anyway. Supposedly, Debian has gotten their installer in better shape since I last played with it. That was more than five years ago. I just skipped that whole process, and built out a minimal Debian install by hand. I popped the CF disk into my SanDisk USB Flash reader, and did the following :
sudo fdisk /dev/sdc # created a 31 GB primary partition tagged as Linux [id 83] # and a 1 GB primary partition tagged as Linux Swap [id 82] sudo mkfs.ext3 /dev/sdc1 sudo mkswap /dev/sdc2 sudo mount /dev/sdc1 /mnt/flash sudo debootstrap sid /mnt/flash/ http://linux.csua.berkeley.edu/debian sudo chroot /mnt/flash vi /etc/apt/sources.list apt-get update apt-get dist-upgrade apt-get install linux-image-2.6.24-1-686 grub sudo mkdir /boot/grub update-grub vim /boot/grub/menu.lst exit sudo grub-install --root-directory=/mnt/flash --recheck /dev/sdcThen, pop the CF card in its little adapter board into the drive bay, and boot. Hooray! Here is how hdparm identifies the CF disk :
/dev/hda:
Model=, FwRev=20070912, SerialNo=CF CARD 000040D9
Config={ HardSect NotMFM Fixed DTR>10Mbs }
RawCHS=16383/15/63, TrkSize=0, SectSize=576, ECCbytes=4
BuffType=DualPort, BuffSize=1kB, MaxMultSect=1, MultSect=off
CurCHS=16383/15/63, CurSects=15481935, LBA=yes, LBAsects=63438848
IORDY=no, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 *mdma2
AdvancedPM=no
* signifies the current active mode
The default IDE settings for the CF drive result in very slow performance, so some tuning is in order. I edited /etc/hdparm.conf accordingly :
/dev/hda {
write_cache = on
io32_support = 3
dma = on
lookahead = on
interrupt_unmask = on
}
Here is the output of the script :
Setting parameters of disc: /dev/hda: setting 32-bit IO_support flag to 3 setting unmaskirq to 1 (on) setting using_dma to 1 (on) setting drive read-lookahead to 1 (on) setting drive write-caching to 1 (on) IO_support = 3 (32-bit w/sync) unmaskirq = 1 (on) using_dma = 1 (on) look-ahead = not supported write-caching = not supported /dev/hda.The result is actually a little faster than the Hitachi hard drive :
sudo hdparm -Tt /dev/hda /dev/hda: Timing cached reads: 1474 MB in 2.00 seconds = 737.30 MB/sec Timing buffered disk reads: 44 MB in 3.13 seconds = 14.06 MB/secSo far, I'm pretty happy.
Good to know that at least the X40 does not force you to use proprietory IBM 1.8'' drives with the stupid error 2010. I ALMOST bought a X41 two days ago.
BTW, Aren't you afraid of tearing up that CF card by using ext3's journaling, swapping, the normal logging writes, and not using noatime on /etc/fstab and ? A regular CF should only take about 10.000 write cycles. A current SSD will take 1 million.
I use a similar type of CF card for the boot volumes in my Soekris boxes. They've each been running for about three years without complaint, and I didn't bother to take any special measures to reduce wear-and-tear on the Flash chips.
Out of curiocity, I've actually deliberately tried to wear out the smaller CF card that serves as the boot disk for my router / Asterisk host. It's been getting hammered on for 18 months now, and I haven't seen any evidence of damage.
I think that the write-cycle burn out for Flash must be a bit of an urban ledgend, or at least exaggerated. Maybe newer Flash chips are just more durable, or something. In any event, my experience is that CF cards last at least as long as hard drives under similar loads. My two CF cards obviously don't constitute a statistically significant sample, so maybe I just got lucky.
That's good to know! I might try that, too in the near future.
BTW, I take it you got rid of that annoying noise by using the CF card. But can I ask if you have noticed less heat is produced now? Any significant improvements regarding battery live?
Thanks!
The heat reduction is pretty significant. I noitce that the fan almost never switches on now. I think the CPU and the drive bay share the same heat spreader in the X40.
There are two possible reasons for the decreased fan operation. It could be credited to less heat production, or it could be because now that the drive bay is mostly empty, it is effectively an extra radiation/convection surface for dissipating the CPU's heat.
I have definitely noticed an increase in battery life -- maybe as much as 30%. I don't have measurements for it yet. This is a very well-used laptop, so obviously the battery is not in great condition.
Thanks for taking the time to respond.
Seems like you have just revamped your notebook at a decent price. And sorted out a couple of issues at the same time.
All the best.
No trouble!
I remember just enough Spanish to sort of follow your blog -- it's been almost ten years since I've used it! Do you have an Eee PC yourself?
Aren't most CF cards actually hard drives, not solid state flash? And I don't think hdparam is a very reliable speed test, try bonnie++
Jamie
Remember 100000 Flash Cycles and you CF is history.
Regards
That's cool! Nothing I'm in any rush to do on my laptop (it's my most powerful/fastest machine right now and serves as a test bed), but tempting for my tower! Thanks to NFS, it's not like I'd need any more space.
Also, @Frames:
A few years back, IBM sold its hard disk drive division to Hitachi. So the 1.8" Hitachi drive in Russel's X40 is probably identical to the 1.8" IBM drive in the X41 you were looking at.
err jamie no a cf card is solid state are you thinking of the microdrive? thats a hard disk
The link you gave to the Addonics D44MIDECF adapter card now points to a 2.5" device. The name is still the same -- but is this the same device as you used? Or did they dump the 1.8" version?
re Gene above, I am also unsure regarding 1.8" or 2.5". Will the the 2.5" adapter fit into the X40 or should I be looking for a 1.8" adapter?
thanks! i got the 32gb CF and will put it in my CF card adaptor in the PCMCIA port. the external hard drive is too annoying to bring around and i need more space. found this site when googling how to replace hard drive, but will add on with the CF card instead.
Ebay offers the adapter for USD 1,99.
Search for:
CF as 44-pin 1.8" IDE Lenovo IBM X40 X41 HDD Adapter.
Any experience with Windows XP ?
it is really irritating that when reading comments looking for more information about a topic I read comments that are essentially advertising products or services for sale. I warrant that I will never spend money with persons or companies that commit such acts regardless if such products are 100% brand new or even .05% new (is that possible?, yes I'm sure it is)
True
Hi,
I've recently modded my X40 with a CF-44pin adapter.
It's this one here: http://allegro.pl/item466614417_przejsciowka_ata_kazde_cf_i_microdrive.html
I put in a Pretec x233 16GB flash card, installed Ubuntu, works ok.
I have issues when trying to use hdparm however:
sudo hdparm -f -c3 /dev/sda
/dev/sda:
setting 32-bit IO_support flag to 3
HDIO_SET_32BIT failed: Invalid argument
IO_support = 0 (default)
Seeing what comes out of /dev/sda when looking at it:
sudo hdparm /dev/sda
/dev/sda:
IO_support = 0 (default)
readonly = 0 (off)
readahead = 256 (on)
geometry = 1949/255/63, sectors = 31326208, start = 0
I'd suppose it should work real slow.
However, that is not the case:
sudo hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 862 MB in 2.00 seconds = 430.19 MB/sec
Timing buffered disk reads: 108 MB in 3.03 seconds = 35.64 MB/sec
It would all be peachy, however, my x40 seems sometimes very unresponsive, whenever (I think, since I have no hd led now) there is some disk activity going on.
From what hdparm shows, I don't know if DMA is enabled, however udma is definetly on (dmesg and hdparm -Ii say so).
What configuration tweak could I be missing?
Also, have you in any way managed to get the normal hd led (below the tft screen) working with the cf adapter?
If it involves any soldering, I guess I could manage.
I know the pinouts for 40-pin IDE (which is essentially the same as 44-pin IDE, but without the power), pin 39 is responsible for LED signaling - however, I do not know what exact value should it signal.
I know there is a led soldered onto my CF adapter, so maybe if I soldered a small wire from pin-39 to that led, more or less, I'd get the wanted effect?
Cheers,
lost customer --
Believe me, I agree! I've deleted the ad robot posts. If I've mistaken a comment by a real person for ad robot spam, I'm sorry. I'm not against off topic comments, but it is sometimes difficult to tell them apart from comment spam.
Gene & anthony --
The part linked in the original post is (still) exactly what I'm using now. The actual board is not 2.5 inches, and will fit in a 1.8" bay without difficulty.
I think the reference to 2.5" drives is simply there because 1.8" drives and 2.5" drives use the same connector, and the 2.5" form factor is much more common. They are talking about the type of connector, not the size of the board.
Matt J --
Huh. I'm not sure why your HD light isn't working. Mine works just as you'd expect it to. I know that there are some kernel hacks for controlling those LEDs, and maybe an ACPI driver. Possibly you have those enabled by accident?
I also get the halting during heavy activity problem. I think this is because you're not in DMA mode, and the disk activity is starving your machine for interrupts. If you have a high quality CF disk (like the San Disk Ultra Uber Super Duper XXICV Plutonium, or whatever), try building a small bootable linux image. Probably, you won't be able to use one of these as your main disk because they are expensive. See if you still get the halting effect.
It was recently brought to my attention that I could have bought the dual bay adapter that Adonics makes (for only two bucks more), and put two CF cards in there. Then, I could have used a high quality CF card for my boot volume, and kept data on a larger, slower CF card.
I'm kicking myself!
Yea, I'd think it should've "just worked" too, but it doesn't.
I don't know why exactly. I think it just passes the led data onto the on-soldered led, so there is no activity on pin-39.
As regards ACPI modules, no, I know there's acpi modules for it too, but it doesn't work that way afaik.
Besides, had it been an ACPI module issue, the led would work during startup :-)
Also, about the DMA issue... yea, I think it could be that, however hdparm suggests that DMA is enabled.
Oh well. We'll see. I guess there's some way of forcing DMA onto a device with the hd module.
Below's the link to the test performed on cf cards I found while googling for a cf ssd solution.
http://www.hjreggel.net/cardspeed/cs_udmacf.html
Those super duper sandisk cards don't seem to be the best anymore. Take a look for yourself.
Thanks Russel for that post !
I'll do that mod too on my X40 with a dual Addonics adapter and 2 CF :
- a Transcend 8 Gb x300 for the Os, Ubuntu (that card, by the way, supports S.M.A.R.T which is very cool to prevent failures)
- and a second Transcend 32 Gb x133 for my data.
Matt J,
I am also using a Pretec 233x 4gb card and was having 'this system is hanging' problems.
First I was using a slower card, Kingston 133x 8gb. This was awful. I upgraded to the faster Pretec card and the problem was less noticable.
The problem seemed worse with ubuntu 8.10 and less noticable with 8.04. It was the most noticable when using firefox3.
I have solved the problem by (i think) installing openbox and using openbox/gnome as my 'session'.
Also, made adjustments to /etc/fstab and /boot/grub/menu.lst which i'd found after searching for 'speed up ubuntu boot'.
Sir:
You are a prince among men.
For the record, I got a SanDisk Extreme III 16GB card and the Addonics dual-slot adapter, and it's BIZARRE. For the past 5 years I've been living with a noisy, clicky, dodgy laptop, and now it's eerily quiet and fast. It's almost unnerving!
-Dave
Could this be done with windows xp installed on it? would i just be able to run the cd or would i have to do special formatting of the disc?
Hi Russel,
I found this post from last year to be a useful reference while trying to duplicate your feat. However, I've run into some problems which I have posted about over at the Ubuntu forums. If you're not too busy I was hoping you could take a look:
http://ubuntuforums.org/showthread.php?t=1129173
I wondered if this mod can be used and still retain the hard drive cover with everything fitting inside!
Matt --
I don't see why it wouldn't, but of course, the installation process would work differently. I've been careful to avoid learning anything about Windows for about ten years now. The X40 doesn't have a CD-ROM drive, so you'll have to figure that out on your own. The nice thing about using the adapter board is that it appears to the hardware as a hard drive. So, no special drivers and whatnot.
MarkWilson --
Yep. That was the whole reason I did this in the first place. I couldn't find a replacement hard drive that would fit, but the CF card and adapter board fit just fine. I took the little plastic doodad off of the drive sled and used it by itself to seal the hard drive bay. You can't tell that it was modded.
Guys:
I just found out that there's a company that makes actual SSDs for the X40, in China. And I got one, and can give you a bit of a comparison between it and the SanDisk Extreme III CompactFlash card I've been using. First off, it's called a KingSpec SSD (KSD-PA18.1-032MJ) and it's made to fit the X40 perfectly. (its actually a bit thinner than the Hitachi, so it IS possible to miss a row of IDE pins if you're not careful). I got some stutters from my whole system with the SanDisk and the CF -> IDE adapter, but that does not happen with the KingSpec drive. It's smoother than the non-UDMA flash drives out there (I tried to get an Extreme IV UDMA card to work, but I couldnt get it to boot) AND it's recognized by Windows as a regular non-removable HDD, so you don't have to hack your way around it. Don't know about linux. So far, the thing is very fast and I've been very happy. Much nicer than the CF solutions. Oh and BTW, I got it off EBay. Hope this helps!
buy cialis online buy cialis 57025 http://khgzcsjg.com :b)) [url=http://khgzcsjg.com]buy cialis[/url] hmnp
generic cialis online generic cialis 35863 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 ;b:) [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] yxvlru
generic cialis online generic cialis 2 1457 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 (() [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] qflmep
generic cialis online generic cialis 106 108 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 ;(b [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] anefst
cialis online cialis 1057 http://www.livescribe.com/forums/member.php?u=6297 (o [url=http://www.livescribe.com/forums/member.php?u=6297]cialis[/url] ien q
cialis online online cialis online 21 153 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 (d [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis online[/url] lfsgi
cialis online cialis 5200 http://www.livescribe.com/forums/member.php?u=6297 (b:)o [url=http://www.livescribe.com/forums/member.php?u=6297]cialis[/url] d qxlkx
cialis online cialis 4026 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 ;(( [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis[/url] yoba q
buy cialis online buy cialis 583524 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 b): 8 [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]buy cialis[/url] iueoj
cialis online cialis 0204 17 http://www.livescribe.com/forums/member.php?u=6297 d)8 [url=http://www.livescribe.com/forums/member.php?u=6297]cialis[/url] bfdm
cialis online online cialis online 6524 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 :b)o [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis online[/url] osurfi
buy cialis online buy cialis 06590 http://www.livescribe.com/forums/member.php?u=6297 dd [url=http://www.livescribe.com/forums/member.php?u=6297]buy cialis[/url] rmunwd
cialis online online cialis online 936894 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 ;( [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis online[/url] bsmnso
generic cialis online generic cialis 45240 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 (d [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] xhgp
cheap cialis online cheap cialis 0075 http://www.livescribe.com/forums/member.php?u=6297 ;(:) [url=http://www.livescribe.com/forums/member.php?u=6297]cheap cialis[/url] emkns
buy cialis online buy cialis 84732 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 (: [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]buy cialis[/url] kzcw
generic cialis online generic cialis 8671 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 b) [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] wcka
generic cialis online generic cialis 25356 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 b;db [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] nczhfj
cialis online cialis 5523 http://www.livescribe.com/forums/member.php?u=6297 )()( [url=http://www.livescribe.com/forums/member.php?u=6297]cialis[/url] tkyscm
cialis online online cialis online 640502 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 (d [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis online[/url] mzyrho
buy cialis online buy cialis 304935 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 ))o( 8 [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]buy cialis[/url] tejcr
cialis online online cialis online 96037 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 ))8 [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis online[/url] puvbw
buy cialis online buy cialis 1864 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 )8;( [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]buy cialis[/url] rtieg
cheap cialis online cheap cialis 86899 http://www.livescribe.com/forums/member.php?u=6297 ;b( [url=http://www.livescribe.com/forums/member.php?u=6297]cheap cialis[/url] lkrcde
generic cialis online generic cialis 5007 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 od [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] vzyjex
generic cialis online generic cialis 021333 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 d)ob; [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] rps qph
buy cialis online buy cialis 15352 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 (;)( [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]buy cialis[/url] nktv
cialis online cialis 475348 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 o 8 [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis[/url] bwikms
buy cialis online buy cialis 788560 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 )o))( [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]buy cialis[/url] krbm
cialis online online cialis online 15987 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 )b [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis online[/url] nfzrxb
cialis online online cialis online 6 114 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 (b [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis online[/url] duflrg
generic cialis online generic cialis 3876 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 b:(o [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] ctbol
cialis online cialis 1876 http://www.livescribe.com/forums/member.php?u=6297 b(;d [url=http://www.livescribe.com/forums/member.php?u=6297]cialis[/url] boyon
cialis online online cialis online 09598 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 (; 8 [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis online[/url] zfhc
buy cialis online buy cialis 5392 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 ;)oo [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]buy cialis[/url] ouhfb
cialis online cialis 82678 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 bd:( [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis[/url] ntiosk
buy cialis online buy cialis 73628 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 ((b [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]buy cialis[/url] adww
generic cialis online generic cialis 95536 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 b() [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] komma
cialis online cialis 9074 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 ()dd [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis[/url] flokzh
generic cialis online generic cialis 3787 14 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 d)b [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]generic cialis[/url] akprv
cialis online online cialis online 7403 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 b)b [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis online[/url] umpvn
cialis online cialis 307188 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 )o(( [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]cialis[/url] xeyb
buy cialis online buy cialis 820799 http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432 (d(d [url=http://www.ieeeusa.org/careers/entrepreneurs/forum/member.php?u=432]buy cialis[/url] qntt
