Thursday, November 25, 2010

Another Thinkpad X61 Hard Drive Upgrade

After reading http://www.codinghorror.com/blog/2010/09/revisiting-solid-state-hard-drives.html, I did another hard drive upgrade on my Thinkpad X61 to the Seagate Momentus XT hybrid SSD drive. It's a little smaller than my last drive, but has enough space for my data. When I bought it it was $105 on newegg. In the few days since then it went up to $115 or maybe $130 and then back down to $100.

I'll spare you the suspense and say up front that it's much faster and seems well worth it. I did some rough measurements of speed on the old and new drives. I measured the time from power on to when the windows 7 login screen is visible, the time when the desktop icons are visible, and then click chrome as soon as I could and got the time when the chrome window appeared (before it showed any pages). These were done with a stopwatch and there will be a little variation based on how long it took me to type my password or click.

Ye Olde Drive:
Login screen 1:43
Desktop 2:53
Chrome 3:22

Yeah I know it's insanely slow to start up. Once it gets going it's plenty snappy. When I first installed windows it was much faster, but all the crap I've installed since then has bogged it down and I don't feel like spending the time reinstalling since I almost never restart.

Then I did the copy to the new disk. It involved shrinking the partition which may have affected the speeds. I booted up twice so it could install the new disk drivers, run scan disk, and get some stuff into the 4GB SSD portion of the disk. On the 3rd boot I measured:
Login screen: 1:13
Desktop 1:44
I didn't click chrome fast enough on this boot so I did it again:

Login screen: 0:57
Desktop 1:20
Chrome 1:29
Holy gajoly! I'm up and running in 44% of the time!

But the variation between the too runs was interesting so I did it once more:
Login screen 1:01
Desktop 1:30
Chrome 1:43
I got a little slower. I assume this has to do with what the disk decides to put in the SSD portion although I only made one baseline measurement on the old disk so I don't really know how much variation there is without that factor.

If you're interested in the details of how I did the copy this time, here they are:

  • Connected old and new drive to a linux machine (ubuntu).
  • Shrunk system partition on old disk so it would fit on new one using gparted.
  • Copied utility and system partitions to new disk. Grew system partition on new disk to use all available space.
  • Set utility partition as hidden and system partition as bootable.
  • Put new disk in laptop. The plugging in mechanics on the Thinkpad X61 don't work well. It probably took me 10 minutes of plugging in the disk, trying to boot, taking it out and adjusting something until the machine happily detected the disk.
  • Booted windows 7 install disk and clicked repair. It detected some boot settings needing fixing so I let it do that and restarted. The drive didn't boot yet.
  • Booted install disk again, went to repair, command prompt, and used bootrec /fixmbr and /fixboot (http://support.microsoft.com/kb/927392).
  • It booted! Windows had to install some drivers and reboot. On the next boot it did a full scan disk.
  • I don't seem to be able to boot the utility partition, but I pretty much never need it so I decided not to worry about that.

Tuesday, January 19, 2010

The Most Expensive Keyboard

I've tried a number of keyboards and keyboard setups to put less strain on my arms because of my RSI. My latest attempt is to take my Kinesis Advantage keyboard which I think has the best layout of any of the ones I've used, split it apart, and mount it on the super configurable base from the CK comfort keyboard. Here are some pictures of how it went. I've just started using it today and so far it seems to be working nicely. The kinesis keyboard was $160 refurbished and the comfort keyboard was $330. Plus the hours it took me to cut apart and solder the extension wires for the kinesis. But hey, being able to type enough is worth more than $500.


First I opened the Kinesis.

I added extensions to the 3 connections to the pcbs on one side. For the 2 that use flat flexible cable, Kinesis was awesome enough to send me some extra flat cable and the sockets so I built standalone extenders with a socket on each end and then connected them to the pcbs on either end using the short FFC cables. You can see this in the foreground. For the thumb buttons, I cut the jumper ribbon cable and soldered my extension cables straight to both sides. I used little pieces of insulation from thicker cable as sleeves that I covered the solder junctions with. Those are the yellow thing you see. I used heat shrink tubing to bundle the wires together. I mostly used very thin wire (don't know the gauge) but ran out before I was quite done so I used a bit of ribbon cable.

Here's what it looks like with the cable stretched out.

Next I dremeled apart the case.

This shows the two sides apart.

The comfort keyboard comes with 3 sections. I took one off because I only need 2. Then I unscrewed the bottoms of the 2 remaining sections from the comfort keyboard sections and screwed them into the bottom of the kinesis sections.

All done!

This is what my workstation looks like now.

Saturday, December 5, 2009

Proper Samba Sharing

I spent a huge amount of time trying to set up a samba share that was password protected and writable. It's amazing to me that such a basic use case isn't well supported using the gui and was so poorly documented. Ben was nice enough to listen to me rant about Ubuntu, Fedora, Gnome, FreeNas, Unetbootin, and more.

This is on Ubuntu 9.04 (Gnome).
  • Install samba, open firewall, etc.
  • sudo smbpasswd -a someuser to manually create the account for samba because automatic account sync with the system accounts didn't work.
  • net usershare info to show user shares (those created by non-root users; these are what gnome's nautilus creates).
  • net usershare add music /home/someuser/Music/ "" someuser:F
  • It may take a few seconds to take effect.
  • http://www.samba.org/samba/docs/man/manpages-3/net.8.html for more info on the net command.
Update Oct 25, 2011: You still need to create the samba user in Ubuntu 11.04.

Wednesday, January 28, 2009

Upgrading the hard drive on my Thinkpad X61

These directions ARE NOT a complete step by step tutorial for people who have no idea what's going on. They're a detailed enough account of what I did for someone with some decent computer knowledge to have a guide.

I wanted a bigger drive on my Thinkpad X61 (awesome machine by the way). The tricky thing is that the machine has a hard drive shock protection system which parks the hard drive head if it detects a physical shock to prevent damage to the disk and I wanted this feature to keep working with my new disk.

I did quite a bit of searching and it seems that for it to work, the new drive needed to support the UNLOAD feature of the IDLE IMMEDIATE ATA command. Shockingly enough, that just isn't one of the things that manufacturers put on the side of the box. I looked at a few drives. For one or two I found some mention of this on an obscure tech doc at some random location on their site (thanks google). I tried calling a couple of manufacturers, but couldn't usually get an answer to this question. One of them actually did contact their engineers in Taiwan and got back to me. Eventually I settled on a Fujitsu MHY2200BH. It's in the same or a similar series to the drive the machine came with, a MHW2080BH, and at the time seemed to be the best shot for supporting the head park feature. It's been a while, but I think that at the time I found a datasheet for that that said it supported UNLOAD. So I got it even though it wasn't the cheapest drive.

I don't have time to reinstall windows right now and set everything up again, so I just wanted to copy everything over from my existing installation. The machine also comes with a hidden partition at the beginning which I assume makes the easy diagnosis and reinstall tool (blue button at startup) work. I wanted that to keep working on the new disk too.

I put the new disk in an enclosure and connected it while windows was running. This might be necessary if windows needs to install drivers for the new disk.

Initially I tried copying the partitions with gparted. It hit an error so I used it to create empty partitions and tried to copy the data with ntfsclone. This copied ok, but the new disk wouldn't boot up. The gparted errors might be because (fdisk says) the original partitions don't end on cylinder boundaries. And I think the new partitions it created were slightly different because they did.

Next I tried using dd (while still booted to the gparted liveusb) to make an exact copy from the old disk to the new one. But partway through the copy, the disk in the external enclosure hit some kind of weirdness and disconnected. I suspect the enclosure was at fault because I had my original disk in there at the time and I know it works fine. Bad enclosure!

So I made an ubuntu 8.10 32-bit desktop live-usb using these directions although I expect you could use one of the easier ways. I booted it, enabled the universe repositories in /etc/apt/sources.list, and installed ddrescue (package is called gddrescue) which is like a souped up dd for data recovery. I think it allows resuming dd's, so my thought was that if the transfer failed again I could continue, but the transfer worked the first time so I didn't test this. I opened a terminal, left myself in my home directory which I think gets written to the flash drive, and ran it with "ddrescue /dev/sdc /dev/sda logfile". Again, at this point I had the new drive in the machine and the old one in the enclosure, but you may as well put the new disk in the enclosure until later. NOTE: Don't run that command without being very sure of what you're doing or you can delete your data. At the end, the new disk had exact copies of the old disks partitions and some free space at the end because it's bigger. And fdisk showed the new partitions not ending on cylinder boundaries just like the old one. Perfect.

Although I didn't do this until later, if you're swapping the disks now, you may as well switch the little metal tray attached to the old disk to the new one. You take off the two rubber things on the sides and there are 4 screws holding it on.

I disconnected the old disk, booted up the new one, and it worked perfectly.

I ran the active protection system tool and shook the machine a little bit. It said the head was getting parked and once I went to a quiet room, I heard the click I used to hear from the old drive when it parked the head. I also played a video and shook it again and sure enough, right after the utility said the head was parked, the video would freeze just like on my old disk.

Vista has a disk manager which can extend and shrink partitions. I extended my windows partition to use the rest of the disk. It took no time. Literally.

Finally, I rebooted and used the blue button to boot the diagnostic/reinstall tool. I didn't do too much with it, but it booted and launched the web browser so it seems to be fine.

Now I'm going to run a manual defrag from vista since my old disk has 200MB free and may have been pretty fragmented.

Life is good.

Tuesday, January 8, 2008

Creating a Bootable (memtest) Flash Drive from Windows Vista

I needed to create a bootable usb flash drive from vista to run memtest on my laptop with no cdrom drive. It took quite a while to get it working so I'm posting this in the hopes that it'll save someone else some time. I'm using 32 bit vista. Here's how I got it sorta working:
  • Get the hp flash drive formatting utility from http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&mode=3&taskId=135&swItem=MTX-UNITY-I23839.
  • Run the file and tell it just to extract.
  • Open up the new folder and run the installer in XP SP2 compatibility mode as an admin.
    • Right click on cpqsetup.exe and click on properties
    • Go to the compatibility tab
    • Check off "Run this program in compat..." and select Windows XP (Service Pack 2)
    • Check off "Run this program as an administrator"
    • Click Ok
    • Run (probably double click) cpqsetup.exe
  • Once it's installed, run the utility in Win 98 / ME compatibility mode as an admin.
    • Click start
    • All programs
    • HP System Tools
    • Right click on "HP Drive Key...", Properties
    • Same as above but for the compatibility mode select Windows 98 / Windows ME
    • Click Ok
    • Go back into the start menu and run the tool
  • On my machine it was realllly slow. It took about 20 minutes to format a 1 GB flash drive as a hard drive (which turned out not to be what I wanted anyway). And the utility seemed to stop responding throughout. But it did eventually finish.