Losing Windows boot on dual boot Windows/Ubuntu machine
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Losing Windows boot on dual boot Windows/Ubuntu machine
I have been using Ubuntu since 9.04 (now on 10.04). Linux is installed from the CD after Windows has been installed (I have had Vista in the past, now I have Win98 SE). It's a test machine for Win and Linux.
I've noted that the Win boot ability never lasts more than a few months. Directly after a Linux update the Windows entry at boot time becomes "unknown operating system".
In the past I have uninstalled Ubuntu, reinstalled Windows then reinstalled Ubuntu, But is there an easier way? Can I edit a grub record on Linux or similar? And why does this keep happening?
What are you updating? Are you updating the kernel? I'm not an Ubuntu user nor do I use Grub2, but you may have to do an update grub after making these type changes.
What is your windows entry in Grub? /boot/grub/grub.cfg?
What are you updating? Are you updating the kernel? I'm not an Ubuntu user nor do I use Grub2, but you may have to do an update grub after making these type changes.
What is your windows entry in Grub? /boot/grub/grub.cfg?
Do you get output from sudo fdisk -l?
The update is the system update from Update Manager that you are "supposed" to do when it pushes to you.
Here is output from sudo fdisk -l
Code:
Disk /dev/sda: 10.3 GB, 10262568960 bytes
255 heads, 63 sectors/track, 1247 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6b736964
Device Boot Start End Blocks Id System
/dev/sda1 * 1 284 2281198+ c W95 FAT32 (LBA)
/dev/sda2 285 1247 7735297+ 5 Extended
/dev/sda5 285 1225 7558551 83 Linux
/dev/sda6 1226 1247 176683+ 82 Linux swap / Solaris
/boot/grub/grub.cfg does not exist (I am showing hidden files/folders).
For any command (except su -, don't use that at all on Ubuntu) that doesn't work, try sticking "sudo" in front of it. That will get you around Ubuntus lame "security" implementation.
I'm surprised the updates keep affecting you - try "sudo update-grub" to force the search for other operating systems. This will rebuild the boot menu - should be done automatically each update. The config file you are looking for is /boot/grub/grub.cfg - don't edit it directly.
I don't have a Ubuntu systems handy, but the following should show us the relevant parts of that file
Code:
sudo sed -n '/30_/,/30_/p' /boot/grub/grub.cfg
Last edited by syg00; 08-19-2010 at 08:51 PM.
Reason: sudo for Ubuntu commands ... d'oh
What is the status of the machine now? Are you able to boot Ubuntu? but not W98? I would expect that neither would boot if you don't have a /boot/grub/grub.cfg file? Did you install Grub to the mbr with the 10.04 installation? Do you have a menu.lst file in /boot/grub/ direc
tory?
What is the status of the machine now? Are you able to boot Ubuntu? but not W98? I would expect that neither would boot if you don't have a /boot/grub/grub.cfg file? Did you install Grub to the mbr with the 10.04 installation? Do you have a menu.lst file in /boot/grub/ direc
tory?
Thanks. Yes I can boot ubuntu but not W98. Don't recall what I did with 10.04 install but I could boot W98 until recently. I have /boot/grub/menu.lst. Should I attach it?
For any command (except su -, don't use that at all on Ubuntu) that doesn't work, try sticking "sudo" in front of it. That will get you around Ubuntus lame "security" implementation.
I'm surprised the updates keep affecting you - try "sudo update-grub" to force the search for other operating systems. This will rebuild the boot menu - should be done automatically each update. The config file you are looking for is /boot/grub/grub.cfg - don't edit it directly.
I don't have a Ubuntu systems handy, but the following should show us the relevant parts of that file
Code:
sudo sed -n '/30_/,/30_/p' /boot/grub/grub.cfg
Thanks. As expected, the above command can't find grub.cfg.
sudo update-grub can't seem to find W98:
Code:
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.32-24-generic
Found kernel: /boot/vmlinuz-2.6.32-23-generic
Found kernel: /boot/vmlinuz-2.6.32-22-generic
Found kernel: /boot/vmlinuz-2.6.32-21-generic
Found kernel: /boot/vmlinuz-2.6.31-20-generic
Found kernel: /boot/vmlinuz-2.6.28-11-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done
Can Ubuntu be fooled by adding a grub.cfg based on the fdisk -l output?
In your post #5, you indicate that /boot/grub/grub.cfg does NOT exist!
In your last post, you indicate you have a /boot/grub/menu.lst file. This, I would expect to be from an earlier Ubuntu install. Post it here:
you should have a title entry for windows 98 similar to:
title windows98
rootnoverify (hd0,0)
chainloadder +1
It seems your Grub to from Ubuntu 10.04 wasn't successfully installed to the mbr??
In your post #5, you indicate that /boot/grub/grub.cfg does NOT exist!
In your last post, you indicate you have a /boot/grub/menu.lst file. This, I would expect to be from an earlier Ubuntu install. Post it here:
you should have a title entry for windows 98 similar to:
title windows98
rootnoverify (hd0,0)
chainloadder +1
It seems your Grub to from Ubuntu 10.04 wasn't successfully installed to the mbr??
menu.lst attached as menu.txt. It contains
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows 95/98/Me
rootnoverify (hd0,0)
savedefault
makeactive
chainloader +1
Obviously I did not delete grub.cfg. Perhaps that is what has to be recreated?
Vista uses a Microsoft boot loader called "bootmgr". It uses a boot configuration database (BCD) in the "boot" folder of the first primary partition. That database identifies the partition containing the boot manager "bootmgr" and the one containing Windows. There are different ways that it can identify the partitions and usually that is by a serial number or unique ID. Unfortunately things that modify the partition table or master boot record (MBR) can change the serial number since those bytes are in a previously unused part of the MBR sector.
A way around the problem is to change how Windows boot database identifies partitions.
To do that you can use the "BCDEDIT" program in Windows Vista and then enter some commands to change the configuration.
First, you have to start a command prompt as an Administrator. Click on the start menu, then Programs or All Programs. Click on the Accessories folder. Right click on the "Command Prompt" in the menu and then (left) click on "Run as administrator".
To display the current boot configuration you can use this command.
bcdedit /enum all
You can change the device designations for the boot loader and Windows OS to accept whatever partition was used to start the boot manager as a valid Windows partition.
The above will work ONLY if you have the Windows boot manager and the Windows operating system in the first primary partition. If you have Windows in the second, third, fourth or anything other than the first primary partition you should not do this. With some BIOS drive ID substitution in GRUB it is possible to make other partitions work but it's tricky.
Normally Windows makes settings like this, and they depend on the disk serial numbers to identify drive letters.
The misleading thing is that the boot database does not actually contain the drive letter "c:". It contains a disk serial number. If that somehow changes windows will show the device as "unknown" and will no longer boot.
You can find more information and examples on-line by searching for "bcdedit".
If you think that the commands are confusing, many other people including programmers also agree with you.
Windows Setup always puts "bootmgr" and the boot database in the first primary partition on the first hard disk, no matter where you install the Windows operating system. The Windows operating system files may be stored in some other partition as indicated in the boot configuration database.
You may wonder why a device designation is needed for "bootmgr". Although "bootmgr" will always be installed to the first primary partition, that partition might not have the drive designation of c: in Windows. Also, drive "c:" is only valid if Windows knows the partition serial number of some partition as drive letter c. It is possible to move the "bootmgr" and "boot" folder somewhere else, as long as the boot configuration is updated to reflect the correct information. However, you can't tell Windows Setup to install it somewhere else. You have to move the files later after installing Windows.
The things in curly braces are identifiers for boot database (and menu) entries. Some of them have simple aliases like "{current}" but all of them have a unique numeric ID similar to this.
{cbd49292-9d4a-11df-8857-aef606616986}
You can use the mouse copy and paste functions for the command prompt window to avoid typing in the long ID numbers if there is no short alias for an entry.
To see the long versions of IDs even for the commonly used entries use this command.
bcdedit /enum all /v
There are some common aliases defined that you can use.
{bootmgr} The alias for the boot manager's entry {current} The currently booted Windows operating system's entry {ntldr} The entry for the Windows NT/XP boot loader
If you have a Microsoft version of the Windows Vista Setup CD then you can use the command mode of the boot CD to enter BCDEDIT commands even if Windows won't boot from the hard disk. Press F10 at a Setup screen to get into the command prompt. You can find information about the other System Recovery commands on the Microsoft site.
Erik FL, Thanks but I am no longer on Vista. Win 98 is what I now need to boot into , but Ubuntu updates seemed to break boot into Vista same as boot into W98.
Obviously at the moment I can't boot into Windows at all.
i would start over
reformat the drive into two partitions
win 98 ??? is fat32 - right ? or was it able to use ntfs ?
well fat32 will be safe for win98
then ext3 for ubuntu
install win98 on the first partition
with the win 98 bootloader ON THE MBR !!!!
get win 98 working
seeing as there has been NO support for 98 in a very long time i do not think it will be able to run a first update . Ot that the web browser will even work .
install ubuntu to the ext3 partition WITH A /boot partition
install grub/lilo to the boot partition ( the FIRST LINUX partition )
install ubuntu
reboot using the ubuntu install dvd as a rescue disk and after you " chroot /mnt/sysimage"
then fallow any tutorial using dd command
-- something like this --
[code]
dd of=/dev/sda3 if=/ubuntu.bin bs=512 count=1
[code]
copy ubuntu.bin to the win98 C:\\ drive
ubuntu should be able to auto mount a fat partition
and edit the win98 boot.ini
ubuntu should be able to auto mount a fat partition
and edit the win98 boot.ini
Hi
Yes win 98 is FAT32. And it is a hassle getting an update to IE 6 to make the browser and other things work, which is why I don't especially want to do that again. I will say "Win 98 boot time 20 seconds, Ubuntu 10.04 about 50 seconds without installing anything extra." And yes Win 7 is about the same as Ubuntu.
Clearly Ubuntu isn't capable of maintaining boot records properly, so I was really hoping for a way of editing the Linux grub system so it can boot the Win OS that is already there.
Does anything in your proposal prevent Ubuntu screwing this up again? I am not a Linux guru. I expect a distro these days to work with the instructions you see on the screen, not use command lines. Otherwise people just go back to Windows I think, if they want it at all.
Does anyone have the .cfg file I am missing dual booting with some win version that gives me an idea what it should contain?
Edit: If it helps, I can write to the Windows file system from Ubuntu.
Thanks
Last edited by windows22; 08-21-2010 at 10:44 PM.
Reason: I can write to the Windows FS from Ubuntu
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.