Installing and Optimizing an SSD with Ubuntu Jaunty

written by bryan on March 23rd, 2009 @ 12:19 PM

With Anand's latest review of SSD's and Linus' endorsement of that review, it seemed like a good time to move my noisy hard drives to the basement and switch to an flash based hard drive (AKA solid state drive: SSD).

The 30GB Vertex SSD is currently CAD$ 160. Getting anything other than the smallest one seems very silly - I assume that prices are going to drop like a rock, so it'd be very painful to spend much more than that on anything that will be worthless in a year or two.

Luckily, Linux will fit very easily into 30GB. The plan is to put just about everything except for the operating system and work onto the NFS server in the basement.

The process did not go very smoothly at all. I highly recommend staying away from the Vertex drives for a few months to let them mature. But if you insist, here's the procedure I went through.

The first thing I had to do was upgrade my kernel to 2.6.29. The SSD worked for a little while, and then failed completely. It appeared to work on an Intel based machine, but my AMD 780G machine was not happy at all. I even went through the hassle of installing Windows XP to see if it worked there, but XP didn't even see the drive. Note that my other machine appeared to work fine with the SSD, so I think it's sort of SB700/SSD interaction. Others have reported issues on the forum as well.

The first thing you'll probably want to do is a secure erase of the drive. SSD's slow down as they're used, so starting fresh is essential. Warning, this will completely erase any ATA drive, so make sure you have that drive letter right!

hdparm --security-erase NULL /dev/sda

Following Ted Tso's instructions on how to properly align the partitions for maximum speed:

fdisk -H 224 -S 56 /dev/sda
# enter 'n, p, 1, 1, 5082' at the prompts to create a partition covering the entire drive
# enter 'x, b, 1, 256, w' to move the start of the partition into alignment
mke2fs -t ext4 -E stripe-width=32,resize=50G /dev/sda1
mkdir /mnt/ssd
mount /dev/sda1 /mnt/ssd

Now follow these instructions to copy your operating system over to the new drive. We're going to copy over everything except for /home/blarsen, which we're going to mount over NFS.

ls / > ~/root_files
vi ~/root_files  # remove proc, sys, mnt, home et cetera
tar --create --one-file-system --file - `cat ~/root_files` | (cd /mnt/ssd ; tar xvf -)
mkdir /mnt/ssd/proc
mkdir /mnt/ssd/sys
mkdir /mnt/ssd/mnt
mkdir -p /mnt/ssd/home/blarsen
chown blarsen.blarsen /mnt/ssd/home/blarsen

Let's set up our fstab to nfs mount /home/blarsen, and run tmpfs on /tmp and /var/tmp. The size parameter to tmpfs is a maximum size -- it doesn't use any RAM if it isn't needed. The default is half your RAM, so you'll probably want to limit down a bit.

cat > /mnt/ssd/etc/fstab
bulti:/home/blarsen     /home/blarsen           nfs             rsize=8192,wsize=8192,timeo=14,intr,noatime,nodiratime 0 0
none    /tmp            tmpfs     size=500M,mode=777,auto      0       0
none    /var/tmp        tmpfs   size=500M,mode=777,auto       0       0
^D

Change your root partition in fstab:

blkid # to determine the UUID
vi /mnt/ssd/etc/fstab

Now, update the grub menu.lst. These instructions are missing from the tech republic link above. You want to look for the kopt= and groot= option lines. They look like comment lines, but they are actually instructions to update-grub. While you're at it, add "elevator=deadline" to your kopt.

vi /mnt/ssd/boot/grub/menu.lst # update kopt, groot UUID's.  Also add elevator=deadline to kopt
chroot /mnt/ssd
update-grub
exit

And install grub on the new drive:

grub-install --root-directory=/mnt/ssd /dev/sda

Let's save our SSD by logging to our NFS server. See these instructions from Sun.

cat >> /mnt/ssd/etc/hosts
192.168.1.91 bulti loghost
^D
cat >  /mnt/ssd/etc/syslog.conf
*.*;            @loghost
*.err;*.emerg   /var/log/messages

On your loghost, edit /etc/default/syslogd to add the "-r" option and restart sysklogd.

Switch your network interface away from network-manager so it comes up earlier in your boot cycle:

cat >> /mnt/ssd/etc/network/interfaces
auto eth0
iface eth0 inet dhcp
^D

rsync your home directory to your NFS server.

rsync -av /home/blarsen/ bulti:/home/blarsen/  # those trailing slashes are important

Reboot and enjoy!

HDTV over the air

written by bryan on November 22nd, 2007 @ 03:27 PM

Bethany and I traveled to Toronto a couple of weeks ago. I was looking for a decent indoor TV antenna. Toronto has an excellent selection of HDTV channels available over the air, so I thought it would be easy to find a good antenna. In Toronto, all of the TV stations use the CN tower for broadcasting. Toronto also has a large number of tall buildings, which means lots of multipath interference. A unidirectional antenna pointed at the CN tower should provide excellent reception, avoiding most of the multipath that an omni directional antenna would pick up. In terms of indoor directional antennas, the model that everybody recommends is the Philips Silver Sensor, or one of the many clones.

I took a walk up Yonge street, but other than the Future Shop being moved, I didn’t find any electronics store. I got back to the Eaton Centre and checked out the Canadian Tire, The Source (nee Radio Shack) and the Best Buy. The huge Canadian Tire store had a very tiny electronics section, but both Best Buy and the Source do a good business selling HDTV’s. Neither of them had any TV antennas that work very well in Toronto, they were all omnidirectional, simple loops and rabbit ears, adding amplification, which may or may not help. Even worse, the few salespeople were clueless. I don’t blame the salespeople, their direction comes from management. At Best Buy there was a sign along the lines “HDTV’s only display in HDTV with programming from cable or satellite.” That’s almost criminal. There are 7 to 20 HDTV channels available in Toronto; people do not have to spend $50+ a month to receive HDTV. And the beauty of HDTV is, that if you receive it at all, reception is likely to be perfect.

The situation in Ottawa is much different. Only CBC is transmitting in HD, CBOT and CBOFT. Receiving HDTV programming from the United States may be possible with a large TV tower, but otherwise only the one channel is available. But that’s quite a bit. The Senators are doing well, and the Riders are about to win the Grey Cup. I ended up mail ordering the PHDTV3 from Dell.

The antenna is hooked to a Hauppage HVR-1800. It works for me, but I’d recommend the pcHDTV HD-5500. I’m running MythTV.

MythTV lets us watch TV at any computer in the house (there are quite a few of those). But Bethany likes to watch TV as background noise while she’s working, so we also have a Ziova CS-505 high-definition networked DVD player will also play content from the MythTV stream. The CS-505 is hooked up to an old LCD I had lying around through an HDMI-DVI adapter. The CS-505 is highly recommended.

Why you don't need WiFi on your phone

written by bryan on February 2nd, 2007 @ 08:01 PM

I own a Sharp Zaurus and a Palm Treo 650 along with a WiFi card for both. I never use WiFi. Here’s why.

There are several scenarios where you think it’ll be useful to have WiFi on your phone, either for e-mail, browsing or VoIP.

At Home or Work

Once the novelty wears off, you will realize that the computer in the corner is much better suited for internet and e-mail usage. If you want to curl up on the couch or wander the house doing chores while talking to your Mom via VoIP, add a $20 bluetooth dongle onto your computer, router or NSLU2 and use that instead; you’ll double your battery life.

At a Friend’s House

Most friends have computers they’ll let you borrow. Extensive surfing or VoIP’ing is antisocial, you won’t be taking advantage of that as much as you think you will.

Out on the street

By the time you find a free, open WiFi hotspot, your battery will be dead. GPRS is so much more reliable that once you hook it up, you’ll just end up using that instead.

On vacation

I spent two months in Europe and blogged every day for the entire trip using my Treo 650 and a bluetooth keyboard. I brought along the WiFi adaptor and never used it because it was such a pain to find and connect to a hot spot. Instead, I transferred articles from the Treo to computers in Internet Cafe’s via the SD card and a USB adaptor.

At a coffeeshop to work outside the office

A laptop is so much more usable that you’ll end up lugging the heavy thing to the coffeeshop rather than taking along just your phone.

Summary

WiFi is nice to have, but it shouldn’t significantly affect purchase decisions. Don’t ignore beautiful phones like the Neo1973 or Treos just because they don’t have WiFi.

Rogers dropping MSN messages?

written by bryan on February 1st, 2007 @ 09:35 PM

For the last month or so, communications between my fiancĂ©e and myself over MSN have been unreliable. It appeared that I received all of the messages that my fiancĂ©e sent, but she did not get a few of the messages I sent. This was very aggravating, because there was no notification that a problem occurred. She just thought that I wasn’t responding to her!

In the past I’ve had problems with dropped connections to various instant messaging servers. Those were annoying, but at least you knew about it. If the connection dropped, your client would tell you that the message could not be delivered.

I’ve tried a couple of different AIM clients to try and fix the problem. However, it turns out that both of them use libgaim as their back-end, so that is possibly the source of the problem.

However, there is also another potential source of the problem: my ISP, Rogers. Rogers is probably the largest Internet over Cable provider in Canada, and employs packet-shaping devices to silently drop encrypted bittorrent connections. To identify normal bittorrent packets, Rogers can use packet filters that identify the traffic as bittorrent with near 100% certainty. However, encrypted bittorrent traffic is much more difficult to identify; to a third party observer, the traffic is very similar to random noise. Other encrypted and/or compressed communications channels will seem very similar.

Certainly there are signatures that might identify it as encrypted bittorrent traffic, however it is much more like that “false positives” might occur, and the packet filters might start interfering with other services, such as my MSN. According to my dslreports thread, there may be others with the same problem.

I may be able to live without bittorrent; there are other ways of downloading ubuntu ISO’s. However, if I cannot be sure that other services I rely on are unaffected, I am forced to switch internet providers. I have begun this process; I highly recommend that all other customers of Rogers also do the same.

Options:

Size