Bug #441941: grub fails after running Windows

Asked by Fredrik Aberg on 2010-09-10

Hi ,
I have installed Ubuntu 10.04 on my hp/compaq 8710 p laptop, on a live cd directed partition. XP was already present. initially booting into either os was fine, but that doesnt work any more, only booting from ubuntu live cd. Re installing GRUB2 only resulted in one, successful reboot. What to do ? I have limited computer skills.

Thank You

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Last query:
2010-09-12
Last reply:
2010-10-17

Hi! If I understood your problem correctly, you installed Ubuntu using a Live CD. This is dual-boot since you see two operating systems -- Ubuntu and Windows XP. Now, after some things were changed, you only see Ubuntu? Is that right?

Fredrik Aberg (f-aberg) said : #2

Hi,

Here is what happened; installed ubuntu 10.04 on a partition that the live cd set up. xp present pre-install. Re-booted xp once ubuntu once. next day after shutdown neither ubuntu or xp could be booted up. Following error messages; "no module name found. Aborted. Press any key to exit" then "Non system disk or disk error. replace and strike any key when ready".
After that I could only start from live cd. From there i tried to reinstall GRUB2 from the live cd using terminal. rebooted and could see both os, choose xp that booted without problem, fully functional. thought I had solved the problem. Restarted the laptop, same error messages as before. Someone suggested to disable hpqwmiex.exe i services, but since i can not boot windows...
Like i mentioned my computer skills are, to put it mildely, limited. appreciate any help.

Thank You

I believe what happen now after trying to reinstall GRUB2 is it messed the master boot record such that you can't boot to either one of the operating system you have. The file hpqwmiex.exe is a component by HP not related to dual-booting.

Anyway, when you run using Live CD, does it detect the hard drive? Do you see your files? Do you see the WINDOWS directory?

bcbc (bcbc) said : #4

Here's an article that might explain what you are seeing. In short, some windows apps use areas of the master boot record to store information and this can break grub2:
http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/debian/2010-08-28-windows-applications-making-grub2-unbootable.html

If you cannot identify and prevent the program that is doing this then perhaps installing grub-legacy is a workaround. (http://ubuntuforums.org/showthread.php?t=1298932)

Fredrik Aberg (f-aberg) said : #5

I see both the 241 GB file system folder (windows) and the 5.4 GB file system folder (ubuntu) in program files file browser

delance (olivier-delance) said : #6

On some HP computers, each time you boot Windows, it overwrite MBR (first sector of disk, which manage boot on hard disk). In this case, you have to disable a HP software.
If after installation of Ubuntu you can boot both OS, but not after having booted Windows, you are in this case. See post #10 of
     https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/441941

Fredrik Aberg (f-aberg) said : #7

How do I reach add/remove programs in windows from my ubuntu live cd ?  As it is now I can only use my laptop from the ubuntu live cd, XP doesnt boot. Is there another way to uninstall HP credential manager, HP protect tools ? Im a newbie to ubuntu and average to computer use in general.

Thank You

Fredrik

--- On Sun, 9/12/10, delance <question12482from <email address hidden>> wrote:

From: delance <email address hidden>
Subject: Re: [Question #124821]: XP ubuntu boot problem
To: <email address hidden>
Date: Sunday, September 12, 2010, 6:08 PM

Your question #124821 on grub2 in ubuntu changed:
https://answers.launchpad.net/ubuntu/+source/grub2/+question/124821

    Status: Open => Answered

delance proposed the following answer:
On some HP computers, each time you boot Windows, it overwrite MBR (first sector of disk, which manage boot on hard disk). In this case, you have to disable a HP software.
If after installation of Ubuntu you can boot both OS, but not after having booted Windows, you are in this case. See post #10 of
     https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/441941

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/ubuntu/+source/grub2/+question/124821/+confirm?answer_id=5

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/ubuntu/+source/grub2/+question/124821

You received this question notification because you are a direct
subscriber of the question.

delance (olivier-delance) said : #8

Please don't post with previous message.
Usually people having this bug boot directly into Windows, so I'm not sure it's the right problem.
Only way I see is to reinstall Grub2, and boot after on Windows.

Fredrik Aberg (f-aberg) said : #9

As stated in previous e-mail I reinstalled Grub2 but it only worked in one reboot...

delance (olivier-delance) said : #10

OK.
1) Boot on Ubuntu CD, choose option "Try but don't install",
Open a terminal and type
         sudo parted -l
where "-l" is lowercase "-L", and post result
Check also is Ubuntu partition is active.
2) When you boot from hard disk, did you see Grub menu; allowing you to choose between Linux and Windows ?

If you want to restore temporarily XP, you will have to use Recovery CD, and to ask MBR recovery.

delance (olivier-delance) said : #11

By thinking on another question, I remember a workaround to be able to work before problem is really solved. You can install Grub on a USB key. If problem is related to XP writing on disk MBR, you will avoid problem. This solution is sometimes used as workaround for RAID or LVM configuration.

Fredrik Aberg (f-aberg) said : #12

Sudo parted -l results in:

