PDA

View Full Version : [ubuntu] 12.04 install failure and GRUB not set up.



Mylorharbour
April 30th, 2012, 01:21 PM
Installing from a cd in a multi-boot system I tried to install 12.04 in sda12. It got to the import documents and settings from the other OSs. As I didn't want to I didn't tick any of the boxes. I then get an error message saying it was trying to mount a partition but couldn't because sda8 was mounted (sda8 contains Ubuntu 11.10). I select 'Go back' and get a message saying the install will continue but it clearly doesn't as I'm immediately told installation is complete and to reboot. It certainly didn't set up GRUB as I now get a 'grub rescue>' prompt when booting.

Any ideas?

darkod
April 30th, 2012, 01:36 PM
If you boot with the cd and start the install, how can sda8 be mounted? Unless you did it in live mode before starting the install.

To have more info what you've got and what not, run the boot info script from the link in my signature. Post the results as explained. That will show many details of the setup and we can see what is missing.

Mylorharbour
April 30th, 2012, 02:13 PM
Thanks for the quick reply darko.

As I can only get in via a liveCD now will bootinfoscript produce any usable output?

darkod
April 30th, 2012, 03:08 PM
Yeap, it scans the hdd. Doesn't matter that you are running it from live mode. Just be careful where it downloads since the run command will depend on that. You need to run it from the same folder.

Tomas123
April 30th, 2012, 08:14 PM
Today I had same problem. Was installing fresh 12.04 server and got error "Grub installation failed" with explanation:

The 'grub-pc' package failed to install into /target/ ...

Options are "Go back" and "Continue", but going back and trying to re-install it results in the same error.

Is it possible that I get this error because my /boot is formated in Ext3? All other partitions are in Ext4.

darkod
April 30th, 2012, 08:18 PM
Today I had same problem. Was installing fresh 12.04 server and got error "Grub installation failed" with explanation:

The 'grub-pc' package failed to install into /target/ ...

Options are "Go back" and "Continue", but going back and trying to re-install it results in the same error.

Is it possible that I get this error because my /boot is formated in Ext3? All other partitions are in Ext4.

No, the ext3 is not a problem. But why did it try to install in /target? The destination should be a MBR of a disk, like /dev/sda, /dev/sdb, etc.

/target sounds like something you mounted. Even if you did some work before starting the install, you need to unmount any partitions you mounted before starting the install so it can work with them.

Tomas123
April 30th, 2012, 08:27 PM
No, the ext3 is not a problem. But why did it try to install in /target? The destination should be a MBR of a disk, like /dev/sda, /dev/sdb, etc.

/target sounds like something you mounted. Even if you did some work before starting the install, you need to unmount any partitions you mounted before starting the install so it can work with them.

Because it is fresh install I went through all the install screens, freshly partitioned the hdd (as one of the setup process steps) and clicked next.

So hdd was blank to begin with, no mounted partitions :-/

Also: can it be because I don't have internet connection?

darkod
April 30th, 2012, 08:29 PM
Because it is fresh install I went through all the install screens, freshly partitioned the hdd (as one of the setup process steps) and clicked next.

So hdd was blank to begin with, no mounted partitions :-/

Weird. You can probably boot with the desktop live cd in live mode and just add grub2, even though you were installing the server. Should be OK.

jkorten
April 30th, 2012, 08:51 PM
It appears 12.04 and grub are now incompatible. Unable to find the grub directory.

I'm now forced to download the iso and re-install on my linux hard disk. Hopefully a new or compatible grub will appear?

What ever the install does - it actively goes out and writes on the MBR of your windows disk. So remove it before you do the install if you have a multi disk boot system. Otherwise you have to use the grub boot disk to reset the mbr on the windows drive.

This is a pain. If anybody knows how to get the 12.04 drive to boot - posting soon would be really nice.

Jerry

darkod
April 30th, 2012, 09:12 PM
It appears 12.04 and grub are now incompatible. Unable to find the grub directory.

I'm now forced to download the iso and re-install on my linux hard disk. Hopefully a new or compatible grub will appear?

What ever the install does - it actively goes out and writes on the MBR of your windows disk. So remove it before you do the install if you have a multi disk boot system. Otherwise you have to use the grub boot disk to reset the mbr on the windows drive.

This is a pain. If anybody knows how to get the 12.04 drive to boot - posting soon would be really nice.

Jerry

What are you talking about?

The grub folder is in /boot/grub. If you are looking from live mode you need to mount your partition first.

If you use the auto method to install ubuntu, grub2 might go to the disk which is first in the boot order, which might be a different disk from where ubuntu is installed. This happens so that grub2 will be booted when you restart. Windows does the same, it puts its bootloader to the disk that is first in the boot order.

Anyway, for greater control in multidisk environment, and to select where to install grub2 yourself, use the manual install method. It always offers best control.

Tomas123
April 30th, 2012, 09:51 PM
For those who faced the "The 'grub-pc' package failed to install into /target/ ..." problem I found solution on linuxforums.org This should work especially for those who are performing fresh install.


The text installer apparently has some sort of unknown 'feature' or bug, depending on your POV. If you plug in the computer when you start, it'll set up the network and time Then unplug (or turning off) the modem after this step will make the installer install from the CD/DVD

But if you leave it plugged in until it starts configuring APT, it'll start downloading stuff from the servers, even if you use a DVD. With my slow connection, that'd take 6 hours - meaning around 600+ megs of stuff.

What's worse, if you pull the plug after the APT configuration, it'll screw everything up. (That's what I was doing before)

I ran into the installer not installing the GUI, it would also screw up GRUB, Lilo, and even if these things worked, the OS still had problems; ran into some bizarre problems then.

I tested this by installing Debian 6.0.3/XFCE4 on a netbook and Thinkpad. Worked like a charm if I turned off the modem at the right time.

Source: http://www.linuxforums.org/forum/debian-linux/184751-grub2-squeeze-debian-6-0-2-problems.html

Personally I let installation initialize network cards and when that step was completed I unplugged my server from the network. I guess It was when I got "Set time server" screen.

Of course I can do recoveries described in the links bellow, but I think every admin wants to get "fresh and clean" install without any possible problems.

Hope that will help.

Other possible solutions:

http://giantdorks.org/alain/easy-enough-recovery-from-debian-testing-installers-failure-to-install-grub-during-setup/

http://mitreasorin.blogspot.com/2011/12/grub-installation-failed-grub-pc.html

jkorten
April 30th, 2012, 10:59 PM
What are you talking about?

The grub folder is in /boot/grub. If you are looking from live mode you need to mount your partition first.

If you use the auto method to install ubuntu, grub2 might go to the disk which is first in the boot order, which might be a different disk from where ubuntu is installed. This happens so that grub2 will be booted when you restart. Windows does the same, it puts its bootloader to the disk that is first in the boot order.

Anyway, for greater control in multidisk environment, and to select where to install grub2 yourself, use the manual install method. It always offers best control.

It appears you are correct (explaining why it wrote on the windows disk). If I want to rescue my ubuntu drive without reloading the OS - what steps are necessary to get grub to recognize the drive - just a normal install of grub from a bootable grub disk?

darkod
April 30th, 2012, 11:11 PM
It appears you are correct (explaining why it wrote on the windows disk). If I want to rescue my ubuntu drive without reloading the OS - what steps are necessary to get grub to recognize the drive - just a normal install of grub from a bootable grub disk?

To give you best advice, lets get clear what you want.

You have your ubuntu install, and you only want to "move" its grub2 to another disk?
And then reinstall windows bootloader to the disk where windows is, for example?

Explain more about the setup. If you want to, to make it clearer, you can boot into live mode and give us the output of:
sudo fdisk -l (small L)

And tell is which partition is what, and where you want the bootloaders.

jkorten
April 30th, 2012, 11:42 PM
To give you best advice, lets get clear what you want.

You have your ubuntu install, and you only want to "move" its grub2 to another disk?
And then reinstall windows bootloader to the disk where windows is, for example?

Explain more about the setup. If you want to, to make it clearer, you can boot into live mode and give us the output of:
sudo fdisk -l (small L)

And tell is which partition is what, and where you want the bootloaders.


Thank you darkod,

I had an untouched windows (drive 0) and removed it to install linux on drive 1 originally. That way there was only grub on the ubuntu partition. I could remove the linux disk and my laptop would boot windows without a hitch.

I installed using update the 12.04 and it appears to have written grub onto the drive 0, I removed this OK using the grub boot disk (restore mbr).

Now I want the ubuntu disk to boot by itself. Which I believe will require I simply install grub on drive 1. I will do this with the windows disk out of the system.

darkod
April 30th, 2012, 11:50 PM
You have the procedure here how to add grub2 to the MBR of the disk:
http://ubuntuforums.org/showthread.php?t=1014708

Use fdisk and note the correct linux partition. If you are in doubt, post the results of fdisk and I can give you the exact commands. No need to disconnect the windows disk just for this, the grub install command can be told where exactly to install and the windows disk will not be touched.

jkorten
May 1st, 2012, 12:01 AM
You have the procedure here how to add grub2 to the MBR of the disk:
http://ubuntuforums.org/showthread.php?t=1014708

Use fdisk and note the correct linux partition. If you are in doubt, post the results of fdisk and I can give you the exact commands. No need to disconnect the windows disk just for this, the grub install command can be told where exactly to install and the windows disk will not be touched.


That did it! Can I say on a public forum the depth of my fondness for you?

:)

Really - thanks alot. Never knew that Grub install procedure. Worked great.

Problem solved!

darkod
May 1st, 2012, 12:25 AM
That did it! Can I say on a public forum the depth of my fondness for you?

:)

Really - thanks alot. Never knew that Grub install procedure. Worked great.

Problem solved!

You are welcome. Enjoy it now.

Mylorharbour
May 2nd, 2012, 08:38 AM
Yeap, it scans the hdd. Doesn't matter that you are running it from live mode. Just be careful where it downloads since the run command will depend on that. You need to run it from the same folder.

Thanks darko. Sorry about the delay, I've been off sick.

A bit more info before you read the output. I tried installing 11.10 into the same partition and had exactly the same result. I did start the install from the booted CD, not from live mode. As sda8 contained 11.10 and as it was the last distro I installed I presume the latest GRUB was installed in that partition? I suspect 12.04 mounted and read data from it as the install knew the region was the UK and the keyboard was English (UK). Anyway, as the 11.10 installation on sda8 wasn't important I deleted that partition and installed 12.04 again. The install went fine but GRUB is still screwed as whichever option I choose from the GRUB menu returns 'No such partition'. An old Super Grub Disk is still able to boot into Windows on sda1.

Results from bootinfoscript in my next post as I get a 'too many images' error if I include it here(?)

P.S. I can't post the output as a separate post nor as a PM as it's over 55000 characters long. Could you let me know which sections would be of interest and I'll post them. Alternatively if you could PM me an email address?

darkod
May 2nd, 2012, 09:06 AM
Look towards the top when it lists partition by partition, and note on which partition is 12.04 installed. Or maybe you know, is it sda8 again?

Mylorharbour
May 2nd, 2012, 09:23 AM
Thanks for coming back to me. My thread was hijacked but that's ok as I learnt a bit more.....

The partition numbers probably changed when I deleted sda8?


Boot Info Script 0.61 [1 April 2012]





============================= Boot Info Summary: ===============================



=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of

the same hard drive for core.img. core.img is at this location and looks

