Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB "Error 5: Partition table invalid or corrupt"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Sun May 16, 2010 12:51 am    Post subject: GRUB "Error 5: Partition table invalid or corrupt" Reply with quote

I just installed a fresh Gentoo on a system known to be working, and it's unable to boot. The error it gets is "Error 5: partition table invalid or corrupt" on trying to boot Linux from the /boot partition (/dev/sdc1). This doesn't make any sense, since I can boot into SystemRescueCD and consistently do whatever I want with respect to mounting or unmounting the partitions on the disk. In fact, GRUB is even able to read its configuration file, since it can get that far.

Here's fdisk -l from SystemRescueCD:
Code:
% fdisk -l /dev/sdc

Disk /dev/sdc: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1          32      257008+  83  Linux
/dev/sdc2              33         519     3911827+  83  Linux
/dev/sdc3             520        7047    52436160   83  Linux
/dev/sdc4            7048       24321   138753405   85  Linux extended
/dev/sdc5            7048        7701     5253223+  83  Linux
/dev/sdc6            7702       12924    41953716   83  Linux
/dev/sdc7           12925       14883    15735636   83  Linux
/dev/sdc8           14884       24321    75810703+  83  Linux
This is my menu.lst:
Code:
# Which listing to boot as default. 0 is the first, 1 the second etc.
default 0
# How many seconds to wait before the default listing is booted.
timeout 5
# Nice, fat splash-image to spice things up :)
# Comment out if you don't have a graphics card installed
splashimage=(hd2,0)/grub/splash.xpm.gz

title Gentoo Linux Hardened 2.6.29

# Partition where the kernel image (or operating system) is located
root (hd2,0)
kernel /kernel-2.6.29-hardened root=/dev/sdc3
The grub-install command verifies that (hd2) = /dev/sdc:
Code:
# grub-install /dev/sdc
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)   /dev/sda
(hd1)   /dev/sdb
(hd2)   /dev/sdc


What's causing this error to come up? How can I fix it?
_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sun May 16, 2010 2:40 am    Post subject: Reply with quote

Quote:
# Partition where the kernel image (or operating system) is located
root (hd2,0)
kernel /kernel-2.6.29-hardened root=/dev/sdc3

should be
Quote:
# Partition where the kernel image (or operating system) is located
root (hd2,0)
kernel /boot/kernel-2.6.29-hardened root=/dev/sdc3

to be standard

boot sysresccd
Code:
fdisk -l

post the result
mount the gentoo partitions
Code:
mount

post the result
are you intending to enter bios and change the drive boot order each time you wish to boot a different hard drive?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Sun May 16, 2010 5:05 pm    Post subject: Reply with quote

OP: please also provide the output of file -s /dev/sd[a-d]{,?}. According to info '(grub.info.bz2)Stage2 errors':
info '(grub.info.bz2)Stage2 errors':
5 : Partition table invalid or corrupt
     This error is returned if the sanity checks on the integrity of the
     partition table fail. This is a bad sign.

It is not immediately clear whether Grub checks all disks or only the one from which it will boot a kernel. I would expect that for simplicity reasons, they would check only the disk from which Grub intends to boot. One possible explanation for your problem is that you are afflicted with one of the BIOSes that reorders drives so that the boot drive is (hd0) at the time Grub runs, even if it was something else when Grub was installed. It may be enlightening to drop into the grub command line and run find /kernel-2.6.29-hardened. It could be the case that when Grub is running, the BIOS has remapped the drives in such a way that (hd2) is sda or sdb, and that such hard drive does have a corrupt or invalid partition table.

DONAHUE wrote:
Quote:
# Partition where the kernel image (or operating system) is located
root (hd2,0)
kernel /kernel-2.6.29-hardened root=/dev/sdc3

should be
Quote:
# Partition where the kernel image (or operating system) is located
root (hd2,0)
kernel /boot/kernel-2.6.29-hardened root=/dev/sdc3

to be standard
Standard, but unnecessary if he really does have /boot on a separate partition, as it appears from the output posted. Grub navigates paths starting at the root of the volume specified by the root directive, so it starts with an effective current working root of /boot, then looks for /kernel-2.6.29-hardened from there. Many people place a symlink boot in /boot that points to ., which is the only reason that the form you gave works consistently across both boot-separate and boot-merged layouts.
DONAHUE wrote:
are you intending to enter bios and change the drive boot order each time you wish to boot a different hard drive?
Why do you ask that?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54216
Location: 56N 3W

PostPosted: Sun May 16, 2010 5:44 pm    Post subject: Reply with quote

Kenji Miyamoto,

Code:
# grub-install /dev/sdc
Unknown partition table signature


Shows you have lost the signature bytes at the end of the partition table. That ties in with
Code:
5 : Partition table invalid or corrupt
     This error is returned if the sanity checks on the integrity of the
     partition table fail. This is a bad sign.


It does not mean that the data in the partition table is corrupt.

Grub has not read anything other then the partition table to give you this error. grub-insatall modifies the stage1 and stage1.5 files as they are installed so it can fid its way around to be able to read your grub.conf.

Use a hexeditor and post the last two bytes in sector 0 of /dev/sdc. that addresses 0x01fe and 0x1ff
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Mon May 17, 2010 12:08 am    Post subject: Reply with quote

It's worth noting that /dev/sda and /dev/sdb are part of a Linux software RAID array, /dev/md0. There are no partitions in that array, but a filesystem only. That setup has worked for years without trouble. The only reason root is /dev/sdc is that's how the BIOS orders PATA and SATA drives.

Here's fdisk -l /dev/sdc:
Code:

Disk /dev/sdc: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1          32      257008+  83  Linux
/dev/sdc2              33         519     3911827+  83  Linux
/dev/sdc3             520        7047    52436160   83  Linux
/dev/sdc4            7048       24321   138753405   85  Linux extended
/dev/sdc5            7048        7701     5253223+  83  Linux
/dev/sdc6            7702       12924    41953716   83  Linux
/dev/sdc7           12925       14883    15735636   83  Linux
/dev/sdc8           14884       24321    75810703+  83  Linux
Here's mount:
Code:
udev on /dev type tmpfs (rw,relatime,size=10240k,mode=755)
/dev/sr0 on /livemnt/boot type iso9660 (ro,relatime,mode=0644)
/dev/loop0 on /livemnt/squashfs type squashfs (ro,relatime)
tmpfs on /livemnt/memory type tmpfs (rw,relatime)
none on / type aufs (rw,noatime,si=a5a291785d77742e)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
rc-svcdir on /lib/rc/init.d type tmpfs (rw,nosuid,nodev,noexec,relatime,size=1024k,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
usbfs on /proc/bus/usb type usbfs (rw,nosuid,noexec,relatime,devgid=85,devmode=664)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
/dev/sdc3 on / type reiserfs (rw,relatime)
/dev/sdc1 on /boot type ext3 (rw,noatime,errors=continue,data=ordered)
/dev/sdc5 on /var/tmp/portage type reiserfs (rw,relatime)
/dev/sdc7 on /var/log type reiserfs (rw,relatime)
/dev/sdc8 on /usr type reiserfs (rw,relatime)
/dev/sdc6 on /usr/portage type reiserfs (rw,relatime)
/dev/md0 on /home type xfs (rw,relatime,attr2,noquota)
none on /proc type proc (rw,relatime)
udev on /dev type tmpfs (rw,relatime,size=10240k,mode=755)
The last two bytes (of the 512-byte sector) are 0x55 and 0xAA.
_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Mon May 17, 2010 12:24 am    Post subject: Reply with quote

boot sysresccd
Code:
grub
find /boot/grub/stage1 # to verify (hdx,y), use the values actually returned below
root (hdx,y) # use values returned above
setup (hdx) # use value returned above, assuming you will set bios first boot drive to the gentoo nominal sdc drive
quit
reboot

Hopefully to installed gentoo system.
Think grub-install can't handle this situation.
Back to top
View user's profile Send private message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Mon May 17, 2010 12:36 am    Post subject: Reply with quote

Unfortunately, that still pointed to (hd2,0) like before, which means my menu.lst is valid.
_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Mon May 17, 2010 12:56 am    Post subject: Reply with quote

This is what I did this time:
Code:
% grub
Probing devices to guess BIOS drives. This may take a long time.

    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> find /boot/grub/stage1
 (hd2,0)

grub> root (hd2,0)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... failed (this is not fatal)
 Running "embed /boot/grub/e2fs_stage1_5 (hd2,0)"... failed (this is not fatal)
 Running "install /boot/grub/stage1 d (hd0) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.

grub> quit
%
I still get the error:
Code:
Booting Gentoo Linux Hardened 2.6.29

root (hd2,)

Error 5: Partition table involid or corrupt

Press any key to continue...

_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Mon May 17, 2010 1:07 am    Post subject: Reply with quote

boot sysresccd
Code:
grub
find /boot/grub/stage1 # returned (hd2,0), use the values actually returned below
root (hd2,0) # use values returned above
setup (hd2) # use value returned above,
quit
reboot

set bios first boot drive to the nominal sdc drive
menu.lst:

title Gentoo Linux Hardened 2.6.29

# Partition where the kernel image (or operating system) is located
root (hd0,0)
kernel /kernel-2.6.29-hardened root=/dev/sdc3
Back to top
View user's profile Send private message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Mon May 17, 2010 1:16 am    Post subject: Reply with quote

DONAHUE wrote:
set bios first boot drive to the nominal sdc drive
That was already set before I rebooted last time.
_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Mon May 17, 2010 1:34 am    Post subject: Reply with quote

good
but you setup (hd0)
and menu.lst pointed to (hd2,0) which was on a raid disk that grub can't read


Last edited by DONAHUE on Mon May 17, 2010 1:36 am; edited 1 time in total
Back to top
View user's profile Send private message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Mon May 17, 2010 1:35 am    Post subject: Reply with quote

DONAHUE wrote:
good
but you setup (hd0)
Except /dev/sdc (hd2) is the first bootable drive. The BIOS would've said that the drive was unbootable if it couldn't find GRUB on (hd2).
_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Mon May 17, 2010 1:39 am    Post subject: Reply with quote

if you can be literal and do the following:

edit menu.lst to:

Quote:
title Gentoo Linux Hardened 2.6.29

# Partition where the kernel image (or operating system) is located
root (hd0,0)
kernel /kernel-2.6.29-hardened root=/dev/sdc3


boot sysresccd
Code:
grub
find /boot/grub/stage1 # returned (hd2,0), use the values actually returned below
root (hd2,0) # use values returned above
setup (hd2) # use value returned above,
quit
reboot

set bios first boot drive to the nominal sdc drive

I think you will boot.

On most bios the selected boot drive will acquire the name (hd0) which name will be passed to grub. Grub run from the sysresccd (or the chroot) only guesses the drive names that bios will assign. frequently the guess is wrong. using the find command tells what name grub assigns to the drive with a readable /boot/grub/stage1 file (hd2 in this case). So root (hd2,0) tells grub where to find its files. setup (hd2) will tell it which MBR to setup and to place intermediate files after that MBR. If (hd2) is setup it will report embedding sectors and success.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Mon May 17, 2010 3:54 am    Post subject: Reply with quote

Kenji Miyamoto wrote:
This is what I did this time:
Code:
% grub
Probing devices to guess BIOS drives. This may take a long time.
If this was in response to my request, it appears you misunderstood. I wanted you to drop into the interactive command line mode of Grub stage2, as run from the hard disk immediately before you would otherwise select an operating system and receive error 5. Run the find from that interactive mode so that any BIOS remapping will be visible. Based on the output you provided, you ran this from a shell under Linux, which means you were running it while booted from the LiveCD.
Back to top
View user's profile Send private message
Kenji Miyamoto
Veteran
Veteran


Joined: 28 May 2005
Posts: 1452
Location: Looking over your shoulder.

PostPosted: Mon May 17, 2010 4:56 am    Post subject: Reply with quote

Well, I followed DONOUE's advice, and now the system boots until the kernel crashes and leaves me with a stack trace so deep I can't see the top of it. I also tried to build genkernel to get something that should work, but it wouldn't build.

I think it's time I switch to a binary distro. I had to do two complete installs of Gentoo this weekend to try to bring a system up to date, and it's ridiculous. Slackware, here I come.
_________________
[ Kawa-kun, new and improved!! ]

Alex Libman seems to be more of an anarchist than a libertarian.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Mon May 17, 2010 5:40 am    Post subject: Reply with quote

a beautiful guide to trouble shooting kernel boot failures
if you decide to pursue:
most likely problem is an old .config that does not handle the perturbation in hard drive controller drivers that has occurred in the last year or so.
boot sysresccd and run
Code:
lspci -k
and post result.
mount gentoo partitions and run
Code:
grep -i fs /mnt/gentoo/usr/src/linux/.config
and post result
if possible a picture of the crash screen; if not possible, does the screen contain reference(s) to block(x,y) or available partitions or file systems? if so what x,y, what available partitions, file system on what block( , ) ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum