LinuxQuestions.org
Review your favorite Linux distribution.
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 10-06-2017, 09:23 PM   #1
Corvette
Member
 
Registered: Jul 2017
Location: Missouri, United States
Distribution: Debian 9
Posts: 110

Rep: Reputation: 24
Cannot Boot Ubuntu - Cannot Install GRUB


Greetings:

I was attempting to install some packages and update my Ubuntu system. I tried using both the terminal and Synaptic GUI, but received errors about processing some packages (I did not pay that close of attention because I did not think it was anything serious).

I decided to reboot my system to see if that would help. I was greeted with a message similar to "unable to mount fs on uknown block(0,0)" and unable to boot my system. I thought I might be able to repair it using the Boot Repair utility. I ran the terminal commands instructed by the program and was (apparently) able to remove GRUB. However, now when I try to run the commands to reinstall GRUB, I receive the following error:

Code:
lubuntu@lubuntu:~$ sudo chroot "/mnt/boot-sav/sda5" dpkg --configure -a
dpkg: dependency problems prevent configuration of linux-image-extra-4.10.0-35-generic:
 linux-image-extra-4.10.0-35-generic depends on linux-image-4.10.0-35-generic; however:
  Package linux-image-4.10.0-35-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.10.0-35-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-4.10.0-35-generic; however:
  Package linux-image-4.10.0-35-generic is not configured yet.
 linux-image-generic depends on linux-image-extra-4.10.0-35-generic; however:
  Package linux-image-extra-4.10.0-35-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 4.10.0.35.35); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-extra-4.10.0-35-generic
 linux-image-generic
 linux-generic
So I tried
Code:
  sudo chroot "/mnt/boot-sav/sda5" apt-get install linux-image-4.10.0-35-generic
The output from this seemed to indicate that I needed to install linux-headers-4.10.0-32-generic. However, when I tried that I received the following:

Code:
(Reading database ... 261942 files and directories currently installed.)
Removing linux-image-extra-4.10.0-30-generic (4.10.0-30.34) ...
depmod: FATAL: could not load /boot/System.map-4.10.0-30-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-30-generic /boot/vmlinuz-4.10.0-30-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-30-generic /boot/vmlinuz-4.10.0-30-generic
Error! Your kernel headers for kernel 4.10.0-30-generic cannot be found.
Please install the linux-headers-4.10.0-30-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-30-generic /boot/vmlinuz-4.10.0-30-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-30-generic
cp: cannot stat '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-30-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.10.0-30-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.10.0-32-generic (4.10.0-32.36) ...
depmod: FATAL: could not load /boot/System.map-4.10.0-32-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-32-generic /boot/vmlinuz-4.10.0-32-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-32-generic /boot/vmlinuz-4.10.0-32-generic
Error! Your kernel headers for kernel 4.10.0-32-generic cannot be found.
Please install the linux-headers-4.10.0-32-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-32-generic /boot/vmlinuz-4.10.0-32-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-32-generic
cp: cannot stat '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-32-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.10.0-32-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-89-generic (4.4.0-89.112) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-89-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-89-generic /boot/vmlinuz-4.4.0-89-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-89-generic /boot/vmlinuz-4.4.0-89-generic
Error! Your kernel headers for kernel 4.4.0-89-generic cannot be found.
Please install the linux-headers-4.4.0-89-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-89-generic /boot/vmlinuz-4.4.0-89-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-89-generic
cp: cannot stat '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-89-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-89-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.10.0-30-generic
 linux-image-extra-4.10.0-32-generic
 linux-image-extra-4.4.0-89-generic
Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PackageKit was not provided by any .service files
E: Sub-process /usr/bin/dpkg returned an error code (1)
Now I am not quite sure what to do. If it helps here the information provided by the Boot Repair utility: http://paste.ubuntu.com/25689624/

Thanks.
 
Old 10-07-2017, 06:04 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
One possible reason is that you have a incorrect listing in your /etc/fstab file. Which would explain the following message;

Code:
unable to mount fs on uknown block(0,0)
And/or in your GRUB configuration file.

Can you post the following (using CODE tags):
  • /etc/fstab
  • /boot/grub2/grub.cfg

Also, your partitioning?
 
1 members found this post helpful.
Old 10-07-2017, 08:01 AM   #3
Corvette
Member
 
Registered: Jul 2017
Location: Missouri, United States
Distribution: Debian 9
Posts: 110

Original Poster
Rep: Reputation: 24
Thanks. I hope this is what you were looking for:

Code:
=============================== sda5/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=7b8de9c1-9ebb-46b3-8b54-3751d4a230d6 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda6 during installation
UUID=7750636d-960d-47da-ad30-fa9f6688ec03 none            swap    sw              0       0
UUID=f16e73f9-3fff-4cb5-a8f2-c9a914104130   /home    ext4          defaults       0       2 
--------------------------------------------------------------------------------
Code:
=================== sda5/etc/default/grub :

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"