fredrik@fredrik-laptop:~$ sudo parted -l
[sudo] password for fredrik:
Sorry, try again.
[sudo] password for fredrik:
Model: ATA ST9250827AS (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
 1 32.3kB 241GB 241GB primary ntfs boot
 2 241GB 244GB 3368MB primary ntfs
 3 244GB 250GB 5690MB extended
 5 244GB 250GB 5388MB logical ext4
 6 250GB 250GB 301MB logical linux-swap(v1)

Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0
has been opened read-only.
Error: Can't have a partition outside the disk!

fredrik@fredrik-laptop:~$

i now nothing about programming, so putting Grub 2 on a memory stick was nothing for me, but
I downloaded an iso of "supergrub2" burned a cd and rebooted, this worked on several reboots on both XP and ubuntu !
These are the messages i get;
-Detect any GRUB2 configuration file
-Load grub.cfg from ubuntu 10.04.1 LTS
-Then i choose Ubuntu with linux 2.6.32-24-generic which then boots

delance (olivier-delance) said : #13

Is your problem solved ?

Fredrik Aberg (f-aberg) said : #14

I guess its solved when I dont have to boot form the supergrub2 cd... Since i now can open up xp should i uninstall the HP credential manager and HP protecttools ?

You can always download and reinstall those two from the HP website. If you don't use it often, you should uninstall then.

Fredrik Aberg (f-aberg) said : #16

I uninstalled the HP credential manager and HP protecttools, but I still need the supergrub2 CD to boot up either XP or ubuntu.
Any other file that interferes with boot that I can get rid of ?

delance (olivier-delance) said : #17

Hello,
If your issue is closed, please mark question solved.
Else I should have some time next week to help you.

delance (olivier-delance) said : #18

Hello, if you have still issue, I have a solution with making a new small partition.

Fredrik Aberg (f-aberg) said : #19

I still use supergrub2 from CD to start either xp or ubuntu. It works, but is inconvenient. Please tell me step by step (since I have limited computer skills) if You have a better solution !

Thank You

delance (olivier-delance) said : #20

I did it on a virtual machine at beginning of week.

1) Boot on a Ubuntu CD
2) Choose "Try without install"
3) System->Administration->Gparted
4) Reduce a primary partition to free at least 32kB (I don't know if it works in a logical partition, so I chose main Windows partition)
5) In free space, make a partition without any file system (and so no mounted point), and note its sdX name.
6) Reinstall Grub in this partition following :
     https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD , but in a partition
    If you make free space at end of: sda3 (2nd partition)
        sudo fdisk -l # to check new partition is sda3, not sure
        sudo mount /dev/sda3 /mnt
        sudo grub-install --root-directory=/mnt/ /dev/sda3 # don't bother about warning, you need really installing in a partition and not hard drive
7) Shutdown, remove CD and reboot.

Fredrik Aberg (f-aberg) said : #21

I tried to install exactly as described above in new partition (sda4) got error message about blocklists and --force.
What did i miss ? something important obviously, can I read some ubuntu for dummies or something at this stage im only wasting others and my own time.

delance (olivier-delance) said : #22

I think you will not found solution in "some ubuntu for dummies" as this issue is hard for gurus!
And it's my fault. I read too fast thread.
You have to make space at end of second partition, which is sda2 and not sda3.
In which partition did you get free space: second one or third one in initial configuration ?
Can you post again result of command "sudo parted -l" ?

Fredrik Aberg (f-aberg) said : #23

I resized the main partition dev/sda1 and the new partition was named dev/sda4 by gparted.

fredrik@fredrik-laptop:~$ sudo parted -l
[sudo] password for fredrik:
Model: ATA ST9250827AS (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
 1 32.3kB 237GB 237GB primary ntfs boot
 4 237GB 241GB 3858MB primary ext3
 2 241GB 244GB 3368MB primary ntfs
 3 244GB 250GB 5690MB extended
 5 244GB 250GB 5388MB logical ext4
 6 250GB 250GB 301MB logical linux-swap(v1)

Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0
has been opened read-only.
Error: Can't have a partition outside the disk!

fredrik@fredrik-laptop:~$

delance (olivier-delance) said : #24

6) Reinstall Grub in this partition following :
     https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD , but in a partition
    If you make free space at end of: sda1 (1st partition)
        sudo mount /dev/sda4 /mnt
        sudo grub-install --root-directory=/mnt/ /dev/sda4 # don't bother about warning, you need really installing in a partition and not hard drive

N.B. you used 3858MB for sda4 but need less than 1MB

Fredrik Aberg (f-aberg) said : #25

Still doesnt work, here is what I get

ubuntu@ubuntu:~$ sudo mount /dev/sda4 /mnt
mount: /dev/sda4 already mounted or /mnt busy
mount: according to mtab, /dev/sda4 is already mounted on /mnt
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/mnt//dev/sda4
install_device not specified.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.

  -h, --help print this message and exit
  -v, --version print the version information and exit
  --modules=MODULES pre-load specified modules MODULES
  --root-directory=DIR install GRUB images under the directory DIR
                          instead of the root directory
  --grub-setup=FILE use FILE as grub-setup
  --grub-mkimage=FILE use FILE as grub-mkimage
  --grub-probe=FILE use FILE as grub-probe
  --no-floppy do not probe any floppy drive
  --recheck probe a device map even if it already exists
  --force install even if problems are detected
  --disk-module=MODULE disk module to use

INSTALL_DEVICE can be a GRUB device name or a system device filename.

grub-install copies GRUB images into /boot/grub (or /grub on NetBSD and
OpenBSD), and uses grub-setup to install grub into the boot sector.

If the --root-directory option is used, then grub-install will copy
images into the operating system installation rooted at that directory.

Report bugs to <email address hidden>.
ubuntu@ubuntu:~$ sudo mount /dev/sda4/mnt

delance (olivier-delance) said : #26

There is a space between /mnt/ and /dev/sda4

Fredrik Aberg (f-aberg) said : #27

does not work;
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@ubuntu:~$ sudo mount /dev/sda4 /mnt
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/mnt/ /dev/sda4
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and its use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use --force.
ubuntu@ubuntu:~$

I then shutdown, remove cd and reboot as described I now have space between /mnt/ and /dev/sda4
but does not work

delance (olivier-delance) said : #28

I will reproduce this week-end at home what I did last time.

Can you help with this problem?

Provide an answer of your own, or ask Fredrik Aberg for more information if necessary.

To post a message you must log in.