Friday 17 August 2012

Detexify

LaTeX

OK, not linux specific, but this seemed an appropriate place to mention what must be the coolest latex tool around: Detexify.  If you can't remember the latex command for a particular symbol, you just draw it in the box and it tells you the command!  It works amazingly well, correctly identifying even my childish squiggles.

Thursday 9 August 2012

Couldn't boot to Windows 2

Ubuntu 12.04 Precise Pangolin
Windows XP
Grub 2

Well, the very day after that post, the problem recurred, almost certainly the result of an update.  This time /boot/grub.d/device.map was not the problem: it was there, but os-prober still couldn't find Win XP.  I decided it was time to just write a static entry.  I created a script /etc/grub.d/29_winxp (so it runs after memtest, but before os_prober), and it looks like this:
#!/bin/sh -e
echo "Adding Windows XP to GRUB 2 menu (29_windxp)" >&2
cat << EOF
menuentry "Microsoft Windows XP (on /dev/sda1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set=root 6EC07F71C07F3E81
drivemap -s (hd1) (hd0)
chainloader +1
}
EOF

The uuid for the Windows drive was found using sudo blkid.  It works, and let's hope it's a durable solution.

Friday 3 August 2012

Couldn't boot to Windows even if I wanted to

Ubuntu 12.04 Precise Pangolin
Windows XP
Grub 2

One of my computers is a dual-boot Linux/WinXP machine, with the two OSs on separate hard drives.  At some point, the Windows option disappeared from the boot-loader.  I don't know why, and, as I don't actually use this machine much (mostly my wife uses it), I'm not entirely sure when.  However, eventually she wanted to boot to Windows, and it wasn't on the menu!

I checked the scripts in /etc/grub.d/ and all looked fine, so I ran update-grub, but no luck.  No error messages, but the os-prober script did not find the Windows installation.  I could mount the NTFS partition, and if I swapped the disk boot order (in the bios) then Windows booted without a problem.  Googling around, I found plenty of people with similar problems, but none quite lined up and none of the solutions worked for me.  I had a quick stab at making a grub script by hand, but it didn't work.

A couple of times I saw references to /boot/grub.d/device.map, a file I did not possess at all.  Obsolete information or a problem with my install?  In any case, it's easy to make one: sudo grub-mkdevicemap.  Now when I ran update-grub, os-prober found WinXP. Problem solved.

By the way, there's a great Grub 2 tutorial courtesy of Dedoimedo.

First Post

I've been using Linux in some form for years, but as a builder and maintainer of Linux systems my skills are pretty basic.  Fortunately, modern distributions are fairly sophisticated and those nice people on the internet are awfully helpful.  But sometimes your problem is sufficiently new (or sufficiently weird) -- or the solution sufficiently fragmented -- that you've got to work it out yourself.  So I decided to start a blog of fixes and discoveries, as a record for myself and a resource for anyone with similar problems.