grub-install doesn't work (it says "source_dir doesn't exist")

Bug #1069178 reported by Mustafa Muhammad
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Opinion
Undecided
Unassigned

Bug Description

When I run:

sudo grub-install /dev/sda

I get:

source_dir doesn't exist. Please specify --target or --directory

and even setting the directory doesn't work:

sudo grub-install --directory=/boot/ /dev/sda

/usr/sbin/grub-install: 357: .: Can't open /boot//modinfo.sh

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: grub2-common 2.00-7ubuntu11
ProcVersionSignature: Ubuntu 3.5.0-17.28-generic 3.5.5
Uname: Linux 3.5.0-17-generic x86_64
ApportVersion: 2.6.1-0ubuntu3
Architecture: amd64
Date: Sat Oct 20 21:53:07 2012
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Mustafa Muhammad (mustafa.muhammad) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Phillip Susi (psusi) wrote :

Please try reinstalling grub:

sudo apt-get install --reinstall grub-pc

Or use grub-efi instead if you are using EFI boot.

Changed in grub2 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Mustafa Muhammad (mustafa.muhammad) wrote :

I did:

mustafa@mustafa-Lenovo-B570e:~$ sudo apt-get install --reinstall grub-efi
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-headers-3.5.0-17
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 208 not upgraded.
Need to get 1,140 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://iq.archive.ubuntu.com/ubuntu/ quantal/main grub-efi amd64 2.00-7ubuntu11 [1,140 B]
Fetched 1,140 B in 1s (943 B/s)
(Reading database ... 141805 files and directories currently installed.)
Preparing to replace grub-efi 2.00-7ubuntu11 (using .../grub-efi_2.00-7ubuntu11_amd64.deb) ...
Unpacking replacement grub-efi ...
Setting up grub-efi (2.00-7ubuntu11) ...
mustafa@mustafa-Lenovo-B570e:~$ sudo grub-install /dev/sda
source_dir doesn't exist. Please specify --target or --directory

When I installed Ubuntu, I chose /dev/sda7 to install the bootloader, when I try to chainload it from my grub, it doesn't work (grub1 says "Error 13: Invalid or unsupported executable format" and grub2 says "Invalid signature), I updated openSUSE grub to include Ubuntu (not chainloading), and now using Ubuntu I can't do "grub-install /dev/sda".

Revision history for this message
Mustafa Muhammad (mustafa.muhammad) wrote :

Ok, it got fixed by installing grub-pc and removing grub-efi, looks like Ubiquity installed grub-efi while my laptop needs grub-pc, should I report the bug against Ubiquity?

Revision history for this message
Phillip Susi (psusi) wrote :

Can you recall when you installed the first time what the menu first looked like when you booted the install cd? Was it the more plain looking grub text menu, or the graphical syslinux menu with more options?

Revision history for this message
Mustafa Muhammad (mustafa.muhammad) wrote :

None!! only a black screen and when I press "Enter" it boots, I've just tried it.

Revision history for this message
Phillip Susi (psusi) wrote :

You don't get a menu? Even if you press the up/down arrow keys?

Revision history for this message
Mustafa Muhammad (mustafa.muhammad) wrote :

Yes, I don't get one, ever if I press up/down.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for grub2 (Ubuntu) because there has been no activity for 60 days.]

Changed in grub2 (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Victor Engmark (victor-engmark) wrote :

This happened for me directly after upgrading to 13.04.

Revision history for this message
Victor Engmark (victor-engmark) wrote :

Fixed by `sudo apt-get install --reinstall grub-pc`

Revision history for this message
Heimen Stoffels (vistaus) wrote :

I experience this bug on 13.04 currently. When reinstalling Grub this message pops up. I'm afraid to reboot now.

Changed in grub2 (Ubuntu):
status: Expired → Confirmed
Revision history for this message
Phillip Susi (psusi) wrote :

And did you try sudo apt-get install --reinstall grub-pc?

Changed in grub2 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Mustafa Muhammad (mustafa.muhammad) wrote :

"sudo apt-get install --reinstall grub-pc" solved the problem, thank you.
Not sure this should be marked as solved or not because anyone who uses the official ISOs will face this problem.

Changed in grub2 (Ubuntu):
status: Incomplete → Opinion
Revision history for this message
moueza (mouezapeter) wrote :

Affects me too with Ubuntu 13.10

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.