Thursday, May 31, 2007

The Ubuntu SATA Bug

If you recently did the Ubuntu Feisty Fawn maintenance upgrade of the kernel from 2.6.20-15 to 2.6.20-16, your system probably doesn't work: in previous versions of the kernel, all your SATA disk drives were considered to be SCSI drives, and so the partitions were mapped to /dev/sda1, /dev/sdb2, etc. 20-16 breaks this, considers the disks to be IDE drives, and tries to map them to /dev/hda1, /dev/hdb17, and so on.

Fortunately, there's a quick, if temporary, fix: when you boot up your computer, hit the ESC key as soon as you see the message about “grub”. Then use the arrow keys to select the 2.6.20-15-generic kernel. Proceed with boot and all will be well.

You can edit the /boot/grub/menu.1st file to make the 20-15 kernel the default. I'd advise that if you have non-geeks using the computer.

Presumably a fix will be along in a few days, version 20-17 of the kernel. When this is installed you may have to edit your menu.1st file to make the new kernel the default.

Sigh. Things like this happened occasionally with Fedora as well. I hope there aren't too many newbies scared away because they think Ubuntu broke their computers.

Friday, May 18, 2007

Do People Really Read the Links They Click?

Apparently not ...

Hundreds Click on 'Click Here to Get Infected' Ad

And only 2% of them were non-Windows using geeks wondering what would happen if they pressed the button.

(This would have been a This Week's Sign ..., but that award has been retired until we find something better than O.J.)

Saturday, May 12, 2007

Secure File Deletion

During the recent Windows unpleasantness I borrowed a couple of old disk drives to backup data on the “broken” disk — it was only broken under Windows, I could read it quite easily in Linux, but never mind. Now that everything's fixed, I want to give the drives back. The problem is that they have personal data on them, so I want to delete it all before I give it back.

This isn't as easy as it seems, since files leave traces all over. Fortunately, the folks at the Stanford Linear Accelerator Center (SLAC) have put together a guide to Secure Erase in UNIX, which also works in Linux.

I'm not going to repeat all the article. Just note that you need:

  • shred, which does secure file erasure by repeated rewrites followed by deletion, and comes by default in Ubuntu
  • scrub, which erases the free space in your file system by filling it up with a large, random file, which you then delete (with shred, if necessary). This isn't a standard file, you have to download and compile it.

Ideally, one would delete everything on the disk in question in the following way:

$ cd /media/disk # or wherever the thing is
$ sudo rm -fr * # delete all files and directories recursively
$ scrub -X junk # Fill up the whole disk with junk
$ shred --remove junk # rewrite several times, then delete

The difficulty is that the disk I used has a VFAT file system, so the biggest file that can be written is 4 GB. I just wrote

$ scrub -X junk
$ scrub -X junk1
$ scrub -X junk2

etc., until the disk was filled up, then ran

$ shred --remove junk*

If you are using a journaling file system other than ext3, there are some other issues involved, but for VFAT or ext3 this is a good way to go.

26 July 2009: Replaced the old link to scrub, which generates a 404 error, by the link https://computing.llnl.gov/linux/scrub.html, as noted by the first commenter. You can also download scrub directly from sourceforge at http://sourceforge.net/projects/diskscrub/.

Thursday, May 10, 2007

A Firefox Annoyance

Just because software is highly rated, open source, and generally better than the opposition doesn't mean that it can't be annoying.

Case in point, Firefox. I clicked on a PDF link and got a message which, paraphrased, was:

The file /tmp/foobar.pdf could not be opened because the helper application was not present.

OK, the helper application I used before the upgrade was Acroread. I haven't bothered to load up the binary as yet, so, indeed, it's not present in the system. This should be easy to fix, but when I go to Edit=>Preference=>Content, and click the “Manage” button after “Configure how Firefox handles certain types of files” I don't see PDF files. Even though Firefox admits that there should be an application.

All is not lost, though it's pretty hard to find. To fix this bug,

$ cd ~/.mozilla/firefox/insertyoursetofrandomnumbershere.default
$ grep "acroread" *

Which returns, in my case

mimeTypes.rdf:                   NC:path="/usr/bin/acroread"
mimeTypes.rdf:                   NC:prettyName="acroread" />

Kill Firefox. Edit the mimeTypes.rdf file. In my case I replace acroread by evince, but you can use xpdf or even gv if you like. Restart Firefox. Click on a PDF link. It should come up.

Problem solved, but it's not something I should have to do this way.

Monday, May 07, 2007

Hal's Turn for Feisty

(Not that long ago, I poked a bit of fun at Windows, counting all the steps necessary to restore a Windows XP system. Then I turn around and post this. However, note that you have a working system, including a complete office suite, just at the point below where you see the line across the page. Everything beyond that is what I consider essential to a computer system. Your mileage may vary. Taxes, tags, and ammunition extra. Offer not valid it Redmond, Washington.)

Having installed Ubuntu's brand new Feisty Fawn (aka 7.04) Release on Hal's Evil Twin and Hal's Other Twin, it's time to work on Hal.

Since my last install, of Dapper Drake (6.04), I've added a honkin' big disk drive which now holds my /home directory. As a result, the 60 GB boot drive has a lot of space on it that can profitably be used for things other than data storage.

Before we begin, of course, back up everything. Then I pulled the plug from my big /home drive so I wouldn't accidentally overwrite anything on it.

Next it's time to repartition the drive. Geeks repartition drives the way some people rearrange furniture: it's always a good time to do it, especially if you have someone else move everything. My someone else is the extremely useful GParted, a graphical interface for partitioning disks. After much thinking about things, I'm doing the breaking the disk up like this (note that Feisty now pretends that everything is a SCSI disk, even when it's not, so what was /dev/hda is now /dev/hdb):

Partition Mount Point Type Size Description
/dev/sda1 / ext3 15 GB Mount point for Feisty
/dev/sda2 /home ext3 15 GB For now, the user's home directories, which will eventually be moved to the other disk. In the future, this will be where I install another OS, say the next version of Ubuntu, or Slackware, or even that thing Microsoft sells. For now, it will hold a /scratch directory.
/dev/sda3 swap Linux-swap 1 GB Swap space, on the general rule that you should have twice as much swap as you have memory. This is actually at the bottom of the disk drive, but it's sda3 because I installed it before I installed:
/dev/sda4 Extended Extended Partition, which holds:
/dev/sda5 /usr/local ext3 10 GB OK, most people won't need this much space, but I tend to put a lot of programs into /usr/local, and I don't like running out of space.
/dev/sda6 /opt ext3 Approx. 12 GB Some third party programs, such as the Intel Fortran compiler, use this space. Having it in a separate partition means I won't have to install multiple copies for multiple distributions, and I can always create a /opt/scratch directory.

Commit to all of this, eject the GParted live CD, and put in the Ubuntu Live CD. And away we go:

  • As I mentioned before, when you do what Ubuntu calls a “Manual Partition” of the drive, it rescans the disk drive every time you click the mouse, which is more than a trifle annoying.
  • Somewhat scary: the first time I rebooted after the install, I got a blank screen. It seems to be OK now, though. Interestingly, when Hal's Other Twin boots up, I get a nice not-all-brown Ubuntu Logo on the screen, along with a log of what's happening. When Hal and Hal's Evil Twin boot up, I get a blank screen until the login screen magically pops up. Probably there is a setting to fix this, I'll try to find it later.
  • Run update manager. Looks like the default installation has 15 updates since the release date which was, what, two weeks ago? Of course, many of those aren't security related.

  • Now install a bunch of things that the default install leaves out. This, of course, is the problem with installing from a live CD, in that you don't get much choice. However, the synaptic interface is pretty easy to use, so let's go ahead with it. Forgive me if I don't link to the home page for all of this software. Also forgive me if I occasionally mistype. I have a cat on my lap.
    Useful references include:
    The Unofficial Ubuntu 7.04 (Feisty Fawn) Starter Guide
    and
    Ubuntu Tips and Tricks from Linux Magazine (registration required, consider BugMeNot.com).

    In more or less alphabetical order:
    • a2ps: Nicely formats many-page-to-one output.
    • Abiword: Word processor, starts up faster than OpenOffice.org.
    • amarok, mplayer, vlc, xine, xmms: Listen and Watch Stuff.
    • apt-file: Enhance the capabilities of the Debian file system. Run
      $ sudo apt-file update
      once you install it.
    • build-essential: Installs things you might need to compile programs: e.g., g++
    • Celestia: Interstellar astronomy.
    • checkinstall: Converts the “make install” command into a .deb file.
    • EMACS: The One True Editor.
    • Frozen Bubble: I have no idea why I like this game.
    • fvwm (Gnome version): My favorite window manager.
    • g77: Not as powerful as the Intel Fortran compiler, but it's open source, and adheres to the standard. And if you ask why I'm still using Fortran 77, it's just because, OK?
    • gnumeric & sc: Spreadsheet programs. Often more useful than the one in OpenOffice.org.
    • gnuplot: Not only does it plot, it does non-linear curve fitting (non-linear regression to you statistics types).
    • grip: Rip stuff.
    • gv & xpdf: Viewing postscript and PDF. Old, but serviceable.
    • IEs4Linux: Not a Ubuntu package. This uses WINE (see below) to run Internet Explorer on your Linux box. Well, IE 5 or IE 6, not IE 7, because you'll never pass the Microsoft Genuine Advantage test. But it does show you how your web page looks to those with really bad browsers.
    • Imagemagick: Image manipulation.
    • k3b: Burn CDs and DVDs.
    • kdegames: Occasionally I waste time at the computer.
    • lavaps: '70's funk method for looking at the activity on your computer. I put it in the FVWM ButtonBar.
    • libgnome-dev: Provides some library header files needed to compile older programs not included in Ubuntu, e.g., Electric Eyes.
    • lynx: Text-based web browser, originally developed at KU.
    • mailutils & msmtp: mostly to enable me to send mail from the command line.
    • Mozilla-Thunderbird: My favorite mail client.
    • PlanetPenguin Racer: The old Tux Racer, done up in open source.
    • RealPlayer: This used to be available in Canonical's “Commercial” repository, but it's not yet available for Feisty. So go to the Helix Community download site, download HelixPlayer or RealPlayer, depending on your level of purity, and install. I put mine copy in /home/local/RealPlayer. Then you must link the mozilla plugins to firefox and mozilla:
      $ sudo -i
      # cd /usr/lib/firefox/plugins
      # ln -s /home/local/RealPlayer/mozilla/* .
      # cd /usr/lib/mozilla/plugins
      # ln -s /home/local/RealPlayer/mozilla/* .
      

      and then remember to add the rtsp protocol to Firefox.
    • sox: Convert sound files from one type to another. This version, like the one in Dapper, doesn't have full mp3 support, so I'll have to compile it myself, later.
    • spider: The best two-deck solitaire game — ever.
    • sysv-rc-conf: Curses-based program that lets you control which programs start at a given runlevel. Useful to stop the computer from checking for Bluetooth devices when you know that there are none.
    • tcl and tk: For simple widgets.
    • tcsh: My favorite shell.
    • tetex, revtex: TeX and LaTeX, for document production
    • tidy & ftnchek Syntax checkers for HTML and Fortran files, respectively.
    • wine: Just in case I want to try running a Windows program. Some version of IE might be nice, to check out web pages.
    • xnetload: Graphical rendition of network activity. Another FVWM ButtonBar import.
    • xpaint: Old, but quite useful, paint program.
    • xscreensaver: More fun than your average screensaver.
    • Check out the Unofficial Ubuntu 7.04 (Feisty Fawn) Starter Guide for more fun things you can add.
    • I've probably forgotten a bunch of stuff, when I remember them I'll add them to this list.
  • Create accounts for other users on the machine.
  • Turn off the computer, plug in the big disk drive, reboot.
  • Edit fstab to mount the new disk drive as /home. Note that since Ubuntu pretends that the drives are SCSI, so new drive is /dev/sdb, rather than /dev/hdd.
  • Reboot (or unmount/mount) and check everything over.
  • As root, change the ownership of each account in the new /home directory so that it belongs to the appropriate user, e.g.
    # chown -R dave:dave /home/dave
  • Done. Well, more or less. I could go on forever, of course, because I true Geek's computer is never exactly right. I'll add to the list as I think of things.

Thursday, May 03, 2007

Click & Clack in a Pod

Unlike Prairie Home Companion, NPR's Car Talk now makes it easy to download an MP3 version of the latest show: Just go to the Car Talk Podcast page, search for the MP3 button, and download the file.

A nice, simple way to do it, Garrison.

Oh, NPR has a directory of all its podcasts that's worth checking out.