fatal error on grub-install (hd0) related to partition type

Bug #180089 reported by Raoul Bhatia
8
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: ubiquity

installing on an existing partition, grub throws an error and the installer exists.

the reason seems to be, that i had the wrong partition type (i formatted an ntfs volume with ext3 via the installer).

$ sudo sfdisk -d /dev/hda

# partition table of /dev/hda
unit: sectors

/dev/hda1 : start= 63, size= 39070017, Id= 7, bootable
/dev/hda2 : start= 39070080, size= 19535040, Id=7
/dev/hda3 : start= 58605120, size= 19551105, Id=83
/dev/hda4 : start= 0, size= 0, Id= 0

so wrong is:
/dev/hda2 : start= 39070080, size= 19535040, Id=7
correct is:
/dev/hda2 : start= 39070080, size= 19535040, Id=83

/var/log/syslog:
Jan 3 15:15:17 ubuntu grub-installer: info: Installing grub on '(hd0)'
Jan 3 15:15:18 ubuntu grub-installer: info: grub-install supports --no-floppy
Jan 3 15:15:18 ubuntu grub-installer: info: Running chroot /target grub-install --no-floppy "(hd0)"
Jan 3 15:15:18 ubuntu grub-installer: Probing devices to guess BIOS drives. This may take a long time.
Jan 3 15:15:18 ubuntu grub-installer: Searching for GRUB installation directory ...
Jan 3 15:15:18 ubuntu grub-installer: found: /boot/grub
Jan 3 15:15:24 ubuntu grub-installer: The file /boot/grub/stage1 not read correctly.
Jan 3 15:15:24 ubuntu grub-installer: error: Running 'grub-install --no-floppy "(hd0)"' failed.
Jan 3 15:17:02 ubuntu /USR/SBIN/CRON[31235]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jan 3 15:17:19 ubuntu python: log-output -t ubiquity umount /target/cdrom
Jan 3 15:17:19 ubuntu python: Exception during installation:
Jan 3 15:17:19 ubuntu python: Traceback (most recent call last):
Jan 3 15:17:19 ubuntu python: File "/usr/share/ubiquity/install.py", line 1768, in <module>
Jan 3 15:17:19 ubuntu python: install.run()
Jan 3 15:17:19 ubuntu python: File "/usr/share/ubiquity/install.py", line 402, in run
Jan 3 15:17:19 ubuntu python: self.configure_bootloader()
Jan 3 15:17:19 ubuntu python: File "/usr/share/ubiquity/install.py", line 1312, in configure_bootloader
Jan 3 15:17:19 ubuntu python: "GrubInstaller failed with code %d" % ret)
Jan 3 15:17:19 ubuntu python: InstallStepError: GrubInstaller failed with code 1
Jan 3 15:17:19 ubuntu python:
Jan 3 15:17:21 ubuntu ubiquity[9845]: debconffilter_done: Install (current: None)
Jan 3 15:17:21 ubuntu ubiquity[9845]: Exception in GTK frontend (invoking crash handler):
Jan 3 15:17:21 ubuntu ubiquity[9845]: Traceback (most recent call last):
Jan 3 15:17:21 ubuntu ubiquity[9845]: File "/usr/lib/ubiquity/bin/ubiquity", line 212, in <module>
Jan 3 15:17:21 ubuntu ubiquity[9845]: main()
Jan 3 15:17:21 ubuntu ubiquity[9845]: File "/usr/lib/ubiquity/bin/ubiquity", line 207, in main
Jan 3 15:17:21 ubuntu ubiquity[9845]: install(args[0])
Jan 3 15:17:21 ubuntu ubiquity[9845]: File "/usr/lib/ubiquity/bin/ubiquity", line 65, in install
Jan 3 15:17:21 ubuntu ubiquity[9845]: ret = wizard.run()
Jan 3 15:17:21 ubuntu ubiquity[9845]: File "/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py", line 425, in run
Jan 3 15:17:21 ubuntu ubiquity[9845]: self.progress_loop()
Jan 3 15:17:21 ubuntu ubiquity[9845]: File "/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py", line 776, in progress_loop
Jan 3 15:17:21 ubuntu ubiquity[9845]: (ret, realtb))
Jan 3 15:17:21 ubuntu ubiquity[9845]: RuntimeError: Install failed with exit code 1
Jan 3 15:17:21 ubuntu ubiquity[9845]: Traceback (most recent call last):
Jan 3 15:17:21 ubuntu ubiquity[9845]: File "/usr/share/ubiquity/install.py", line 1768, in <module>
Jan 3 15:17:21 ubuntu ubiquity[9845]: install.run()
Jan 3 15:17:21 ubuntu ubiquity[9845]: File "/usr/share/ubiquity/install.py", line 402, in run
Jan 3 15:17:21 ubuntu ubiquity[9845]: self.configure_bootloader()
Jan 3 15:17:21 ubuntu ubiquity[9845]: File "/usr/share/ubiquity/install.py", line 1312, in configure_bootloader
Jan 3 15:17:21 ubuntu ubiquity[9845]: "GrubInstaller failed with code %d" % ret)
Jan 3 15:17:21 ubuntu ubiquity[9845]: InstallStepError: GrubInstaller failed with code 1
Jan 3 15:17:21 ubuntu ubiquity[9845]:
Jan 3 15:17:21 ubuntu last message repeated 2 times

