Sunday, May 30, 2010

Return With Us Now to the Thrilling Days of Yesteryear

I'm not very good at doing disk backups.

OK, let's be honest: I'm terrible at doing disk backups. Oh, back in the day, every once in a while I'd copy as much of the disk as I could onto CDs or DVDs. But that takes a lot of time, and, as disks become larger while DVDs don't, requires a lot of picking and choosing to figure out what goes where.

To be fair, I haven't needed to. In all the years I've run computers here at home, I've never had a disk crash that lost data, even after our most serious disk mishap. So not having a backup hasn't been that big a problem. (Insert your favorite ominous foreboding music here.) Anyway, backups are a pain in the neck.

My view of backups has changed, though, primarily because they're so much easier now. Easiest, of course, is Apple's Time Machine. Plug a second disk (USB, Firewire, internal, if you've got such a thing) into your Mac, let it format to Apple's HFS format (or not), and start Time Machine. Tell it which directories you want to back up, and it will do that, every few minutes. Then you can actually scroll back through time (Tardis sounds not included) and pick out a file you might have deleted a year ago — assuming you were running Time Machine back then. It's an extremely neat and easy-to-use utility, and takes the pain out of doing backups, as long as you remember to leave the external disk plugged in, if that's what you've got.

Then, last week, Office Depot ran a sale where you could get a Terabyte Verbatim USB disk for $79.99 + tax. I bought three, one for Hal, one each for the college students.

Now the disk comes with Nero backup software for Windows (taking care of student I), and Apple's got Time Machine (taking care of student II). But what about poor Hal, stuck in Linux?

I called up the Synaptic package manager and typed backup in the search box. That brought up, among other things, a package called backintime, which is a front-end which uses the utilities cron (to schedule backups), diff (to find which files are changed), and rsync (to copy files that have changed to the backup disk). Perfect. I installed the program — actually both backintime-common, the guts, and backintime-gnome, the graphical front end, then went to get the disk.

Problem: Verbatim formatted the disk to the lowest common denominator, FAT32. This is not suitable for low-volume backups, because it does not allow multiple hard links to the same file. What backintime does, you see, is create a copy of your chosen disk directories every time you schedule a backup. The trick is that unchanged files are hard-linked from one backup to the next, taking a minimum of space. Only the changed files are stored in multiple copies. Since the FAT format doesn't do multiple hard links, it can't do the trick, and so we need to reformat the disk to a better file system.

So I installed gparted from Synaptic, launched it (using sudo gparted), and formatted the Verbatim disk to ext3 format.

Second problem: If you just plug a USB disk into a Ubuntu box, it auto-mounts, but is usually only accessible to the user who did the mounting (to be fair, I haven't tried this with a USB ext3 disk). That's unacceptable in a backup system that needs to be accessible to everyone. So we have to set up /etc/fstab. To reflect this. Ideally, we'd add a line which looks something like this:

/dev/sdd /backup ext3 errors=remount-ro 0 2

(Note added after the fact: The last entry on this line should indeed be a 2, not a 1 as previously listed. This this tells fsck to check this file system after any file system with a 1 in the last column. The only file system with 1 there should be the boot partition. Everything else can be a 2, unless you don't want fsck to look at the file, in which case you put in a 0. Got that?)

create a directory entry /backup, and then doing

mount /backup

would load up the disk drive.

However, since you usually have multiple USB ports on your system, there's no guarantee that this disk is going to always get /dev/sdd as its port. The solution is to use the ext3's UUID, which was created when gparted did its thing. You find the UUID with the command:

sudo blkid
[sudo] password for hal:************
/dev/sda1: LABEL="PQSERVICE" UUID="0A72323D72322DB7" TYPE="ntfs" 
/dev/sda2: LABEL="SYSTEM RESERVED" UUID="CCA811C2A811AC48" TYPE="ntfs" 
/dev/sda3: LABEL="Gateway" UUID="7E143E7F143E3A8B" TYPE="ntfs" 
/dev/sda5: UUID="2eec3fff-73d2-419c-8a3c-b92733d46da2" TYPE="swap" 
/dev/sda6: UUID="f3781533-d891-46e1-b9f0-839e8a538d35" TYPE="ext4" 
/dev/sdb1: LABEL="Verbatim" UUID="9deee42d-539b-45c5-8683-e95f889c1792" TYPE="ext3"

Verbtim is how I labeled the disk partition of the USB drive, so that's the UUID we want. Fill out the line in /etc/fstab as:

UUID=9deee42d-539b-45c5-8683-e95f889c1792 /backup ext3 errors=remount-ro 0 1

and we're ready to go. Note that this will automount so that everyone can read it every time the disk drive is plugged in and turned on.

That settled, setting up backintime is easy. You can specify the directories you want to back up, and the file types (say, those ending in ~ or .o) and directories you want to exclude. You can then select a backup time interval: minutes, hours, days, weeks ... Once you have a set of backups, you can use the graphical interface to look through your files of any snapshot, and restore a file that was deleted or moved on your main system, or copy it to another location if you like. It's very nice and easy to use.

You can see your backup schedule using crontab:

crontab -l
@daily nice -n 19 /usr/bin/backintime --backup-job >/dev/null 2>&1

Note the @daily there. That means the backup will start every night at midnight, and it's the only choice backintime gives you if you select a daily backup. This is unsatisfactory for me, as someone is frequently using the computer on and after midnight. So I used crontab -e to edit this entry, changing it to
0 3 * * * nice -n 19 /usr/bin/backintime --backup-job >/dev/null 2>&1
which launches the backup at 3am. backintime accepts this, but note that every time you change your setup it will reset the time to @daily. Just watch it.

Anyway, now I have a disk backup. And since I've never had a major loss of disk data from one disk, having two disks copying the data should mean that it can never, ever, ever happen, right? (Insert even more ominous and foreboding musing here.)

Saturday, April 03, 2010

A New Toy (Coming Soon)

The hypothetical long-time reader of this blog will recall that when I started it I had a Dell Dimension 2350, aka Hal, running Fedora Core Linux, and another 2350, Hal's Evil Twin, running Windows XP.

Six and a half years later, the only change is that I've converted the evil twin to Linux, and switched to Ubuntu. But I still have the same machines, with some minor upgrades. I'm cheap, what can I say?

The status quo is about to change. Last week Office Depot had an HP Pavilion on sale at a really good price, about $440. 4GB memory, 640GB disk, dual core processor, etc. I was set buy it, until I read the CNET Review (on Best Buy's product page for the HP), which told me that Gateway had a much better computer, the SX2840-01. Dual core, 4 GB, 1 TB disk, HDMI output, etc. About $100 more, but it looks to be worth the price.

Gateway doesn't seem to sell retail anymore. They directed me to JSR, which had the computers in stock when I first looked but quickly ran out, probably because Best Buy had undercut its own sales by posting an honest review. The promise to get in more, though, so I put in my order and am now waiting expectantly. Hopefully the new two will get here about the same time as Ubuntu 10.04.

Saturday, December 13, 2008

Cleaning Out Cobwebs

I recently purchased an SVA 19" Widescreen TFT-LCD Monitor. Maximum resolution 1440x900, thin panel, internal speakers (but no manual volume control, yech), user's manual in something resembling English, and it was on sale for $99.95 at Staples. Works fine. Monitors are a commodity these days, anyway.

But that's now why I called you here today. The problem was that Hal, here, couldn't display the 1440x900 resolution of the monitor. Even though Hal's Formerly Evil Twin, running on an even bigger monitor down in Raleigh, had no trouble. All Hal could do was 1024x768, which tends to stretch out on a widescreen monitor.

It didn't take long to find the problem. Here's the relevant section of Hal's /etc/X11/xorg.conf file:

Section "Screen"
 Identifier "Default Screen"
 Device  "Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device"
 Monitor  "ENVISION"
 DefaultDepth 16
 SubSection "Display"
  Depth  1
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  4
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  8
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  15
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  16
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  24
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
EndSection

No resolution is above 1024x768. And ENVISION means that this was set up for a monitor I got rid of a year or so ago. In fact, this xorg.conf file might well go back to the days when I was running Fedora. so this might, just might, need a little modification.

To fix this in the olden days, say 2004, you'd track down all of the parameters for the current monitor, edit the file with the appropriate information, and hope all was well. Later there were scripts that did some of that, if the monitor was well known.

Now you just run

sudo dpkg-reconfigure -phigh xserver-xorg

This generates a default xorg.conf file, with the relevant section

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
EndSection

xorg itself then configures the monitor, device, etc., if you Ubuntu has all the drivers. This won't work for everything, and if you have a video card with proprietary drivers you're going to have to load them up, but it's a heck of a lot easier than back in the day.

Tuesday, October 21, 2008

Installing a Scanner

One of the nice things about being on a college campus is that you can occasionally get involved in marketing ploys promotions designed to hook you on a particular product let you know about certain nearly obsolete products.

Case in point, the Canon PIXMIA MP470 Multifunction Printer, which retails for around $100, and which the Duke Bookstore had on sale for $20. That's right, one Andy Jackson. Plus $4 for the USB2 cable.

It's not a industrial scale printer, and it's probably not a great printer for sending out lots of photos, since it's a two tank (one black, one cyan-magenta-yellow) system. But I need a printer here in North Carolina, and for $20 ...

Naturally, there were problems:

First, I couldn't get the thing to work. Something about the ink tanks not being detected by the printer. Canon technical support was fantastic (no, I am Not Making This Up). They responded to my emails within a few hours. First they sent replacement ink tanks, then they sent a replacement printer, and a UPS shipping label to return the old one. (Obviously they have learned the lesson of King Camp Gillette, who noted that it doesn't matter how much they pay for the razor, as long as they keep buying the blades. They want me to keep using this printer through lots of ink tanks.)

The new printer worked fine, with the supplied drivers, under Windows and on the Mac. Of course, that left Linux, drivers not supplied.

Fortunately we have CUPS, the Common Unix Printing System. The version of CUPS supplied with Ubuntu doesn't have a native driver for the MP470, but it does have one for the MP150, and that works. (The driver for the MP610 prints blank pages. I didn't try any of the others.)

But Wait! The MP470 isn't just a printer, it's a copier, and it's a scanner!!!! (Not, unfortunately, a dessert topping.) The scanner works fine, again with the supplied software, under Windows and on the Mac, but, again, what about Linux?

Naturally, there's software, from the SANE Project, but the version supplied with Ubuntu, 1.0.19, doesn't include the MP470. The newest version, 1.1.0, does, but it doesn't seem that it will be included in the next Ubuntu release, Intrepid (8.10).

So we're left with getting the source code for 1.1.0, and compiling it. I've done this kind of thing many times before, of course, but Nicolas has complete directions. The only change necessary for me was that I had no entry for a scanner under /etc/udev/rules.d/, so I just made one:

sudo cp tools/udev/libsane.rules /etc/udev/rules.d/71-libsane.rules

where 71 was not one of the numbers already in use in the rules.d directory. After installing the software, I had to give myself permission to use a scanner (System => Administration => Users and Groups => Properties => User Privileges) and I had to reboot – just restarting the USB services didn't work.

So now I have a scanner, as well as a printer and copier:

Scanner Test Image

Not to mention the extra tanks of Ink Canon sent me. For $24, + tax.

Thursday, June 07, 2007

Fixing My Bug

I finally have enough time to write up the resolution to my difficulties with the 2.6.20-16 kernel upgrade:

First of all, there is a bug, or at least an inconsistency, in the way the kernel is handling SATA disks. (Warning: Blogger is about to dive into areas he knows almost nothing about. Please keep your various appendages inside the vehicle while he attempts this dangerous maneuver.)

Apparently, disks (or, at least, SATA disks) can be mounted using one of two drivers: piix (Pci Ide/Isa Accelerator), which treats the disks as IDE drives, and ata_piix, which treats them as SCSI drives. In the former case, drives are mapped to /dev/hda, /dev/hdb, /dev/hdc, etc. In the latter, the drives are mapped to /dev/sda, /dev/sdb, /dev/sdc, and so on.

In the Dapper release, my drives were mapped to /dev/hda and /dev/hdd, meaning that we were using piix. In the initial install of Feisty, however, the drives were mapped to /dev/sda and /dev/sdb. (Drives “d” and “b” are the same drive, IDE worries about which controller the drive is connected to, SCSI doesn't.)

It doesn't matter, so long as we're consistent. So long as we can construct a proper /etc/fstab file, all will be well.

My problem began with the aforementioned update. From what I learned reading bug report, sometimes the piix driver gets control of the disks, and sometimes the ata_piix driver does. The kernel should choose one or the other consistently, but different kernels choose different drivers — that's the bug. (I think.)

Now, as to what was happening to me. Let's look at my pre-20-16 /etc/fstab file:

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda1
UUID=38afc33a-e732-45eb-8271-cd23555ce5bc /               ext3    defaults,errors=remount-ro 0       1
/dev/sdb1                                 /home           ext3    defaults        0       2
# /dev/sda6
UUID=efc49726-51d6-411e-9745-a05edad31c21 /opt            ext3    defaults        0       2
# /dev/sda2
UUID=a955cf3a-b1bc-4998-92e1-0073aba94c4c /scratch        ext3    defaults        0       2
# /dev/sda5
UUID=79a7a282-c5b8-416b-a738-89ed35013381 /usr/local      ext3    defaults        0       2
# /dev/sda3
UUID=080af2c2-1bd6-4b4a-bceb-2e7c6c2a8fa2 none            swap    sw   0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto      0       0

One of these lines is not like the others, one of these lines just doesn't belong. Spot it? It's the line that starts /dev/sdb1. There is no UUID for this drive, which just happens to be the partition holding all my data. Apparently (Danger! He's thinking again), the piix and ata_piix drivers can locate disk partitions by their Universal Unique IDs, and the initial Feisty install determined the UUIDs for all of the drives in my system, and entered them into /etc/fstab, helpfully putting up a # /dev/sda? comment for each drive, so we know how to refer to it in the traditional way.

Except that I didn't have my data disk hooked up when I installed Feisty — if something went wrong, I didn't want to accidentally erase all my files. I installed the drive later, and manually added the /dev/sdb1 line to /etc/fstab.

Which works fine, so long as the kernel keeps using the ata_piix driver! With the update to 20-16, the kernel started referring to my data drive as /dev/hdd1, which wasn't in the /etc/fstab file.

OK, I could just change /dev/sdb1 to /dev/hdd1 and all would work, but suppose the next kernel starts using ata_piix again? A more elegant solution is needed, and that is to refer to my data disk by its UUID.

And how to I do that you ask? Well, I sure didn't know, so I looked around the Ubuntu Forums and general Googling®. There, I discovered the command

$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2007-06-06 13:06 080af2c2-1bd6-4b4a-bceb-2e7c6c2a8fa2 -> ../../hda3
lrwxrwxrwx 1 root root 10 2007-06-06 13:06 38afc33a-e732-45eb-8271-cd23555ce5bc -> ../../hda1
lrwxrwxrwx 1 root root 10 2007-06-06 13:06 79a7a282-c5b8-416b-a738-89ed35013381 -> ../../hda5
lrwxrwxrwx 1 root root 10 2007-06-06 13:06 a955cf3a-b1bc-4998-92e1-0073aba94c4c -> ../../hda2
lrwxrwxrwx 1 root root 10 2007-06-06 13:06 bdad36ce-b67a-4c39-988e-94f40df90f67 -> ../../hdd1

Which tells me that /dev/hdd1 has the UUID bdad36ce-b67a-4c39-988e-94f40df90f67.

So now the resolution of the problem (for me, anyway) is simple. I just replace the offending line in my /etc/fstab file by

# /dev/sdb1
UUID=bdad36ce-b67a-4c39-988e-94f40df90f67 /home           ext3    defaults        0       2

Problem solved. I can now use the new kernel, and, hopefully, will be immune from this type of problem.

Hopefully.

Friday, June 01, 2007

Things I Don't Know About SATA

Sometimes, I astound myself with my technological dweebishness. I mean, here I am, knowing more about computers than 95% of the people on the planet, and I still get confused about things.

I think I know what happened to me yesterday. The “bug” probably doesn't affect every user of Ubuntu, only those who added extra disks and labeled them as /dev/sdb in /etc/fstab.

It might even be a feature, not a bug.

Unfortunately, I don't have time to track it down now. When I do, I'll write it up for posterity. I just wanted to post add a post here so that those who actually have a clue won't think I've completely lost my geek status.

That's not particularly arrogant. I also know more physics than 99.9% of the people on the planet. That would be arrogant, but I've got all sorts of pieces of paper to prove it.

Sunday, April 29, 2007

Getting Feisty With the Network

When we last left our installation of Ubuntu 7.04 (Feisty Fawn) on Hal's Evil Twin, we had everything in place — except wireless networking, a rather important omission since Spouse refuses to let me string an umbilical cord through the house. (It's only 20 feet!)

Now the Fawn has what is supposed to be excellent support for out-of-the box wireless, through something called Network-Manager, which is supposed to “effortlessly switch networks.” Well that's all right, even though HsET is permanently (I hope) connected to one network, all of the time.

And the initial results were encouraging. On installation, Feisty immediately found my DLink DWL-G510 wireless card, and told me it was going to use a Restricted (meaning third-party binary) driver to talk to it, if that was OK with me. Having no other choice to get on the Internet with HsET, I said yes, offering a silent prayer to RMS for, if not forgiveness, at least understanding.

I entered the network information: SSID, WPA-PSK (or Personal) security, passphrase, and click OK. A little arrow started chasing its tail, and eventually stopped. I opened Firefox, and headed off to GoogleTM.

Nothing. Open a terminal window, enter:
ping http://www.google.com/

No response.

Obviously nothing's working.

So I went online with the Mac, which does do wireless out of the box, and started searching Ubuntu Forums. It immediately became apparent that Network-Manager didn't handle WPA, in particular WPA-PSK mode, security all that well.

So I a sulked for awhile, and then went hunting for a solution. I found it in bits and pieces all over the forum, mostly written for previous versions of Ubuntu, but still useful. The best help was from the Ubuntu Forum and the Ubuntu Guide, some of which was originally written for static IP addresses, but with information about DHCP connections as well. I'll write out the steps I used here, but for further reference you should really go back to the original thread.

  1. First, get rid of network-manager and network-manager-gnome. I used synaptic, but you should also be able to do it with
    $ sudo dpkg -r network-manager network-manager-gnome
    This shouldn't be necessary, but I found no way to just turn off network-manager, even from within Gnome. There must be a way, since that's standard Unix/Linux practice, but I couldn't find it, so I just chucked the software out the window.
  2. Install the wpasupplicant package:
    $ sudo apt-get install wpasupplicant
  3. Open up a terminal window. Just about everything from now on will be done in this terminal window.
  4. Get your WPA identity string. Suppose your Networks SSID is "Our_House," and your pass phrase is "Two cats in the yard." Then run
    $ wpa_passphrase "Our_House" "Two cats in the yard." network={
    ssid="Our_House"
    #psk="Two cats in the yard."
    psk=43c62e1ef147c7ec83636405517140842332fce597e10124598b6d1123742a4e
    }

    Note that psk is the actual WPA password for your router. Save this output somewhere for the moment.
  5. Create the file /etc/wpa_supplicant.conf. I use
    $ sudo vi /etc/wpa_supplicant.conf
    but you can use whatever editor you wish, as long as you run it with sudo. Your final file should look like this:
    ctrl_interface=/var/run/wpa_supplicant
    #ap_scan=2
    
    network={
            ssid="Our_House"
            scan_ssid=1
            proto=WPA RSN
            key_mgmt=WPA-PSK
            pairwise=CCMP TKIP
            group=CCMP TKIP
            psk=43c62e1ef147c7ec83636405517140842332fce597e10124598b6d1123742a4e
    }
    

    where obviously you replace Our_House and the psk string with the appropriate values for your network.
  6. Now we need to edit (again with sudo) the file /etc/network/interfaces to tell it about the card. Looking around the web, I find that the DWL-G510 uses the Atheros chip-set and the madwifi driver. So edit /etc/network/interfaces so that it reads the lines near the string auto ath0 read:
    auto ath0
    iface ath0 inet dhcp
    pre-up wpa_supplicant -Bw -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf
    post-down killall -q wpa_supplicant
    
    (no, that last line doesn't have a “-9,” it is, indeed “-q”)
  7. Now we want this to run at startup. Note that you do not want to do this with a laptop, because you don't necessarily know which network you are going to connect to. Create a file /etc/init.d/wifi_wpa.sh with the following content:
    #! /bin/sh
    echo "* [WiFi]: Enabling WPA Supplicant ..."
    if [ -x /sbin/wpa_supplicant ]; then
    /sbin/wpa_supplicant -B -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf -w
    fi
    exit 0
    
  8. Make sure the files you create are world readable, and that the last one is executable:
    $ sudo chmod +r /etc/wpa_supplicant.conf
    $ sudo chmod +rx /etc/initd/wifi_wpa.sh
    
  9. To get wifi_wpa.sh to start during the boot requires us to get it into the list of files in /etc/rcS.d. If you list the directory:
    $ ls -1 /etc/rcS.d/
    
    the scripts will execute in the order they appear on the screen. We want WiFi to start just before the networking file S40networking, and this command pretty much guarantees it:
    sudo ln -s /etc/init.d/wifi_wpa.sh /etc/rcS.d/S40netwifiwpa
    Your mileage may vary, in which case you might have to change the name "S40netwifiwpa" to make it appear just before "S40networking."
  10. Reboot, and log on. Your internet connection should be established, e.g.:
    $ ping www.google.com
    PING www.l.google.com (www.xxx.yyy.zzz) 56(84) bytes of data.
    64 bytes from od-in-f147.google.com (64.233.161.147): icmp_seq=1 ttl=243 time=11.4 ms
    64 bytes from od-in-f147.google.com (64.233.161.147): icmp_seq=2 ttl=243 time=13.4 ms
    64 bytes from od-in-f147.google.com (64.233.161.147): icmp_seq=3 ttl=243 time=14.3 ms
    
  11. You should be able to get the network running again with stop and start commands, but I haven't tried to find the appropriate sequence.

So far (three hours, two reboots) the network has been just fine, but there may be problems ahead. If so, I'll report them. I'd also appreciate any feedback from those who've tried this themselves.

Friday, April 27, 2007

Taking Garrison Keillor to the Gym

I'm a fan of Garrison Keillor and A Prairie Home Companion. Kansas German Lutherans aren't quite as shy as Minnesota Norwegian Lutherans, but it's a close race, and there are a lot of parallels between Lake Wobegon and Holyrood.

So I like to listen, but never get to hear an entire show.

Problem: I just can't take two hours out of every Saturday night to listen to the show. (I'm a busy (ex-)Kansas German (ex-)Lutheran.)

However, I spend 3-4 hours a week at the gym, and I have an Samsung YP-U1 MP3 player (inherited from Youngest Child after the purchase of an iFollowtheCrowdPod). So can we somehow get the show onto the MP3 player?

Yes! PHC has an archive where you can find old shows.

Problem: The archives play streaming Real Media, suitable for listening with RealPlayer or Helix Player (untested). Not a format supported by my Samsung.

Solution: Download the streaming media, convert it MP3 or OGG (the Samsung plays both).

But how? With mplayer. However, first we have to find the stream, and then capture it.

It's not as simple as all that, as the PHC site hides the file pretty well. Here's the procedure for last Saturday's (April 21) show, which just went on line:

  1. Go to the archive page, and select the month and year of the program you want to hear. Click GO
  2. Scroll down to the show you want, click on the date.
  3. On the next page, right click on the “Listen to the whole show” line, and chose the “copy link location” option.
  4. Open a terminal window, change to the directory where you want to save your files, write “wget” on the command line and then middle-click. This will produce the command:
    wget http://www.publicradio.org/tools/media/player/phc/2007/04/21_phc
    which will return a file named 21_phc.ram. (Obviously the numbers will change with the date of the show.)
  5. $ wget `21_phc.ram`
    (Note that those are backquotes.)
  6. This yields a file named 21_phc.smil. If you cat that file, you'll find a string like
    rtsp://archivemedia.publicradio.org/5559/phc/2007/04/21_phc.rm
    That's the audio stream.
  7. From here it's simple, if you read the reference article:
    mplayer -vc null -vo null -ao pcm:file=phc_070421.wav rtsp://archivemedia.publicradio.org/5559/phc/2007/04/21_phc.rm
  8. This produces a WAV file. You can produce MP3s directly with this method, but they are terribly compressed.
  9. After the two hours are up (this is streaming media, remember?), go back to the command line and compress the file. Since the Samsung reads Ogg format, I use:
    sox phc_070421.wav phc_070421.ogg
    which produces a file that I can store on the Samsung and listen to in the gym.

Of course, now that you know the trick it's trivial to write a script to do the whole thing every week, but I wanted to note how you find all of this out, in case PHC changes the format of the files involved.

Sunday, April 22, 2007

Installing Ubuntu Feisty Fawn With Dual Boot

As a counterpoint to my Windows Re-Installations notes, here I'm going to give a blow-by-blow of my installation of Ubuntu 7.04 (Feisty Fawn) on that Hal's Evil Twin. HsET is an old (2003) Dell Dimension 2350 computer, with 512MB memory, a DLink DWL-G510 wireless card, a Microsoft Wireless Keyboard/Mouse combo, plus a Wacom graphics tablet which also serves as a wireless mouse, and connected to a Canon printer. The goal is to set this up as a dual-boot machine, and not have to run an Ethernet connection from the DLink router downstairs up to the computer, i.e., get the wireless running. Then Spouse, who likes Linux because it boots up a heck of a lot faster than our Windows machine, can read email while I'm composing pointless blog entries.

This is still an incomplete story, so stay tuned for further developments. Right off the bat, let me tell you that I don't have the Wireless connection going, yet.

First, we need media to hold Ubuntu. I've pretty much filled up the Seagate 120GB disk with Windows stuff, so I connected a Maxtor 40 GB disk (HsET's original disk, as it turns out) as a second drive:

The duct tape isn't the only thing holding up the disk, the cable is quite stiff and keeps everything upright. The tape is just to keep things from jostling around when the box gets moved.

For some reason we have to set the jumpers to make the Seagate the Master and the Maxtor the Slave. Setting both to Cable Select just gives you a computer that doesn't boot at all, even though both of the drives are attached to the same cable, in proper order.

So here we go:

  1. The target disk is now /dev/hdb. I find it easier to format these things before installing the distribution, so I loaded up a GParted Live CD to set everything up. I decided on these partitions:
    Mount Point File System Size
    /boot ext3 1 GB
    / ext3 12 GB
    /usr/local ext3 5 GB
    /home ext3 19.29 GB
    swap Linux Swap 1 GB
    (note: GParted found Microsoft Wireless keyboard/mouse, but not the Wacom tablet)
    GParted is quite easy to use, and I find it helpful to see what I'm doing, rather than trying to do it by cylinder number with fdisk.
  2. Burn a Ubuntu Feisty Fawn (7.04) Live CD.
  3. Boot it.
  4. Weird. The text screen resolution went Apple ][: 40x25.
  5. However, the GUI is fine. Wacom mouse works out of the box, as does the wireless keyboard.
  6. There is a warning message that we're using a Restricted Driver for the WiFi card.
  7. Try to set up wireless interface, connect to house 802.11g WPA personal network. Timed out. Though this is ultimately a deal-breaker, go ahead with the install and worry about it later ...
  8. Click the Install Button.
  9. Language: English.
  10. Time Zone: EDT (New York).
  11. U.S. English keyboard
  12. Set up partitions as above. (Manual install.) Does it really have to rescan the disk every time you click the mouse?
  13. Format everything, even though it's already formatted (it's Required by Ubuntu).
  14. Temporarily, at least, set Windows as the default boot device. See how at http://ubuntuforums.org/showthread.php?t=408520.
  15. Reboot to Windows: Works (including wireless).
  16. Reboot to Linux: Works, except for wireless. It can even see the NTFS and VFAT files on the Windows partitions.
  17. To do:
    • Fix Wireless
    • Check printer drivers: Dapper's drivers did not do well with the Canon printer.
    • Update, load up software that we might want. This mostly involves things such as Java and Flash, and Feisty's pretty good about helping with that installation, once we have an Internet connection.
    • Move Spouse's files from downstairs upstairs.

To be continued ...

Saturday, April 21, 2007

Broken Windows (XP) -- Goodbye, Farewell, and Amen

I fixed the problem with all the USB stuff. Apparently Windows associates a device with the USB port where it is attached (Linux doesn't do this with the mouse, but I don't know about other gadgets). When I moved the computer, I disconnected all of the USB devices, and I probably didn't plug them all back into the “correct” ports. Starting up the computer, logging on, and plugging the components fixed the problem.

So I now declare Hal's Evil Twin fixed, and I'm going on to other things, such as installing Ubuntu Feisty Fawn as a dual boot on HsET.

Broken Windows (XP) -- Part V

This was supposed to be a post of triumph, how I overcame adversity and my own ignorance of installing Windows, and restored a computer, from scratch, to the way it Used To Be.

It will probably work out. I suspect I've made a silly mistake because I was working on things at 8 am on a Saturday morning, never a good time to do anything like real work.

But first, the good stuff:

As you will recall (and recall and recall and recall), Hal's Evil Twin (HsET), the XP box upstairs, crashed for no apparent reason, leaving all its data accessible but with no way to boot the computer, even in safe mode. After several attempts to fix the disk, I decided that the easiest thing to do was to copy everything off the XP's disks onto Hal for safekeeping, reinstall Windows, and then copy everything back.

Just so I'd know what I did, I kept a running log of how I performed the reinstall. It's going to be long. There are several reasons for this: the computer is four years old, from before the time when a company would ship a “restore this computer to the way it was when you bought it” option; I've added a fair amount of hardware over the years, so I had a bunch of new drivers to install; I changed the setup of the system, e.g., repartitioning the disk and using Comcast's free McAfee anti-virus rather than the Norton anti-virus package that was coming up for renewal; while just about everyone who's run Linux has done an install, few people reinstall Windows unless the Have To, so there isn't a neighborhood database; and, finally, I'm just ignorant about the ins and outs of Windows. I'm not as ignorant anymore, but before this I was happy if HsET would just get scanned for viruses and download all the proper updates. So this isn't a scathing indictment of Microsoft, because, while they could have made things a lot easier, I probably didn't do things in the most efficient way.

That said, here's the list of all the things I did to restore the system. It's not going to be well documented, but you should be able to GoogleTM a string to find the information.

Restoring Hal's Evil Twin

  1. Started with a working and updated copy of Windows XP SP2, with IE7, etc., on a 10 GB disk (this was my test install case)
  2. Hook up 120 GB disk as slave drive (middle plug on cable). In Linux this would be /dev/hdb
  3. Start windows
  4. Windows identifies drive, tells you to reboot
  5. Reboot
  6. Copy contents of 120 GB disk to backup disks, as necessary
  7. Hook up 120 GB disk as first disk drive, remembering to set the jumper to “cable select.”
  8. Put the Windows restore disk into the CD drive, turn on the computer
  9. When asked, have it format the HD. Use full format for NTFS disk
  10. Then tell it to install Windows. It will then hang at “Setup will complete in approximately 34 minutes” message. This is a well known bug: http://techtracer.com/2007/03/12/xp-installation-the-34-minute-hiccup/. My file was mdmbcsm.inf. A previous test install indicated that simply restarting the installation may also work.
  11. Accept US defaults
  12. When asked, name the computer HsET
  13. Time is Eastern (GMT -5)
  14. Network connection wizard won't find a network until we install the wireless drivers. In fact, we'll have to install the Ethernet drivers as well, so there's nothing to do here.
  15. Defrag the disk. Probably not necessary, but it doesn't take much time at this point and makes the next step a little easier.
  16. Partition the disk. The idea is to have some shared data, mostly music and pictures, in a VFAT 32 partition so that the data can be read in Linux if (when?) I install a dual boot system. Do this with GParted, booting the computer with the Gparted disk.
  17. Use the Force I810 driver option
  18. Resize (Resize/Move) the partition from 114471 MB to to make it 73511 MB, followed by 40960 (40 GB) of free space. This will be the C: partition
  19. Format the 40 GB as VFAT 32 (Partition Tab) This will be the E: partition (as always, saving D: for the CD/DVD drive)
  20. Boot up, let the system check the disks, verify that the partitions are as they should be
  21. Install "Dell ResourceCD" on computer. Why Dell couldn't ship the drivers on the same CD with the XP install is beyond me.
  22. Install missing drivers:
    • Audio
    • Mouse
    • Intel Chipset Software Installation Utility
    • Intel 845 G/GL Integrated Video
    • Broadcom 4401 Integrated NIC Driver
  23. Reboot
  24. Up video settings to 1024x768 and 32 bit color
  25. Install D-Link Wireless Driver
  26. Reboot
  27. Install Service Pack 2. Use the Network Install executable, because it's a heck of a lot faster than using Windows Update.
  28. Reboot
  29. Configure Wireless Network
  30. Download and install McAfee Security Suite from Comcast
  31. Download and install Google Pack
  32. Do a Virus Scan (hey, you never know)
  33. Run Windows update, and run, and run, and run, rebooting as needed. Eventually you'll get the thing updated.
  34. Find driver for Wacom CTE-430 (Sapphire) (aka Graphire3) drawing tablet. http://www.wacom.com/productsupport Use the supposedly stable 5.01-9 driver.
  35. Load drivers for Canon iP4000 printer (reboot may not have been necessary, but I did it anyway).
  36. Load drivers for Microsoft Wireless Keyboard & Mouse. (A previous report of Microsoft Hardware's incompatibility with XP turned out to be a bad USB port. Linux & Things regrets the error.)
  37. Install (very old) copy of Photoshop Elements (from the original Wacom tablet package, as it turns out)
  38. Install (even older) copy of Office 97 (from a previous computer)
  39. Add all available updates to Office 97
  40. Install Nero CD/DVD Burning software
  41. Install Thunderbird and make it the default email client
  42. Move “Shared Pictures” and “Shared Music” folders to the E: disk, and create Shortcuts in the “Shared Files” folder on C:
  43. Set up user accounts
  44. Restore user files from backups
  45. Make Firefox the default browser for each account
  46. Make Thunderbird the default email client for each account
  47. Run msconfig.exe to turn off things you don't want starting up at boot: Google indexing (for now, anyway), that idiot toolbar that Office 97 put up on everyone's screen, anything else that isn't necessary.

And that should have been that.

Except this morning I decided to put everything back the way it was, i.e., HsET under the desk, printer where you can reach it, etc. So I unplugged everything, put everything back where it was before the unfortunate sequence of events, plugged everything back in, and turned the computer on.

It booted fine.

The keyboard doesn't work.

Neither the Microsoft Optical Mouse or the Wacom Tablet Mouse works.

There are several possibilities: I plugged things in wrong, the remaining USB ports on the computer are fried, or I've so offended Bill that he reached out through the Internet and strangled poor innocent HsET (not likely, that one). All of these require debugging, and I'm just too tired of it to work on it right now. Later today, maybe.

Monday, April 09, 2007

Microsoft (Hardware) Works With Linux

I'm trying, slowly, to get all of the drivers working on the Windows box (see the last few posts). One bit of hardware we have for the XP is the Microsoft Wireless Keyboard/Mouse combo. This is a USB dongle which broadcasts to a wireless mouse and keyboard.

I've installed the drivers for the thing, but Windows still can't find it. If I can find the manual, or the TeenagerTM who installed the thing in the first place, I can probably make it work, as it Worked Before, but it's not automatic.

On a whim, I plugged the thing into my Linux box, and, voila, it worked. (I'm typing this post with it.) No drivers needed be be installed, at least with Ubuntu Dapper, and, I suspect, most major Linux distributions.

The default configuration for Hal is to use a Microsoft USB Optical Mouse plugged into a PS2 adapter and connected through a KVM switch. It's never given me a problem.

Conclusion: Microsoft hardware works best under Linux.

Much later: It turns out that the dongle was plugged into a bad USB port. Linux & Things regrets the error. In any case, Microsoft hardware usually works quite well with Linux.

Sunday, April 08, 2007

Broken Windows (XP) -- Part IV

Hey, I'm on a roll. Since last night I've

  • run Windows Update about a gadzillion times, rebooting more often than Mitt Romney changes his political position.
  • Found the ethernet and audio drivers.
  • Figured out what to do next:
    • Install the remaining drivers (graphics tablet, wireless keyboard, printer) and software (except MapleStory)
    • Copy it all to a DVD or two, or maybe one of those dual layer DVDs.
    • Install barebones XP SP1 on a big disk.
    • Copy all the files from the DVD onto the big disk.
    • Boot Windows from the DVD.
    • Restore all the old files I've archived.
    • Install remaining software (Office, Photoshop, etc.)
    • Install the never-to-be-sufficiently-fraked MapleStory.
    • Keep the DVD in a safe place, as a starting point for when I have to do all of this again.
    • Install a second disk on this machine, load up Ubuntu on it, and make it dual boot for my wife, who notes that she can finish reading her email in Linux during the time it takes the Windows computer to boot up.
    • Figure out how to get the DVD image into a form that qemu can use, so that “essential” Windows programs can be run from inside Linux.

Saturday, April 07, 2007

Broken Windows (XP) -- Part III

Everyone should have an Igor. I used to have two, but now I'm down to one. He swears that I can restore my trashed Windows disk without having to do a reinstall. In the meantime, just in case, I dug out an old 10 GB hard disk and plugged it into the Windows computer in place of the trashed disk. I'm in the process of installing Windows on that disk, just to see if I can do it. If I can, I'll feel more comfortable in reinstalling Windows on the bigger disk, if it comes to that.

In the process, I've noticed a few differences between the install process for a Linux distribution and the install process for Windows.

How to Install Linux

  1. Get a Linux install disk.
  2. Put it in the computer.
  3. Boot the machine.
  4. Answer questions about the installation process. In general, you can use the defaults.
  5. Select any additional software you want to install.
  6. Click the install button.
  7. Wait for Install to finish.
  8. Log on.
  9. Update software.
  10. Configure user accounts.
  11. Configure Network and Email Accounts.
  12. Enjoy.

How to Install Windows XP

  1. Dig out Windows installation disk, or, the days, the “recovery” or “reinstall” disk.
  2. Put it in the computer.
  3. Boot the machine.
  4. Accept the fact that there is nothing customized about this install.
  5. Find the driver disk(s).
  6. Install the needed drivers. (I still haven't found the Ethernet and Audio drivers. I did find the Wireless drivers, so I can connect the machine to the Internet that way.)
  7. Reboot.
  8. Since the only legal disk you can use to install Windows XP on this computer is set at Service Pack 1, download Service Pack 2. Note that this is the “Network Installation Package for IT Professionals and Developers.” Use this, or order the CD version. You're probably going to need it in the future. Further note that it's best to do this on another computer, since we don't have firewalls and virus scanners enabled yet.
  9. Install SP2.
  10. Reboot.
  11. Get antivirus software installed. I'm using McAfee, only because Comcast offers it free to subscribers.
  12. Reboot.
  13. Run Windows Update (or install Microsoft Update) to get latest updates for XP.
  14. Reboot.
  15. Install Google Pack. Select Firefox as the default browser.
  16. Install Mozilla Thunderbird. Make it the default email.
  17. Configure user accounts.
  18. Configure Network and Email Accounts.
  19. For each piece of software you need:
    1. Find it, via Internet or on CD.
    2. Install.
    3. Reboot as required.
  20. Enjoy?

Yes, it is so easy to install Windows, and so hard to install Linux.

Monday, April 02, 2007

Broken Windows (XP) -- Part II

After backing up everything on the aforementioned XP machine, I consulted my experts at work, who agreed that the first step should be to put the Windows Reinstallation disk into the CD drive, and boot it up. This should work, right? The computer boots and runs the Ubuntu Live CD without any problem.

Except it doesn't work. The system tells me to “Press any key to boot the CD”, and when I do, it goes straight to the same screens as the last time: First it says Windows won't boot, then when you tell it to boot in safe mode it coughs up a list of files, and finally, it blue screens.

This from an otherwise perfectly healthy computer that runs a live Linux CD without problem.

Meanwhile, people in the house are going through Maple Story withdrawal. It's not pretty.

And you wonder about the subtitle of this blog.

Saturday, March 31, 2007

Broken Windows (XP)

This is probably my fault. Here's what I think happened: the main disk on our Windows XP machine filled up. Windows decided to fix this by deleting some system files. Result: the system won't boot, even in safe mode. Nothing, NADA. Just a list of files that scrolls by so fast you can't see the error message at the top of the list, followed by a blue screen of hopeless and utter despair. I'm not positive that the cause is correct, but the result is. In any case, it's probably my fault as much as Windows, because I wasn't watching disk usage on that machine.

So currently I'm pulling off the files from that disk onto an external USB disk. The idea is to backup everything, restore Windows (which will be difficult, since this is an old machine and the restore disk only comes with Service Pack 1), and then copy over the relevant files from the backup. We'll see if that works.

The immediate problem is to get the files onto the USB disk. Obviously you can't boot into Windows.

So here's the procedure I used. I lifted most of it off the web. Ordinarily I'd link back to where I found the information, but that was late last night, and I was working on a machine which at the time had no internet access. So my apologies to all concerned.

  • First, we need some way to access the computer. A Linux Live CD is the obvious way to go. I had an old version of Knoppix on hand, but it hung up when trying to find the USB ports. I finally got it running in fail-safe mode, but decided that wasn't a really viable option. Since I'm running Ubuntu on my own machine, the choice was to go get the Edgy Live CD. This booted up immediately (where, in this context, “immediate” == 5 minutes). For some reason it couldn't, or wouldn't, use WPA encryption through the wireless card, but it did everything I needed it to do.
  • Except find the disks on the Windows machines. How to do that? Well, the Edgy Live CD has my new favorite command, lshw, which tells you all about the hardware. This says that there is a disk at /dev/hda. I've only seen one partition on this disk, which would be named /dev/hda1. This machine came with XP pre-installed, so we know the partition will be NTFS.
  • This means we have to enable Edgy to read the NTFS disk. We'll work with read-only mode for now, since I believe write access under Linux is a bit flaky. First, go in to superuser mode. Since there's no password on the live CD, just enter the command
    $ sudo -i then load the NTFS module into the kernel with
    # /sbin/modprobe ntfs
  • Now create a mount point for the partition
    # mkdir /mnt/win
  • and mount the disk
    # mount -t ntfs /dev/hda1 /mnt/win
  • But Wait!!! This gives a bunch of error messages, most of which say that /dev/hda1 isn't an NTFS partition. Huh. Since the other dominant file-system in WindowsLand is vfat, try
    # mount -t vfat /dev/hda1 /mnt/win
  • That worked. But what's in that directory?
    ls -l /mnt/win
    Examining the list of files, this seems to be called the Utility Partition. OK. Nothing to see here right now, though maybe it will help us restore things later.
  • Well, logically, if the ntfs partition isn't in /dev/hda1, we should try
    # umount /mnt/win
    # mount -t ntfs /dev/hda2 /mnt/win
  • That works. Now we plug an external drive into the USB port and merrily copy away:
    # cp -rv /mnt/win/* /media/usbdisk

OK, the files are all saved, tucked nicely away on a disk that can be read by any computer. The next step is to try to revive Windows XP on the target machine, or persuade the family that they don't really need to run Photoshop or Maple Story. (Yeah, I know about GIMP, they know about GIMP, and they prefer Photoshop. There's faint hope for Maple Story.)

Sunday, March 25, 2007

Adding a Hard Drive

A few weeks ago, at the same time I bought that 2 GB memory key, I bought a Maxim “200 GB” drive. The 200 GB is in quotes because the drive formats out to exactly 196,907,134,976 bits, which is several bits short of a load even if you believe that 1 GB = 109 bytes. (Actually, of course, 1 GB = 230 bytes.)

So I have this big-but-not-200 GB drive that I want to a) install, b) reformat as an ext3 file system, and c) make my /home directory.

Installing the drive wasn't too much of a problem. It went into the second CD drive bay. Not where it was supposed to go, but then I didn't have a lot of choice. Ideally, the drive should go on the same cable as the original hard drive. Unfortunately, drive cables are only 18 inches, max, and the geometry of the situation is that the second drive would have to be duct-taped to the case to make that work. So instead of hooking up the second drive in series with the first drive, I'm hooking it up in series with the DVD-drive. I suspect that this could cause a performance hit when I'm writing DVDs and CDs. I also suspect that I've just voided the warranty on this Dell, but that's OK, because the machine is now almost four years old, and I think the warranty has long expired.

The other problem with doing things this way is that the drive and drive-bay screw holes are mismatched, so the drive can either be screwed in and lean at an angle, or just sit loosely on the shelf. Since this is a floor-based tower model, I just let the drive sit there. This may cause problems if we ever get an earthquake, but then there's still the duct-tape option.

Anyway, the drive is installed, however precariously. So how do I save it from its Windows formating and convert it into a real disk drive? Follow:

  • First I have to find the thing, meaning, where does the computer think it is. Boot the system, and up comes the drive. Open an xterm, or go straight to the console, and issue the extremely useful command:
    $ lshw
    This gives you a complete description of your hardware. Examining the output, I see that there is a Maxtor 186 (real) GB hard disk at /dev/hdd. (If I'd hooked up the drive correctly it would have been at /dev/hdb.)
  • I got the formating directions from Jeff Hunter. I'll just list the steps I took, and refer you to his page for more information:
    $ su (become root)
    # fdisk /dev/hdd (partition the disk. Use the defaults on Hunter's page)
    # mkfs.ext3 -b 4096 /dev/hdd1 (create an ext3 file system)
  • Now add a new line to /etc/fstab:
    /dev/hdd1  /home2  ext3 defaults   0    2
  • Create a mount point for it:
    # mkdir /home2
  • Mount it:
    # mount /home2
  • Copy the files from /home to /home2:
    # cp -r /home/mike /home2
    (do this for every user directory in /home)
  • The owner of all the files you just copied is root. Fix that:
    # chown -r mike:mike /home2/mike
    (and repeat as needed)
  • Now I want to perform a bit of magic. I want to make /home2 my /home directory. Since I'm not absolutely positively sure this will all work, I'll rename the old /home to /home2 for now. Later I'll delete those files and use that partition for scratch, or another Linux distribution (maybe a “real” one).
    Right now my /etc/fstab file has the lines:
    /dev/hda3  /home    ext3    defaults    0   2
    /dev/hdd1  /home2   ext3    defaults    0   2
    
    I'm going to edit this so it reads:
    /dev/hda3  /home2   ext3    defaults    0   2
    /dev/hdd1  /home    ext3    defaults    0   2
    
  • I suppose you could then do:
    # umount /home
    # umount /home2
    # mount /home
    # mount /home2
    but I just hit Ctrl-Alt-Delete and rebooted to get the OS to read the new mount points.

So far no stability issues, no power problems, and a nice big drive.

Sunday, December 17, 2006

Dell Dimension Documentation

The none of you that have read this blog from the beginning will remember that my current computer is a Dell Dimension 2350, now a rather old, cheap computer which nevertheless does just about everything I want. I would, however, be happier with more memory, but I didn't remember what the maximum amount of memory for the 2350 was. So tonight I put the string Dell Dimension 2350 into Google™ and found, to my surprise, a link labeled Documentation. It's a link to Dell's online information for the 2350, including such topics as "Technical Overview," "Controls and Lights." "Solving Problems," "Advanced Troubleshooting." "Technical Specifications." "System Setup Program," "Adding and Replacing Parts," and "Documentation." In other words, the manuals that Dell didn't ship. Highly useful, I'd think, and I suppose that there are similar pages for any Dell computer model.

And in answer to my question, the 2350 supports up to 1 GB of memory. I only have 512 MB, so I need to see about upgrading.

Saturday, September 03, 2005

Adding a DVD Drive

Those of you (reportedly in the low single figures) who have been with us since the beginning will remember that this machine came with a CD-RW drive, which seemed adequate at the time and was, actually, quite cheap (i.e., it came with the basic machine).

After the last complete backup, which took about 10 CDs, I realized that I needed something better, so I went around looking for a Linux-compatible DVD drive. Actually, I didn't have to look very long. I work in a Linux shop, so the sys-admins there know what works and what doesn't work. One of them recommended the NEC ND-3540A [This link is currently not responding, and it's to NEC-UK. NEC has one of the most annoying web site design's I've been able to find. Note to NEC sales: make it easy for us to find what you're selling.] He gave me two possible sources:

  • Monarch Computer at $55.99* and free shipping, including the Nero burning software, which wouldn't run under Linux anyway, and
  • newegg.com at $39.99 (it's cheaper by a buck now) plus $3.80 UPS 3-day shipping, and no software.

I went with newegg.com, and the package arrived in the promised time. Unpacking, I found no directions whatsoever, no CD, nada. The only paper in the box was the shipping invoice. Also, the drive, while wrapped securely, looked as though it was re-wrapped -- i.e., we're probably looking at a returned-and-reshipped product.

Oh, well, I can always send it back myself, so carry on, my wayward son. First order of business was to remove the old CD-RW. I could have kept the CD-RW and installed the DVD as a second drive, but I don't really do a bunch of CD-to-CD copying and I may someday want that open bay for another disk drive. So open the computer case and remove the CD-RW.

Do you really realize how much dust a computer collects? I hadn't had this machine open in a year or so, and it was rather filthy. Surprisingly, it didn't have a lot of cat hair, just miscellaneous particles. Let's not think about that. OK, clean out the computer and disconnect the cables to the CD-RW.

Then comes the problem of removing the front of the case so that I can pull out the drive. The Dell case, it turns out, has its front case latches inside the box. (The side panel has one external latch on the back of the case and is easy to remove.) This took me a few minutes to figure out, but eventually I got the front of the box open and was able to unscrew the CD-RW drive from the frame and remove it.

The back of the CD-RW and the back of the DVD had identical connections, which meant the hookup was easy. The only difference was that the CD had a different jumper setting than the DVD. This isn't too surprising, the jumper setting changes from model to model even with the same manufacturer. A search of the web (which I can't find anymore, see comments about NEC's web organization) convinced me that NEC drives were shipped with the jumper in the "Master" position, which is where I wanted it.

So plug in all the wires, set the DVD drive in the bay, tighten all screws, and close up the case. Now, how does it work?

  • Reboot went cleanly. Apparently kudzu picked up the hardware change without difficulty.
  • I put a data CD in the drive.
    $ mount /media/cdrecorder
    worked just fine, and I was able read the files from the drive.
  • Audio CDs played just fine, using xine anyway.
  • I burned a CD, using k3b. It worked normally. It was a collection of MP3s, and it plays well on my car stereo.
  • The xine distribution from freshrpms.net comes with the libdvdcss package, so I had to try it out, using the SG-1 Season 1 DVD set. Xine worked very well. I was able to access the DVD menu, including subtitles and alternate languages, and play the movie in a window or in full-screen mode. There is even an option to do frame dumps to disk (as PNG files, for some reason). The only things that I haven't figured out how to do is reverse (you can back up by moving the sliding bar at the top of the xine controller, but you can't reverse the movie) and do frame-by-frame advance. These may be available somehow, I just haven't figured out how to use them.
  • I had less luck with mplayer, at least the version from freshrpms.com with the gmplayer interface. It plays the disk, but only in order, I couldn't access the DVD menu. There is, I see, an "mplayer-gui" package available from livna, but there's a dependency conflict between freshrpms' mplayer and livna's mplayer, so I haven't tried that yet. Maybe a better gui would allow me to access the menu.
  • OK, finally, let's back up some data. I bought some DVD+R 16X disks from the local store. I didn't try for the dual layer feature (which is apparently only now being added to k3b), so each disk holds roughly 5GB of data. I was able to fit all of my files onto the disk, with the exception of the MP3s. That's OK, I have the original CDs for all of those, so I don't need a DVD backup. k3b offered to let me burn at 1X, 2X, or 4X. I picked 2X, and pressed the "burn" switch. I didn't time it, but I suspect it took under 30 minutes to burn 4+ GB, which isn't bad at all. I quit K3B, mounted the disk, and looked over random files, including pictures and videos. Everything looked fine.

So, apparently, everything works as advertised. I'm going to order another one of these babies with the Nero software, for the XP machine the family uses. The Windows box really needs a full backup so that I can finally get SP2 installed. I'll post the results for Windows when I get it installed.

OK, I won't say that the NEC drive fits all of your DVD needs, and, as I said, the one I got seems to have been returned at least once. It works for me, though, and it was recommended by a Linux sys-admin who hasn't had any problems with his. So while Your Mileage May Vary, it seems like a cheap way to add DVD capability to your Linux box.

Oops. I'd previously misquoted the price as $59.99. Go back whence ye came.

Tuesday, August 16, 2005

Gee (802.11 version)

A couple of weeks ago Best Buy offered a deal on D-Link DI-524 802.11g wireless routers and D-Link DWL-510 wireless PCI adapters -- $19.95 each, after rebate. I'd wanted to upgrade our home wireless system for some time, as we'd previously been using 802.11b routers, which only have the capability Wired Equivalent Privacy (WEP) encryption as opposed to the stronger Wi-Fi Protected Access (WPA) encryption offered by the 802.11g protocol.

Now, Linux lovers, if you want me to tell you how to get the DWL-510 working, don't look any further, because I haven't the slightest idea. This box is jacked straight in to the back of the DWL-510 (Note added later: Oops! I meant the DI-524), there isn't a wireless internet card on it. This is a saga of getting things to work on an XP box and a Mac.

Well, OK, I did set up the router itself from here. You go to http://192.168.0.1, run the setup Wizard, and change the default "admin" password (there isn't one). Also change the default name of the network from "D-Link" to whatever you choose.

But you're not finished here, yet. Go to Home ==> Wireless and change the security settings so that you are running with:

  • Wireless enabled
  • A new name for the network, if you didn't already change it
  • Whatever channel you want to run on -- I've heard that practically only 1, 6, and 11 are useful, since the channels are very close together and so there is a lot of cross-talk between, say, Channels 4 and 5. The default channel is usually 6.
  • Set Mode Setting to G Mode. The on-board documentation (click on "Help") doesn't tell you about it, but "Mixed mode" would seem to enable both 802.11b and 802.11g protocols, and you don't want that.
  • Turn SSID broadcast (which sends your network name out to the world at large) to disabled.
  • For security select WPA-PSK, "Personal Mode". As I understand it, the stronger pure WPA mode secures each connection individually. That looked to be a pain, so I started, at least, with PSK, which allows you to type in one passphrase which is used by everyone wanting to make a connection to your system.
  • Hit the Apply button and wait for everything to reset.

OK, now the router is configured, and the hard-wired connection to the outside works fine.


Connecting the Mac via wireless was easy. I just temporarily disabled the SSID broadcast on the router, and the Mac found the network right away. Enter the passphrase and we're off and running.


Getting the Windows machine connected was a bit more complicated, since I had to get rid of the old wireless card and install the new DWL-510. OK, unplug everything. Bring the box out where I can open it up. Good God, it's full of dust: the air intake is completely blocked. It's a wonder the whole thing didn't just melt down. Clean it all up, uninstall the old card, open up the box for the new card. See directions that say "Install Drivers Before you install this card." Oops. Ordinarily you can ignore this, but this time installing the drivers first turns out to be a Good Idea.

So plug everything except the old wireless card back into the computer, turn it on, and install the drivers. Ignore the warning about the software not being certified as XP compatible. Turn everything back off, and install the new wireless card.

Turn the computer back on, and let it find the new hardware and finish the software installation. Now here's the important part: in the tray at the bottom right of your screen there will be a little "D". Always use this to work with the card. When you bring up the window associated with the "D", click tabs until you find a box that says something like "Use Windows to configure my wireless network settings". Uncheck this box!! Your interface will change from Window's version to D-Links. Now click on "Configuration" and enter all the stuff needed to match the information you entered for the router. I wish I could help you with this, but the manual provided, like the on-line help for the browser, doesn't seem to know about the WPA and WPA-PSK abilities of the system. So keep clicking buttons that look logical until you find the right setup, and then hit the Apply button. If you need more help, email me and I'll tell you how to send me a plane ticket so that I can help you out.

I do note that the XP is still at Service Pack 1. If we were at SP2 it might be easier to do all of this stuff.

Anyway, the connection now works.

Maybe it's a security issue, but the login connection works a bit strangely under XP. If the first user to log on has the phasephrase set, then everyone logging onto the machine afterward can also use the connection. So if I set up Bob's account to use the D-Link, Mary can use it as well if she logs in after Bob, and, in fact, I can't change Mary's account information at that time. However, if Mary logs in first, she can't use the D-Link until she sets up her account. I suppose this almost makes sense, as it lets different users of the same machine use different wireless networks. What kind of setup would need this is beyond me.


The new system has been installed since Saturday morning, and we've had no signal drops since then. With the old 802.11b system we'd get dropped connections every few hours, so I'd say that the installation is a roaring success. Now I just have to send in those rebate forms.