for (,msdos10)/boot/grub on this drive.

=> Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 1 of

the same hard drive for core.img. core.img is at this location and uses an

embedded config file:



---------------------------------------------------------------------------

search.fs_uuid 0a777bad-ca9a-44fc-a4f3-f07a42c4c407 root

set prefix=($root)/boot/grub

---------------------------------------------------------------------------

-----.

=> Syslinux MBR (3.61-4.03) is installed in the MBR of /dev/sdc.



sda1: __________________________________________________ ________________________



File system: ntfs

Boot sector type: Windows XP: NTFS

Boot sector info: No errors found in the Boot Parameter Block.

Operating System: Windows XP

Boot files: /boot.ini /ntldr /NTDETECT.COM



sda2: __________________________________________________ ________________________



File system: Extended Partition

Boot sector type: -

Boot sector info:



sda5: __________________________________________________ ________________________



File system: swap

Boot sector type: -

Boot sector info:



sda6: __________________________________________________ ________________________



File system: ext3

Boot sector type: -

Boot sector info:

Operating System:

Boot files: /boot/grub/menu.lst



sda7: __________________________________________________ ________________________



File system: ext4

Boot sector type: -

Boot sector info:

Operating System: Linux Mint 12 Lisa

Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img



sda8: __________________________________________________ ________________________



File system: ext4

Boot sector type: -

Boot sector info:

Operating System:

Boot files:



sda9: __________________________________________________ ________________________



File system: ntfs

Boot sector type: Windows Vista/7: NTFS

Boot sector info: No errors found in the Boot Parameter Block.

Operating System:

Boot files:



sda10: __________________________________________________ _______________________



File system: ext4

Boot sector type: -

Boot sector info:

Operating System: Ubuntu 12.04 LTS

Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img



sda11: __________________________________________________ _______________________



File system: ext4

Boot sector type: -

Boot sector info:

Operating System: Ubuntu 11.10

Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

darkod
May 2nd, 2012, 12:05 PM
You seem to have a correct grub2 on /dev/sda. Can't tell for sure without the rest of the results.

You also seem to have a broken grub2 on /dev/sdb.

So, you might be booting from the wrong disk and the answer might be as simple as changing the order in BIOS. Make sure you are booting from /dev/sda and let us know.

Mylorharbour
May 2nd, 2012, 04:16 PM
sdb is a data only drive but it may once have had OSs on it. It may explain why some of the entries in the bootinfoscript mention Gutsy and Hardy etc. even though those partitions were deleted years ago.

The PC's a HPdc7700 and my bios boot sequence is:

CD-Rom
USB
Hard Drive - Integral STA

The details of both HDs are in the bios but I can't see where it states which drive it would boot from. sda is blue, sdb orange if that's of any use.

darkod
May 2nd, 2012, 04:27 PM
Yeap, that's the broken grub all right.

Look carefully in your BIOS. Because people started having multiple HDDs usually there is another setting that specifies the order of HDDs.

The CD-ROM, USB, HDD specifies device, but there should be another setting about the HDD order.

Look in anything resembling Boot Sequence, and maybe you need to open some sub-menu in HDD etc.

The way it seems right now with the latest info, the only problem is not booting from the correct disk.

Mylorharbour
May 2nd, 2012, 05:52 PM
The only other places the HDs are mentioned are under Storage, Device configuration, Hard disks where they are listed in this order:

SATA0 250Gb (this would be sda)
SATA3 500Gb (sdb)

and in Storage, Storage options:

SATA 0 & 2 Enabled
SATA 1 & 3 Enabled

The HP system manual states:


SATA 0 and 2
Allows you to enable or disable DOS and boot accesses to the
Primary channel of the first SATA controller. This feature only applies
when SATA emulation = IDE.

Advanced operating systems like Windows may reenable the
channel.
SATA 1 and 3
Allows you to enable or disable DOS and boot accesses to the
Secondary channel of the first SATA controller. This feature only
applies when SATA emulation = IDE.

darkod
May 2nd, 2012, 06:04 PM
OK, lets just install grub2 to sdb too. Boot into live mode and in terminal do:
sudo mount /dev/sda10 /mnt
sudo grub-install --root-directory=/mnt /dev/sdb

That will install it to sdb too, so it doesn't matter where you boot from. Restart and see if that worked.

Mylorharbour
May 2nd, 2012, 06:57 PM
Ok, did that, no errors reported.

Rebooted and got:

Error: Incompatible license
grub rescue>

Mylorharbour
May 3rd, 2012, 12:00 PM
I ran the bootinfoscript again darko. It's still 55,000 characters so I still can't post it all but here's the start:

Boot Info Script 0.61 [1 April 2012]


============================= Boot Info Summary: ===============================

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for (,msdos10)/boot/grub on this drive.
=> Grub2 (v1.97-1.98) is installed in the MBR of /dev/sdb and looks at sector
1 of the same hard drive for core.img. core.img is at this location and
looks in partition 10 for /boot/grub.
=> Syslinux MBR (3.61-4.03) is installed in the MBR of /dev/sdc.

sda1: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows XP: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files: /boot.ini /ntldr /NTDETECT.COM

sda2: __________________________________________________ ________________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ ________________________

File system: swap
Boot sector type: -
Boot sector info:

sda6: __________________________________________________ ________________________

File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files: /boot/grub/menu.lst

sda7: __________________________________________________ ________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Linux Mint 12 Lisa
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda8: __________________________________________________ ________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:

sda9: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:

sda10: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 12.04 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda11: __________________________________________________ _______________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 11.10
Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sdb1: __________________________________________________ ________________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sdb5: __________________________________________________ ________________________

File system: ext3
Boot sector type: -
Boot sector info:
Operating System:
Boot files:

sdb6: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows XP: NTFS
Boot sector info: According to the info in the boot sector, sdb6 starts
at sector 63.
Operating System:
Boot files:

sdb7: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows XP: NTFS
Boot sector info: According to the info in the boot sector, sdb7 starts
at sector 63.
Operating System:
Boot files:

sdb8: __________________________________________________ ________________________

File system: ntfs
Boot sector type: Windows Vista/7: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:

darkod
May 3rd, 2012, 12:16 PM
I don't know if that could be a problem, but you can see the grub2 versions on the two disks are different. You should use the cd with the same version as the one you have installed, in this case 12.04. I think from 11.10 they started recommending to do the grub2 reinstall only with the cd of same version.

Other than that, this part of the results doesn't show much. I am still confused why would it be that large, even for triple boot the results file still fits to be posted.

You need to take a look at /boot/grub/grub.cfg on partition /dev/sda10 and whether it has the correct UUID for root.

Mylorharbour
May 3rd, 2012, 02:11 PM
For speed I was using an 11.10 usb when I ran those commands darko. I'm now using a 12.04 usb. Should I run them again? I have the cd of course if I need to use that.

I've managed to compress both bootinfoscripts. You should see them as an attachment.

I'll have to work out how I can get to that grub.cfg. Still learning.

Thanks

oldfred
May 3rd, 2012, 02:54 PM
@Mylorharbour
Are you booting from sda, your 250GB drive in BIOS?

Sometimes you just need to reinstall grub2's boot loader to sda, but grub2 now seems to want the same version to use to reinstall, so use same liveCd as your version installed.

sudo mount /dev/sda10 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda

Is this an older computer? Some old computers have BIOS that only let you boot from inside the first 137GB of a hard drive. The entire / (root) or a separate /boot must be fully inside the 137GB, but data or /home can be anywhere on drive.
Also is BIOS setting for drive in IDE or large mode?

Mylorharbour
May 3rd, 2012, 05:17 PM
Hi Oldfred.


@Mylorharbour
Are you booting from sda, your 250GB drive in BIOS?
See my posts #22 and #24 for details but I believed I was. sdb should be data only.


Sometimes you just need to reinstall grub2's boot loader to sda, but grub2 now seems to want the same version to use to reinstall, so use same liveCd as your version installed.
On sda I have WinXP, Ubuntu 11.10, Linux Mint 12 and Ubuntu 12.04. I deleted or overwrote the previous versions but they do appear in the bootinfoscript results I attached to post #29.


sudo mount /dev/sda10 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda
Am I right to assume this will copy grub2 from the cd (actally, for speed I'm now using a 12.04 usb stick) to sda10 which is where I installed 12.04? Will this pick up WinXP and the other distros?


Is this an older computer? Some old computers have BIOS that only let you boot from inside the first 137GB of a hard drive. The entire / (root) or a separate /boot must be fully inside the 137GB, but data or /home can be anywhere on drive.
Also is BIOS setting for drive in IDE or large mode?
It's middle aged I suppose, a HPdc7700 about 2007, Intel® Core™2 CPU 6400 @ 2.13GHz × 2 and 2Gb RAM. See my post #24 for BIOS info

Mylorharbour
May 3rd, 2012, 05:25 PM
Guys,
Would it be safer and would it help if I unplugged sdb while we diagnose this?

oldfred
May 3rd, 2012, 06:30 PM
It should not matter if you disconnect sdb, but if at all concerned you can.

Reinstall of the grub2 boot loader does not change the grub menu or reinstall grub2. If menu is not correct, it may still not boot, or you can in effect manually boot by typing all the commands. And if grub2 is not installed correctly, you sometimes have to chroot into system to reinstall all of grub2.

But once you have booted, grub2's os-prober is very good at finding all other installed systems. It is run as part of this and updates menu:

sudo update-grub

Mylorharbour
May 3rd, 2012, 10:35 PM
Almost there oldfred.

I just entered your commands, now have a working grub menu and can boot into WinXP and Linux Mint ok. 12.04 is also accessible except the workspace is larger than my monitor so I cannot see the launcher nor the taskbar although I can see drop down menus etc when I click off-screen.

Can I solve this without re-installing?

bootinfoscript still returns a RESULTS.txt file of 52035 characters.....

oldfred
May 3rd, 2012, 11:08 PM
If it is grub it is this, use your screen size or smaller ratio from screen size:
Use this with your monitor size in /etc/default/grub:
GRUB_GFXMODE=1024x768

But it sounds like it is Ubuntu itself.
If these suggestions do not work, it probably would be best to start a new thread so those who know more about video issues may respond.

How to set NOMODESET and other kernel boot options in grub2
http://ubuntuforums.org/showthread.php?t=1613132
https://help.ubuntu.com/community/BootOptions

Natty or later Video issues. MAFoElffen
http://ubuntuforums.org/showthread.php?t=1743535

On first boot after install, press e on getting the GRUB bootloader.
Hold shift from BIOS boot to get menu if only one system installed.
Using arrow keys navigate to and delete quiet and splash and type the word nomodeset in their place
Press Ctrl and X to boot (low graphics mode), install nVidia driver suggested my Ubuntu

If not nVidia I do not know. But then do not install the nVidia driver.

Mylorharbour
May 3rd, 2012, 11:12 PM
I've partly resolved the workspace issue by bringing up the dash and typing Displays. The resolution was set correctly but the characters weren't very sharp so I set it to a lower resolution then back again so that's now fine.

I rebooted to make sure it remembered the setting but the login screen is still oversized. I can just see the right hand side of the login box. Logging in resulted in a proper workspace so it's usable but needs refinement.

Thanks for your help to date guys.

Mylorharbour
May 3rd, 2012, 11:14 PM
oldfred,

I just spotted your response but I've been called away so I'll look into this further tomorrow.

Thanks again.