Code:
============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *          2,048       206,847       204,800   7 NTFS / exFAT / HPFS
/dev/sda2             206,848   132,665,343   132,458,496   7 NTFS / exFAT / HPFS
/dev/sda3         132,665,344   311,656,447   178,991,104   5 Extended
/dev/sda5         250,218,496   303,605,759    53,387,264  83 Linux
/dev/sda6         303,607,808   311,656,447     8,048,640  82 Linux swap / Solaris
/dev/sda7         132,667,392   250,218,495   117,551,104  83 Linux
Since I cannot boot into problem system (sda5), I am not sure how to access the files directly. This data comes from the Boot Repair utility. Please let me know if any other data might help.

Thanks.

Last edited by Corvette; 10-07-2017 at 08:01 AM. Reason: Fix broken code tags.
 
Old 10-07-2017, 08:20 AM   #4
plasmonics
Member
 
Registered: Jan 2009
Distribution: Fedora, Gentoo, LFS
Posts: 224

Rep: Reputation: 69
As far as post #2 asking you to list /boot/grub/grub.cfg, one method is to boot Systemrescuecd and mount /dev/sda5 at /mnt. Then you can obtain a copy of grub.cfg.
 
1 members found this post helpful.
Old 10-07-2017, 08:32 AM   #5
Corvette
Member
 
Registered: Jul 2017
Location: Missouri, United States
Distribution: Debian 9
Posts: 110

Original Poster
Rep: Reputation: 24
Thanks. I could not find the grub.cfg file (or even the grub directory for that matter). Running "ls" in /boot outputs the following:

Code:
abi-4.10.0-33-generic		       memtest86+.bin
abi-4.10.0-35-generic		       memtest86+.elf
config-4.10.0-33-generic	       memtest86+_multiboot.bin
config-4.10.0-35-generic	       System.map-4.10.0-33-generic
grub.bak			       System.map-4.10.0-35-generic
initrd.img-4.10.0-30-generic.old-dkms  vmlinuz-4.10.0-33-generic
initrd.img-4.10.0-32-generic.old-dkms  vmlinuz-4.10.0-35-generic
initrd.img-4.10.0-33-generic
I did run some commands instructed by the Boot Repair utility to remove grub (with the intent of reinstalling it I suppose). The removal succeeded apparently; the installation did not. So now it seems as if I do not have grub properly configured; I now receive an error message relating to grub rather than the initial mounting error when attempting to boot the problematic OS. Running the install commands:

Code:
udo chroot "/mnt/boot-sav/sda5" dpkg --configure -a
sudo chroot "/mnt/boot-sav/sda5" apt-get install -fy
sudo chroot "/mnt/boot-sav/sda5" apt-get install -y --force-yes grub-pc
Results in (in part) the errors noted above.

Thanks again.
 
Old 10-07-2017, 09:07 AM   #6
plasmonics
Member
 
Registered: Jan 2009
Distribution: Fedora, Gentoo, LFS
Posts: 224

Rep: Reputation: 69
This is a long shot. After booting systemrescuecd, try chrooting using the following:
Code:
mkdir -p /mnt/repair
mount /dev/sda5 /mnt/repair
mount -t proc none /mnt/repair/proc
mount -o bind /dev /mnt/repair/dev
mount -o bind /dev/pts /mnt/repair/dev/pts
mount -o bind /sys /mnt/repair/sys
chroot /mnt/repair /bin/bash
source /etc/profile
The idea is to try and restore the missing grub directory and modules from a chrooted environment.
Code:
apt-get install --reinstall grub
update-grub
If the MBR is hosed, you may have to reinstall the boot loader
Code:
grub-install /dev/sda
If this works, you can try booting ubuntu in single-user mode and continue your repair work. Looks like a lot of your kernel headers and dependencies are missing. There is a way to resolve a catch 22 in debian. Unfortunately, I don't remember!
If this doesn't work, then I am not sure what next.
 
Old 10-08-2017, 12:54 PM   #7
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
Assuming that it is only GRUB that is missing and your system is otherwise ok, another way you can reinstall GRUB is to;

First download the Super Grub Disk, burn it on to a CD/DVD (or install it onto a USB stick) and start your Ubuntu installation from it.

And then you can follow the instructions here, to re-install GRUB. (under "The terminal way")

Let us know how you go...
 
  


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
Install Ubuntu virtually and boot with Windows Bootloader or grub midler Linux - Laptop and Netbook 6 01-21-2015 05:52 PM
Dual boot install - ubuntu studio 9.04 - GRUB error 21 illnamiqui Linux - Newbie 4 12-03-2011 04:51 PM
install Ubuntu on dual boot system already running GRUB Ricky_writer Linux - Software 2 11-11-2010 10:08 PM
Grub Error 17 on Install dual Boot Ubuntu 8.10 marvinjean Linux - Newbie 8 01-17-2009 11:08 AM
missing /boot/grub after fresh install of Ubuntu 8.04 adityavpratap Ubuntu 3 06-12-2008 08:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:47 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration