Skip to main content

Posts about hardware

Linux on a new Thinkpad T510

I got a new Thinkpad T510 at work to replace my aging MacBook Pro. I asked for a Thinkpad instead of another MacBook because I wanted hardware with better hardware support, in particular the trackpad. I got into the habit of bringing a USB mouse everywhere I went because the trackpad on the MacBook was so unreliable on linux. So when my new T510 arrived, I was pretty excited. And, except for one tiny problem (of the PEBKAC kind), transferring all my files from the old machine to the new one went flawlessly. Here's how I set up the new machine:

  • Download image from sysresccd.org. Follow the instructions to make a bootable USB drive.
  • Boot up computer off USB drive. Resize the existing NTFS partition to be really small. Add 2 new partitions in the new-free space: one for the boot partition for linux, and one to be encrypted and be formatted with lvm.
  • Format boot partition as ext3. Setup encrypted partition with 'cryptsetup luksFormat /dev/sda6; cryptsetup luksOpen /dev/sda6 crypt_sda6'. Setup LVM with 'pvcreate /dev/mapper/crypt_sda6'. Setup two volumes, one for swap, and one for the root partition.
  • Connect network cable between old laptop and new one. Configure local network.
  • Copy files from old /boot to new /boot.
  • Copy files from old / to new /. Here's where I messed up. My command was: 'rsync -aPxX 192.168.2.1:/ /target/'.
  • Install grub.
  • Reboot!
At this point the machine came up ok, but wasn't prompting to decrypt my root drive, and so I had to do some manual steps to get the root drive to mount initially. Fixing up /etc/crypttab and the initramfs solved this. However even after this I was having some problems. I couldn't connect to wireless networks with Network Manager. I couldn't run gnome-power-manager. Files in /var/lib/mysql were owned by ntp! Then I realized that my initial rsync had copied over files preserving the user/group names, not the uid/gid values. And since I wasn't booting off a Debian image, the id/name mappings were quite different. Re-running rsync with '--numeric-ids' got all the ownerships fixed up. After the next reboot things were working flawlessly. Now after a few weeks of using it, I'm enjoying it a lot more than my MacBook Pro. It boots up faster. It connects to wireless networks faster. It suspends/unsuspends faster. It's got real, live, page-up/page-down keys! The trackpad actually works!

Got my wireless working in Linux 2.6.24

I previously posted that I had problems getting my wireless device working with the new 2.6.24 kernel, running into a kernel oops in the process. In kernels prior to 2.6.24 I used the bcm43xx driver, and let NetworkManager handle connecting to wireless networks. I've since had some time to play around with 2.6.24 a bit more, and I'm happy to say wireless is working now! Here's what I did: - Install b43-fwcutter - Add b43 to /etc/modules - Add ', ATTR{type}="1"' after the MAC address to the line in /etc/udev/rules.d/z25_persistent-net.rules that contains your wireless device. This ensures that udev will assign the same interface name to the wireless device as it had before, which means you don't have to reconfigure your firewall!

OpenWRT to the rescue!

Last night I thought I bricked my old Linksys WRT54G wireless router. I wanted to see if the latest firmware would resolve some problems I had with my wireless connection being dropped. After the firmware upgrade, I didn't have the dropped connection problem any more...I had a new problem - I couldn't connect to the router at all! No wireless access, no LAN access. The most I could do was ping it. I decided to check out OpenWRT to see if my hardware was supported, and how one was supposed to go about flashing new firmware onto the router. Luckily the TFTP method worked, and now I'm back up and running! Maybe it's my imagination, but it seems like the connection is faster now...

Dear Lazy Web, what kind of disc is in my drive?

Dear Lazy Web, How do you identify the type of CD/DVD inserted into a CDR/RW/DVD+-RW drive in Linux? dvd+rw-mediainfo does a great job with DVDs, but is there anything equivalent for CDs? Or better yet, a single tool that tells you all you need to know about a disc in the drive? Hope to hear from you soon, Chris

Quest for the Perfect Storage Solution!

I spent a little bit of time today looking into some of the storage solution choices out there.  I was mainly concerned with systems supported under Linux, but I didn't limit myself to just those.

My quest started this morning when I read a post on Gizmodo: Buffalo DriveStation: Serial ATA, Fanless Design. I had heard of Buffalo Technology before, I've often considered buying one of their products, or something like it.  What could be better than a 2 Terabyte box that you just plug into your network and configure?  Well...The Perfect Storage Solution of course!

A few simple use cases may describe what I'm looking for.  First, if a drive fails, I want to be able to replace it with no downtime, loss of data, and using any drive of sufficient size (at least as large as the one that failed) that I have on hand.  Second, if I'm running out of free space, I want to be able to add a brand new drive and start using it.  Third, if there is no more physical room for a new drive, I want to be able to migrate data off of the one of the drives (probably the smallest/oldest one), to make room for a newer, larger drive.  I suppose this is a direct consequence of satisfaction of the first requirement.

