LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 11-10-2012, 08:28 PM   #1
chovy
Member
 
Registered: Dec 2004
Location: Capitola, CA
Distribution: Debian
Posts: 52

Rep: Reputation: 15
Had a power failure, and now all is see is the word GRUB when I boot up


I'm running latest debian stable and when I reboot after a power failure, all I see is the word GRUB on my screen.

I've downloaded the latest LIVE cd from debian and booted it up from DVD.

I tried a few things recommended by folks in #debian on freenode, but nothing seems to work.

I ran fsck and it just says "clean"
 
Old 11-11-2012, 12:35 AM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,686

Rep: Reputation: 124Reputation: 124
That's because fsck does nothing more then checking your filesystem is OK. It is, it's just the stored data that's corrupted. Boot into the DVD, find out what name the root partition has, then issue the command:
Code:
install-grub /dev/sda1
Assuming /dev/sda1 is your root partition. This (re-)installs grub to the drive, so hopefully you can boot it again. If it doesn't, come back with the exact error message and a description of what you've done to get to that stage.
 
Old 11-11-2012, 01:26 AM   #3
chovy
Member
 
Registered: Dec 2004
Location: Capitola, CA
Distribution: Debian
Posts: 52

Original Poster
Rep: Reputation: 15
So I was able to boot into live-cd and run grub-install /dev/sda (MBR) and it errored out at that point. Something about a a blocklist or something, can't remember really. It was recommended not to do it with --force.
 
Old 11-11-2012, 06:55 AM   #4
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Quote:
Originally Posted by chovy View Post
So I was able to boot into live-cd and run grub-install /dev/sda (MBR) and it errored out at that point. Something about a a blocklist or something, can't remember really. It was recommended not to do it with --force.
The response you describe appears when you try to install GRUB to a partition on your device rather than to the MBR ofthe device itself. Are you sure you didn't mistakenly type
Code:
grub-install /dev/sda1
instead of
Code:
grub-install /dev/sda
 
Old 11-11-2012, 12:57 PM   #5
chovy
Member
 
Registered: Dec 2004
Location: Capitola, CA
Distribution: Debian
Posts: 52

Original Poster
Rep: Reputation: 15
positive i used grub-install /dev/sda
 
Old 11-12-2012, 10:54 AM   #6
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
If you've retried running grub-install /dev/sda from the live CD without success, you might want to try the following:
1. Boot off the live CD
2. chroot to your Debian partition
3. run grub-install /dev/sda
 
Old 11-12-2012, 12:40 PM   #7
chovy
Member
 
Registered: Dec 2004
Location: Capitola, CA
Distribution: Debian
Posts: 52

Original Poster
Rep: Reputation: 15
Tried that too, still got an error.
 
Old 11-12-2012, 12:49 PM   #8
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,686

Rep: Reputation: 124Reputation: 124
Do you realise (and any of the other participants) that /dev/dsa is only correct IF on your system the disk your system resides on is actually named /dev/sda by the kernel of the live-distro? Most certainly it isn't, so you need to alter the command to reflect where the kernel actually has allocated your harddrive! Also: it's very much possible the kernel is instructed to use UUID's instead of the conventional node names (the /dev/sda names). Post the contents of the file /etc/fstab so we can get an idea of what the kernel is to work with.
 
Old 11-17-2012, 02:17 PM   #9
chovy
Member
 
Registered: Dec 2004
Location: Capitola, CA
Distribution: Debian
Posts: 52

Original Poster
Rep: Reputation: 15
Sorry, it took me awhile to get the file. Here is my /etc/fstab:

Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda1       /               ext3    errors=remount-ro 0       1
UUID=33cc2a56-5bfb-4043-a327-7610a96d6666       /               ext3    errors=remount-ro 0       1
# /dev/sda2       none            swap    sw              0       0
UUID=74e3941f-6166-403a-aa2f-1d7be8f393e4       none            swap    sw              0       0
# /dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/cdrom        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
 
Old 11-17-2012, 02:45 PM   #10
Hungry ghost
Senior Member
 
Registered: Dec 2004
Posts: 1,222

Rep: Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667Reputation: 667
Try this: boot the machine from a live cd, while on the live session, download the boot info script, and execute it as root. Then post the RESULTS.txt file here. Also, if you get any error please copy the exact error (verbatim), so we can have precise clues about the problem.
 
Old 11-17-2012, 04:34 PM   #11
chovy
Member
 
Registered: Dec 2004
Location: Capitola, CA
Distribution: Debian
Posts: 52

Original Poster
Rep: Reputation: 15
Here is the error when I run: grub-install /dev/sda

Is this the correct command to install grub to my MBR on /dev/sda??

Code:
/usr/sbin/grub-setup: warn: This GPT partition label has no BIOS Boot Partition; embedding won't be possible!.
/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 their use is discouraged..
/usr/sbin/grub-setup: error: if you really want blocklists, use --force.
Here is the output of bootinfoscript:



Code:
                  Boot Info Script 0.61      [1 April 2012]


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

 => Grub2 (v1.97-1.98) is installed in the MBR of /dev/sda and looks at sector 
    3676127474 of the same hard drive for core.img, but core.img can not be 
    found at this location.

sda1: __________________________________________________________________________

    File system:       ext3
    Boot sector type:  Grub2 (v1.97-1.98)
    Boot sector info:  Grub2 (v1.97-1.98) is installed in the boot sector of 
                       sda1 and looks at sector 3676176434 of the same hard 
                       drive for core.img, but core.img can not be found at 
                       this location.
    Operating System:  Debian GNU/Linux 6.0
    Boot files:        /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda2: __________________________________________________________________________

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

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

Drive: sda _____________________________________________________________________

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 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                   1 3,907,029,167 3,907,029,167  ee GPT


GUID Partition Table detected.

Partition    Start Sector    End Sector  # of Sectors System
/dev/sda1              34 3,900,998,080 3,900,998,047 EFI System partition
/dev/sda2   3,900,998,081 3,907,029,134     6,031,054 Swap partition (Linux)

"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/sda1        33cc2a56-5bfb-4043-a327-7610a96d6666   ext3       
/dev/sda2        74e3941f-6166-403a-aa2f-1d7be8f393e4   swap       

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/sda1        /                        ext3       (rw,errors=remount-ro)


=========================== sda1/boot/grub/grub.cfg: ===========================

--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set 33cc2a56-5bfb-4043-a327-7610a96d6666
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set 33cc2a56-5bfb-4043-a327-7610a96d6666
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt1)'
	search --no-floppy --fs-uuid --set 33cc2a56-5bfb-4043-a327-7610a96d6666
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/boot/vmlinuz-2.6.32-5-amd64 root=UUID=33cc2a56-5bfb-4043-a327-7610a96d6666 ro  
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.32-5-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt1)'
	search --no-floppy --fs-uuid --set 33cc2a56-5bfb-4043-a327-7610a96d6666
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/boot/vmlinuz-2.6.32-5-amd64 root=UUID=33cc2a56-5bfb-4043-a327-7610a96d6666 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.32-5-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.26-2-amd64' --class debian --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt1)'
	search --no-floppy --fs-uuid --set 33cc2a56-5bfb-4043-a327-7610a96d6666
	echo	'Loading Linux 2.6.26-2-amd64 ...'
	linux	/boot/vmlinuz-2.6.26-2-amd64 root=UUID=33cc2a56-5bfb-4043-a327-7610a96d6666 ro  
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.26-2-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.26-2-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_gpt
	insmod ext2
	set root='(hd0,gpt1)'
	search --no-floppy --fs-uuid --set 33cc2a56-5bfb-4043-a327-7610a96d6666
	echo	'Loading Linux 2.6.26-2-amd64 ...'
	linux	/boot/vmlinuz-2.6.26-2-amd64 root=UUID=33cc2a56-5bfb-4043-a327-7610a96d6666 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd.img-2.6.26-2-amd64
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
--------------------------------------------------------------------------------

=============================== sda1/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda1       /               ext3    errors=remount-ro 0       1
UUID=33cc2a56-5bfb-4043-a327-7610a96d6666       /               ext3    errors=remount-ro 0       1
# /dev/sda2       none            swap    sw              0       0
UUID=74e3941f-6166-403a-aa2f-1d7be8f393e4       none            swap    sw              0       0
# /dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/cdrom        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
--------------------------------------------------------------------------------

=================== sda1: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)

1752.999058723 = 1882.268406784 boot/grub/core.img                             1
1752.890645027 = 1882.151998464 boot/grub/grub.cfg                             1
1752.991154671 = 1882.259919872 boot/initrd.img-2.6.26-2-amd64                 3
1752.888840675 = 1882.150061056 boot/initrd.img-2.6.32-5-amd64                 7
1752.885739326 = 1882.146731008 boot/vmlinuz-2.6.26-2-amd64                    2
1752.963337898 = 1882.230051840 boot/vmlinuz-2.6.32-5-amd64                    3
1752.888840675 = 1882.150061056 initrd.img                                     7
1752.991154671 = 1882.259919872 initrd.img.old                                 3
1752.963337898 = 1882.230051840 vmlinuz                                        3
1752.885739326 = 1882.146731008 vmlinuz.old                                    2

Last edited by chovy; 11-17-2012 at 04:42 PM.
 
Old 11-17-2012, 07:10 PM   #12
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Use your live CD again and chroot into your install. Run (as root)
Code:
apt-get purge grub-pc grub-common
then, again as root;
Code:
apt-get install grub-pc grub-common
This should get you a working install of grub working and should install it on the mbr as opposed to sda1 where it is now installed according to your boot info.

Before doing this make very sure that your connection is not going to disapear while you do this. Not a real big concern as grub is not working now but having to do it several times would get very old very fast.

After you do this run the boot info script again and make sure that grub is installed to the mbr rather than sda1 or elsewhere and that it is actually finding the files it needs.

If not post all errors from the installation process and the new information text.
 
Old 11-17-2012, 07:44 PM   #13
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,131

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
One imagines the gpt reference might be a hint.
Looks like the type field of sda1 has been changed to x'ee' - if that was changed back to x'83' I suspect all would again work as expected. I would do it from fdisk personally, but any of the partitioning tools should be o.k.

And yes, "grub-install /dev/sda" command looks correct.
 
Old 11-17-2012, 11:34 PM   #14
chovy
Member
 
Registered: Dec 2004
Location: Capitola, CA
Distribution: Debian
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by widget View Post
This should get you a working install of grub working and should install it on the mbr as opposed to sda1 where it is now installed according to your boot info.
Where do you see that it is installed to /dev/sda1 instead of MBR on /dev/sda?

---------- Post added 11-18-12 at 05:34 AM ----------

Quote:
Originally Posted by syg00 View Post
One imagines the gpt reference might be a hint.
Looks like the type field of sda1 has been changed to x'ee' - if that was changed back to x'83' I suspect all would again work as expected. I would do it from fdisk personally, but any of the partitioning tools should be o.k.

And yes, "grub-install /dev/sda" command looks correct.

How do I flip the x'ee' bit back to x'83'?
 
Old 11-18-2012, 07:23 AM   #15
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Quote:
Originally Posted by chovy View Post
How do I flip the x'ee' bit back to x'83'?
Something like this:
Code:
~$ sudo fdisk /dev/sda
[sudo] password for a: 

Command (m for help): t
Partition number (1-12): 1
Hex code (type L to list codes): 83
Changed system type of partition 1 to 83 (Linux)

Command (m for help):  w

Last edited by RockDoctor; 11-18-2012 at 07:28 AM. Reason: fix formatting
 
  


Reply



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
Cant boot after power failure landysaccount Linux - Newbie 3 01-07-2010 06:40 AM
No GUI after power failure at boot. Imajica666 Linux - Desktop 5 06-07-2008 12:40 PM
need help.. power failure now no boot vbtalent Fedora 2 11-02-2005 06:51 PM
Power Failure, cause bootup to grub Johnny Hutto Linux - Newbie 9 08-23-2003 08:29 AM
boot problem after power failure radulucian Linux - Newbie 1 06-30-2003 04:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:20 AM.

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