ps: is there a possibility to resume a failed installation? (i have yet to try to re-start the installer ;) )

Tags: grub
Revision history for this message
Raoul Teeuwen (raoul-teeuwen) wrote :

I had the same error messages. I installed Ubuntu 7.10 on a laptop that had WinXP and Fedora in a dual-boot config. My laptop won't boot anymore from HD: it displays the word GRUB in the left upper corner and than hangs. So i just booted the Ubuntu LiveCD and now trying to figure out how to fix the boot-record...

Revision history for this message
Raoul Teeuwen (raoul-teeuwen) wrote :

Currently reading http://ubuntuforums.org/showthread.php?t=224351&page=26 ... Fyi: i had Fedora and XP on the same HD. Afaik it seems no GRUB-files can be found anywhere. Even when i do what is described on page 1 of the mentioned thread, i get error-messages from Grub: it is unable to locate the necessary files. If i just assume it needs to use hd0,1 , i get error-messages to. Maybe i'm going to just try a reinstall from the LiveCD and hope Ubuntu will be able to install Grub this time...

Revision history for this message
Raoul Teeuwen (raoul-teeuwen) wrote :

Followed http://ubuntuforums.org/showthread.php?t=616540#2 (used the universe-path and restored Win bootrecord .... have to find out what happens when i reboot my machine.

Revision history for this message
Raoul Teeuwen (raoul-teeuwen) wrote :

After a couple of reboots and fiddeling with partitions, i finally got it working again, with GRUB booth showing XP and Ubuntu... Boy, would it be nice if the Ubuntu-installer would be able to prevent these GRUB-problems...

Revision history for this message
TerryG (tgalati4) wrote :

Triaged as Incomplete. I agree, ubiquity should do a better job of keeping new users from messing up their existing Windows installs. There should be 3 warning screens to click through that ask have you backed up your important data. But for as many precautions that are added, users will still find a way to mess up their systems.

Changed in ubiquity:
status: New → Incomplete
Revision history for this message
Raoul Teeuwen (raoul-teeuwen) wrote :

I don't know whether i should read your line about 3 warning screens cynical TerryG, but if so: my point was not about not having a backup, just reporting a boot-problem after trying to install Ubuntu 7.10. Even restoring a backup would have been a lot of work, so it would be nice if the cause of the problem could have been taken away. If only a few users/configurations seem to have the problem, it's perfectly fine for developers to choose not to analyze it and solve it... Thanks,

Raoul

Revision history for this message
TerryG (tgalati4) wrote :

Thanks for your response. Although, unless you are maharaja, I'm not sure this is the same situation. It's a known problem that GRUB has problems in multiple-boot setups, incorrectly labeling boot partitions, and leaving an unbootable system. Ubiquity makes it easy for a new user to overwrite a Windows partition, thus losing valuable data--often not backed up. I'm not sure how to prevent this.

Your case of GRUB listing incorrect entries is fixable, but this can be difficult for new users.

Marking as Confirmed to preserve your comments.

Changed in ubiquity:
status: Incomplete → Confirmed
Revision history for this message
Raoul Bhatia (raoul-bhatia) wrote :

maybe i did not clearify myself. i will try to remember and explain myself:

1) i had a partition, formatted with windows (so id=7, fs = ntfs)
2) i installed ubuntu and chose to install it to hda2. i only formatted the partition with ext3 and did not change anything else
3) running grub failed and i suspected it was because of hda2 had partition id=7 instead of partition id=83. so grub failed to choose the proper stage (which should be e2fs_stage1_5)

its not about messing up an existing windows partion, loosing data, etc. it is about chosing an existing windows partition to install ubuntu, and ubuntu only formats the disk (thats ok) but does not change the parition type and thus producing a grub error.

cheers,
raoul

