Fixing grub for dual-boot after 7.10 upgrade

Coding, Operating Systems 2 Comments »

  ubuntu.pngAfter I upgraded my dual-boot laptop’s Ubuntu from 7.04 to 7.10, I’ve noticed that the upgrade overwrote my GRUB settings, so when I boot my machine, I no longer have a choice for booting into WinXP. I know the partition is still there, because Ubuntu 7.10 comes with NTFS read/write capability, and automatically shows a ‘Windows XP’ drive in my devices.

So how do I restore my pretty GRUB menu, and give myself the option to boot into either WinXP or Ubuntu 7.10? Every once in a while, I have to write an install script for a Windows app, so I do need to set this up…

First of all, let’s have a look at the grub menu file. I click on ‘Places’ in my menu, and go to:

Filesystem/boot/grub/menu.lst

I see the file that gives me my menu when I boot! Now there are a lot of helpful comments here, but if I strip the comments out, I essentially see these basic options:

default 2
timeout 5
color cyan/blue white/blue
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=d403f712-7e72-4bc4-af12-0549fbc1624f ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=d403f712-7e72-4bc4-af12-0549fbc1624f ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=d403f712-7e72-4bc4-af12-0549fbc1624f ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, kernel 2.6.20-15-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=d403f712-7e72-4bc4-af12-0549fbc1624f ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet

title Ubuntu 7.10, kernel 2.6.20-15-generic (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=d403f712-7e72-4bc4-af12-0549fbc1624f ro single
initrd /boot/initrd.img-2.6.20-15-generic

title Ubuntu 7.10, memtest86+
root (hd0,2)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

Now that your eyes are glazed over, the important parts are at the top and the bottom. On the bottom of this list, we see the 5 entries that I’m seeing now when my machine boots.

On the top of the list, ‘Default’ says which of the 5 entries will be selected automatically. The entries are always numbered 0, 1, 2, 3, 4… etc. It starts with zero. So the defualt of 2 means that the third choice will be my default. I know, confusing, but that’s how it is.

So no entry here for Windows XP! You can see that the entries have a fairly standard layout though, so let’s put it back in. the grub file already has a helpful guide listed:

# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro

You can look up more info on GRUB works here, but what I’m most interested in is the ‘root (hd0,0)’ line. What this line says is that the root of whatever entry I’m doing is located on (drivenumber/partition). Since I only have one hard drive, I know my entry has to be something like this:

title Windows XP Professional SP2

root (myharddrive,somenumber)

makeactive

chainloader +1

(That last entry lets GRUB pass off the boot process to Windows’ native booter.)

So if I want to list all the partitions on my hard drive, I can give the console a: sudo fdisk -l

And I get this:

Device Boot Start End Blocks Id System
/dev/sda1 * 1 3823 30708216 7 HPFS/NTFS
/dev/sda2 3824 4119 2377620 f W95 Ext’d (LBA)
/dev/sda3 4120 4864 5984212+ 83 Linux
/dev/sda5 3824 4078 2048256 b W95 FAT32
/dev/sda6 4079 4119 329301 82 Linux swap / Solaris

Well this makes sense… I have my first partition as NTFS, that’s Windows XP. I can see I have a few other partitions, mainly a 2GB FAT32 partition that I use as a play area, and my Linux partitions. I only have one hard drive, so my ‘root’ listing has to be (hd0,xxx). Since I want the first partition, I’ll make it root (hd0,0)

So my entry will be:

title Windows XP Professional SP2

root (hd0,0)

makeactive

chainloader +1

I’ll add that entry in, as well as partition out some of the other entries I don’t use. I’ll also name the Ubuntu menu choice something nicer than ‘Ubuntu 7.10, kernel 2.6.22-14-generic’. Now my choices read:

title        Please choose an Operating System
makeactive

title        ———————————
makeactive

title        Windows XP Professional SP2
root        (hd0,0)
makeactive
chainloader     +1

title        Ubuntu 7.10 Gutsy Gibbon
root        (hd0,2)
kernel        /boot/vmlinuz-2.6.22-14-generic root=UUID=d403f712-7e72-4bc4-af12-0549fbc1624f ro quiet splash
initrd        /boot/initrd.img-2.6.22-14-generic
quiet

Now one very important thing: my default is still set to ’2′, which means the title = 0, dotted line = 1, WinXP = 2, and Ubuntu = 3.  I changed my default to 3, so Ubuntu automatically boots up.  You might want to have WinXP boot, it’s your choice, just get the number right.
Also, if you want a shorter boot time, you can change ‘timeout’ to 5 like me, or leave it on 15 seconds or whatever grub’s default time is.

…and that’s it!  When I boot my machine, I get a nice, clean menu that looks like this (except the dotted line is exactly the same width as the ‘Please choose…’ line:

Please choose an Operating System
———————————
Windows XP Professional SP2
Ubuntu 7.10 Gutsy Gibbon

Ubuntu is selected by default, and if I don’t do anything for five seconds, Ubuntu boots.

Ubuntu better than ever

Operating Systems No Comments »

I switched to Ubuntu about 8 months ago or so, and really started using it full-time about 6 months ago. As the sole IT person for an organization of 1200 users, 420+ WinXP machines, and three server centers, I can easily say that administrating everything out of 7.04 has been a breeze. I’ve been reading up on 7.10, and can say that Ubuntu is easily rivalling Windows and OSX in terms of average-user functionality.

Whoa, whoa! I said average-user. Yes, I still have a WinXP gaming machine at my house for Team Fortress 2, Portal and Battlefield 2. However, reports are already coming out that Steam (Portal and Team Fortress 2) successfully runs under WINE. With the eye candy like Compiz Fusion, 7.10 now looks as good, or better than, Windows Vista, with a fraction of the overhead. What will be interesting to see is the gaming performance on 7.10 under WINE vs. on Vista with its inherent resource demands.

The features I see as the most valuable happen to be the most boring, but they’re:

  • Ease of use in finding drivers for your hardware
  • One-click server setup for common sevrer roles like File/Print servers, DNS, Web server, etc.
  • NTFS support, which will GREATLY help introduce 7.10 machines to Windows-based networks.

All in all, you can try out 7.10 without having to erase anythimg. Simple burn a CD, but it in the drive, and restart your machine. You can check it out before you take the plunge. Perhaps the next time you’re going to consider re-installing Windows 2000 on that old machine you’ll consider 7.10, or when you’re re-installing WinXP, go for a dual-boot setup. or maybe even just go for it and order an Ubuntu machine direct from Dell!

Check this link out for a tour of the full features of 7.10:

Finishing my Master’s

Audio & Video, Web 4 Comments »

So this Saturday I have to have my final capstone presentation done to get my Master’s Degree in Info. Sys. Mgmt. The Saturday after that the 50-80 page paper is due. I’m going a bit nutty getting it all done. I took a StumbleUpon break and came across this… video? Let me know what you think. I like it!

TiVo adds advanced search to WishLists

Audio & Video, Hardware, Home & Auto 2 Comments »

tivo-1.jpgThis is great – for those of you who have had the life-changing experience of owning a TiVo, things just got a lot better. TiVo has added bolean search to their wishlist management.

What this means is that while in the past, you were stuck choosing either to record:

  • Any show named ‘Mythbusters’, or
  • Any showing that listed ‘Adam Savage’, or
  • Any showing that listed ‘Jaime Hyneman’, or
  • Any showing on channel 48 at 9pm…
  • (etc)

You can now use AND, OR or XOR…which TiVo calls ‘This and that’, ‘This or that’, and ‘This but not that’. So if you’re a big fan of the Mythbusters, and want to see where they pop up elsewhere other than on the show, you can record Mythbusters Wednesday nights, but you can also make a WishList to record shows where the title has the keywords ‘Jaime Hyneman’ AND ‘Adam Savage’.

Other uses for this might be if you’re a NASCAR fan and want just the races. You could choose keyword = ‘NASCAR’ AND category = ‘Auto Racing’. That way, you get the races and none of the NASCAR talk shows.

Or maybe you want all showings where title = ‘Late Night with Conan O’Brien’ and keyword = ‘Andy Richter’, and nostalgicize about the old days.

A few notes, however: (TiVo this is your homework)

  1. I could add multiple items, but had no way to select ‘AND’ or ‘OR’. It just shows a dot between the keywords, so I’m at a loss as to what that means. No idea where I can choose the ‘This but not that’. I have a pretty non-standard TiVo unit (Toshiba TiVo/DVD player), but that seems like a major voyage of the failboat on TiVo’s fault. Too difficult to have a lab with all the models in it to test feature rollouts?
  2. TiVo’s database is terrible. It seems that I can only choose from actor’s names that will be on shows in the next few weeks. How hard could it be to give imdb.com a ring and work out a linkup? For example, I put in ‘Carolla’, and no listing for Adam. So no luck for people who want to catch Adam on any rare rerun of the Man Show? I realize his other shows aren’t in the rotation these days, but at least give people the capability to toss that net out there just on the offchance that they’re reshown at 3am some day.

WordPress Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in