Out of these simple cases, I can distill a few must-have features:

  • Scalable! I should be able to add more space to this thing with a minimum of hassle.  I consider having to unmount a filesystem, grow the partition, then grow the filesystem a hassle.  I also consider having to get drives of exactly the same size as the drives already in there a hassle too.  I want to add more space, not replace the space I have!  LVM comes close to achieving this.
  • Fault tolerant: The Perfect Storage Solution should be able to handle at least one of the drives failing.  Better would be the ability to handle n drive failures.  RAID-5/RAID-6 work well here, but fail the scalability requirement.
  • Cheap!  I shouldn't need proprietary hardware/software for this.  I should just be able to add another drive to my enclosure and start using the space.  Or at the worst, buy another enclosure and add the new drive to the new enclosure :)
Some other nice features would be things like:
  • Snapshot support: great for backups, or when doing some kinds of admin work.
  • Very large filesystem support.  It's very easy to get more than a few terabytes of data (legitimately!) these days :)
And as long as I'm writing a wish list:
  • Transparent compression
  • Transparent encryption
  • Clustering (create one big pool of storage from drives scattered over a network)
So what's wrong with the devices like the one above?  Basically they don't scale well.  There's no nice way to integrate these things into one big pool of disk space.  You need to mess around with mount points, and put symlinks all over the place...unless you use LVM.

What's wrong with LVM?  It's not fault tolerant.  Sure, you can run LVM on top of a bunch of RAID devices.  But that means to add more storage in a fault tolerant way, you need to add a whole new RAID array since it's not really possible (as far as I know, somebody please correct me on this if I'm wrong!) to add a single drive into an existing RAID array.

Wikipedia's RAID page mentions the idea of a "write hole", and refers the reader to Jeff Bonwick's post on RAID-Z. The concept of the "write hole" does make some sense to me; basically if the drives lose power or crash while writing the parity data, then the data blocks and parity blocks may be inconsistent. It's not clear to me how RAID-Z solves this, and why you can't check those blocks when you restore power (especially when using some kind of journaled filesystem...although I suppose that the journal's parity data may have been corrupted as well!), but certainly data integrity is an issue that the Perfect Storage Solution must address!

I thought Sun's ZFS was promising for a little while.  But it seems that it doesn't handle drives of different sizes any better than RAID-5/6 does.  It's also unlikely that it will ever be available to Linux users because of licensing issues.

It certainly seems like LVM is the closest to what I'm looking for.  If only it managed parity data across physical blocks!  Then just polish up the ext3 online resizing functionality and life would be great!  Or maybe reiserfs/jfs/xfs would work better for a resizable filesystem?

Technorati Tags: , , ,

Printing in Linux?

This post on Christopher Blizzard's blog gives me some hope of improved printing on linux. While my new Epson CX4200 seems to work well for text, there are still some niggling issues like printing beyond the paper area, or clipping around margins, that make me worried about trying to print photos under linux. It also makes me think I should change my blog's theme to distinguish it from the other million default wordpress installations out there :)

Epson CX4200 gets my two thumbs up

I've written before about my experiences with printing under Linux...Initial frustration, brief elation, and then final disappointment while attempting to set up my Lexmark Z42. Eventually I gave up and either printed everything at work, or from my wife's laptop. A recent sales flyer from a local computer store, combined with some mail-in-rebate programs by the manufacturors convinced me that the time had come to try another printer. My in-laws purchased an all-in-one multifunction printer / scanner / copier last year and were very happy with it, and actually made good use of the copying functionality of the machine. So the question was, which model would I buy? I knew for sure that I wouldn't get Lexmark after my horrible experience with the Z42 last time. My instinct was justified after reading linuxprinting.org's page on suggested printers for free software users:

There are few good free software drivers for Canon and Lexmark inkjets. Do not buy one and expect success.
The same page recommended either an Epson or HP printer, and as there was a sale on Epson printers I decided to go with Epson. Now, which model to get? It really came down to the choice between the Epson CX4200 and the Epson CX4800. The CX4800 has the ability to put in a memory card and print directly from the card. However, since I don't expect to be printing pictures at home at all, this feature really isn't necessary for me. CX4200 it is then! Setting up this printer was a snap in Linux. Actually even easier than setting it up in Windows, which is a nice change! I simply used the Gnome CUPS Manager to add a new printer, and selected mine from the list. I already had the Gutenprint v5 drivers installed, so I guess that's where a lot of the credit for ease of installation is due. Setting up scanning was a bit trickier. I had to manually edit some of the sane configuration files, and there seemed to be an issue where the printer module would claim exclusive access to the usb device, preventing the scanner module from working. This is apparently fixed in later versions of the drivers, but I haven't had a chance to test it out. The CX4200's print quality is good for what I use it for, which is mostly just printing out e-mails, directions, recipes and things of that sort which would be time consuming to copy to paper by hand. The standalone copying functionality is very handy, I've used it quite a bit so far. Almost as much as printing from my computer! So far I'm very happy with the CX4200, and at $70 (CAD) after a mail-in-rebate, the price can't be beat.