ps: maharaja != Raoul Teeuwen. Even thou the firstname matches, i'm a different person ;)

Revision history for this message
ander019 (ander019) wrote :

很抱歉,安裝程式當掉了。請傳送一份臭蟲回報到 https://launchpad.net/ubuntu/+source/ubiquity/+filebug
(請不要附加細節到任何已知的臭蟲),開發人員將會盡快處理這個問題。
為了幫助開發人員了解哪裡出了問題,請在臭蟲回報中寫入下列資訊
並附加 /var/log/syslog 和 /var/log/partman 這兩個檔案。

Traceback (most recent call last):
  File "/usr/lib/ubiquity/bin/ubiquity", line 229, in <module>
    main()
  File "/usr/lib/ubiquity/bin/ubiquity", line 226, in main
    install()
  File "/usr/lib/ubiquity/bin/ubiquity", line 68, in install
    ret = wizard.run()
  File "/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py", line 417, in run
    self.progress_loop()
  File "/usr/lib/ubiquity/ubiquity/frontend/gtk_ui.py", line 783, in progress_loop
    (ret, realtb))
RuntimeError: Install failed with exit code 1
Traceback (most recent call last):
  File "/usr/share/ubiquity/install.py", line 1847, in <module>
    install.run()
  File "/usr/share/ubiquity/install.py", line 419, in run
    self.configure_bootloader()
  File "/usr/share/ubiquity/install.py", line 1381, in configure_bootloader
    "GrubInstaller failed with code %d" % ret)
InstallStepError: GrubInstaller failed with code 1

the follow is my partition table
Filesystem 1K-blocks Used Available Use% Mounted on
aufs 123768 2284 121484 2% /
udev 123768 88 123680 1% /dev
/dev/scd0 265202 265202 0 100% /cdrom
/dev/loop0 254720 254720 0 100% /rofs
tmpfs 123768 2284 121484 2% /cow
tmpfs 123768 2284 121484 2% /cow
aufs 123768 2284 121484 2% /dev/.static/dev
none 123768 0 123768 0% /dev/shm
tmpfs 123768 16 123752 1% /tmp
/dev/sda1 988084 17632 920656 2% /mnt/sda1(boot)
/dev/sda2 988116 141416 796900 16% /mnt/sda2(/)
/dev/sda5 1984204 83936 1800268 5% /mnt/sda5(/var)
/dev/sda6 988084 17636 920652 2% /mnt/sda6(/tmp)
/dev/sda7 2972396 70740 2751852 3% /mnt/sda7(/home)
/dev/sda8 3968468 73440 3695024 2% /mnt/sda8(/AnderNet)
/dev/sda9 3968468 73440 3695024 2% /mnt/sda9(/download)
/dev/sda10 3968468 73444 3695020 2% /mnt/sda10(/util)
/dev/sda11 8502988 870024 7204432 11% /mnt/sda11(/usr)
/dev/sdb1 2047680 1710048 337632 84% /mnt/sdb1(/usb)

Revision history for this message
Dave (david-durcsak) wrote :

Ubuntu Forum:

I am trying to load Ubuntu and have a dual boot system.

I originally started with a WIN XP and have formatted drives for both root and swap

During the last part of the OS installation I receive a Fatal Error

Executing 'grub-install(hd0)' failed.

I was wondering if I should have chosen another of the options in the drop down list of install points for 'grub'??

Here are what my options are:

/dev/sda (primary HD with partitioned for both WIN and Ubuntu)
/dev/sda1 MS WIN XP
/dev/sda2
/dev/sdb (Secondary drive partitioned for WIN data and Ubuntu Swap)
/dev/sdb5

Thank you

Revision history for this message
Dave (david-durcsak) wrote :

To all:

Just got a response from member of Ubunto Forum

Bottom line is it worked and was very simple:

I've heard that is a bug that can be circumvented by formatting the Ubuntu partition to ext2 instead of ext3 when you install Ubuntu. Try that, and if it works you can later "ugrade" your file system to ext3 with:
Code:

sudo tune2fs -j /dev/sdXY

Replace sdXY with your Ubuntu partition of course. After that, I believe the only thing you will need to do is edit your /etc/fstab so that the Ubuntu partition is mounted with "ext3" instead of "ext2".

Revision history for this message
Colin Watson (cjwatson) wrote :

Thanks for your report. This is also bug 149832, now finally fixed in Intrepid.

Revision history for this message
Sourav (sourav-r-mohanty) wrote :

Hope this error/ bug is fixed in *.10 version.

Cheers,
Sourav Mohanty

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.