Using Windows boot manager and updating

A while ago, I posted a guide to setting up the Windows boot manager to boot linux.  That works by copying the linux boot sector to a file, and configuring windows booting to use that file as a boot sector image.

A problem arises if grub is reinstalled, as it will be on an update to a newer linux version.  For, in that case, the file that Windows boot manager is using will contain stale information.  This post is about how to deal with that situation.

This very problem came up for another user today, who posted a request for help at opensuse forums.  I have often enough been solving this “problem” for myself, but I never thought to post the details.

This post will assume that you have read my earlier post (see link at the top of this message) on setting up the Windows boot manager.  Part of that setup was to create a file, which I called “bootsect.lnx”, that has a copy of the boot sector.

What is needed, after an update to grub, or an update to your linux version (which probably includes updating grub), is to refresh that file “bootsect.lnx”

The command that I recommended to create that file was:

dd if=/dev/sda1 of=bootsect.lnx count=1

where “/dev/sda1” must be replaced with the path to the device file where grub was installed (usually the partition for root or the partition for “/boot” or the extended partition).

All that is needed, is to repeat that command.  Before repeating that command, you must be root, and you must be in the directory containing that file “bootsect.lnx”.

In the worst case scenario, you have just updated your linux version, and now it won’t boot from the Windows boot manager.  You might have to boot from a live CD, or boot an install DVD to rescue mode.  Then, from a root terminal session, you must mount your windows partition.  In my case, the Windows partition is /dev/sda3, and is formatted as NTFS.  So I would use

mount -t ntfs-3g /dev/sda3 /mnt
cd /mnt

You can probably omit the “-t ntfs-3g” and the mount command will usually get that right anyway.  The commands just given (changing the device name as needed) should put you in the Windows main directory.  It is a good idea to use “ls” to make sure that you are in the directory with that sector copy file (the file “bootsect.lnx” if you followed my example name).

Then run the suggested “dd” command, reboot to windows, and test whether the windows boot manager now works as expected.



Tags: ,

About Neil Rickert

Retired mathematician and computer scientist who dabbles in cognitive science.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: