LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 08-18-2010, 02:51 AM   #1
windows22
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Rep: Reputation: 15
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?


Thanks
 
Old 08-18-2010, 03:24 AM   #2
John VV
Guru
 
Registered: Aug 2005
Posts: 12,602

Rep: Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677
??? can win 98 even run on the same computer as ubuntu 10 ?

dose grub2 even support win 98 ?

did you add the boot partition for 98 to grub ? (hd0,0) I am assuming

what is the output of
Code:
su -
fdisk -l
 
Old 08-19-2010, 12:42 AM   #3
windows22
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by John VV View Post
??? can win 98 even run on the same computer as ubuntu 10 ?

dose grub2 even support win 98 ?

did you add the boot partition for 98 to grub ? (hd0,0)
I just follow the instructions to dual boot with Windows that come with the Ubuntu CD. As I said, same problem with Vista.

Quote:
Originally Posted by John VV View Post
what is the output of
Code:
su -
Authentication failure even after running sudo to do something

Quote:
Originally Posted by John VV View Post
Code:
fdisk -l
No output at all.

can someone help further. Note that Windows doesn't disappear after running Windows but after running Ubuntu where an update has occurred.

Thanks
 
Old 08-19-2010, 10:25 AM   #4
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,467

Rep: Reputation: 691Reputation: 691Reputation: 691Reputation: 691Reputation: 691Reputation: 691
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?
 
Old 08-19-2010, 04:31 PM   #5
windows22
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by yancek View Post
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).

Thanks

Last edited by windows22; 08-19-2010 at 04:33 PM.
 
Old 08-19-2010, 07:09 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,050

Rep: Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971Reputation: 971
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
 
Old 08-20-2010, 10:16 AM   #7
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,467

Rep: Reputation: 691Reputation: 691Reputation: 691Reputation: 691Reputation: 691Reputation: 691
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?
 
Old 08-21-2010, 12:37 AM   #8
windows22
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by yancek View Post
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?
 
Old 08-21-2010, 12:46 AM   #9
windows22
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
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?
 
Old 08-21-2010, 01:47 PM   #10
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,467

Rep: Reputation: 691Reputation: 691Reputation: 691Reputation: 691Reputation: 691Reputation: 691
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??
 
Old 08-21-2010, 05:47 PM   #11
windows22
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by yancek View Post
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?

Thanks
Attached Files
File Type: txt menu.txt (7.2 KB, 4 views)
 
Old 08-21-2010, 06:28 PM   #12
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 793

Rep: Reputation: 245Reputation: 245Reputation: 245
You are experiencing a common problem with Vista.

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.

bcdedit /set {bootmgr} device boot
bcdedit /set {current} device boot
bcdedit /set {current} osdevice boot


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.

bcdedit /set {bootmgr} device partition=c:
bcdedit /set {current} device partition=c:
bcdedit /set {current} osdevice partition=c:


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".

Also, the program has built-in help.

bcdedit /?
bcdedit /? /set
bcdedit /? types
bcdedit /? formats


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.

bcdedit /set {bootmgr} device partition=c:
bcdedit /set {current} device partition=d:
bcdedit /set {current} osdevice partition=d:


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.
 
1 members found this post helpful.
Old 08-21-2010, 08:57 PM   #13
windows22
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Original Poster
Rep: Reputation: 15
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.
 
Old 08-21-2010, 09:58 PM   #14
John VV
Guru
 
Registered: Aug 2005
Posts: 12,602

Rep: Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677Reputation: 1677
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

like you would for xp

this uses the windows bootloader to start grub
 
Old 08-21-2010, 10:15 PM   #15
windows22
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by John VV View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to upgrade Windows Vista to Windows 7 on a Dual Boot machine Ubuntu/Winvista. hector3rd Linux - Desktop 6 08-07-2010 05:33 PM
Booting to Windows 7 from Ubuntu on my dual-boot machine dor Linux - Newbie 3 05-31-2010 02:26 AM
help! dual boot related, cannot boot windows any more, ubuntu is ok parv Ubuntu 16 04-10-2007 12:29 AM
windows boot slow on dual boot machine fobster Linux - Newbie 4 04-21-2006 07:58 AM
Windows on to linux machine dual boot chplat Fedora 2 01-18-2005 03:12 AM


All times are GMT -5. The time now is 02:51 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration