LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB error 17 (https://www.linuxquestions.org/questions/linux-newbie-8/grub-error-17-a-807656/)

scottstensland 05-13-2010 02:41 PM

GRUB error 17
 
on boot I'm getting

GRUB error 17

on a Windows vista dual boot with mandriva 2010,
and I'm using a mandriva LiveCD.

fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa8a8a8a8

Device Boot Start End Blocks Id System
/dev/sda1 * 1531 33247 254766802+ 7 HPFS/NTFS
/dev/sda2 1460 60801 476664615 5 Extended
/dev/sda3 1 1459 11718976+ a5 FreeBSD
/dev/sda5 1460 1530 570276 83 Linux
/dev/sda6 33248 50569 139138933+ 83 Linux
/dev/sda7 50570 51078 4088511 82 Linux swap / Solaris
/dev/sda8 51079 60801 78099966 83 Linux

I see other posts asking for output of
grub files in /etc/ none found on my kit,
closest I see is

cat /boot/grub/menu.lst.example
timeout 10
color 2
splashimage (hd0,4)/grub/mdv-grub_splash.xpm.gz
default 0
viewport 3 2 77 22
shade 1

title 2611-8
kernel (hd0,4)/vmlinuz-2.6.11-8mdk root=/dev/hda6 resume=/dev/hda1
initrd (hd0,4)/initrd-2.6.11-8mdk.img


other posts reference this block of cmds
to which I need to perserve my dual boot
so uncertain how to proceed

mkdir /mnt/temp
mount /dev/hdaX /mnt/temp
chroot /mnt/temp
grub-install /dev/hda
exit
reboot

How do I make sense of output of fdisk shown above to issue above block of cmds ? Am familiar with unix as a software developer, not sysadmin

thanks - Scott

saikee 05-13-2010 04:05 PM

You Grub setup seems a bit odd with this line
Code:

kernel (hd0,4)/vmlinuz-2.6.11-8mdk root=/dev/hda6 resume=/dev/hda1
your hda1 or sda1 is a NTFS partition that got nothing to do with Mandriva's kernel.

The other odd thing is your Grub call the partitions hda6 and hda1 as against the booted up Mandriva which call them sda6 and sda1.

You seem to have a /boot in sda5 and / in sda6.

I suggest you to edit the menu.lst and replace the above line with

Code:

kernel (hd0,4)/vmlinuz-2.6.11-8mdk root=/dev/sda6 ro
The red bits are my suggested change with the resume parameter dropped.

You don't need to do a grub-install yet. I am assuming your sda5 is the /boot directory and has the required splash image /grub/mdv-grub_splash.xpm.gz inside.

It is possible that your kernel detects the sdax partition and the hdax named devices cannot be loaded.

scottstensland 05-13-2010 05:07 PM

no change, still getting GRUB error 17
after rebooting with your suggested edits of my :

/boot/grub/menu.lst.example

do I need to rename to this /boot/grub/menu.lst ?

I have not issued the grub-install

I find it bizarre LiveCD (mandriva) does not come with
a GRUB diag & repair application - super GRUB or such ?
must be political as its certainly in best interest of end users
to make such GRUB fixes avail.

next step ? should I post output of which cmd(s) ?

I really appreciate your help - Scott

saikee 05-13-2010 06:27 PM

You can rename your menu.lst to another name, say rubbish.txt. Grub will then be able to boot to a Grub prompt to enable you to boot the systems manually.

Believe me there is no installed operating system that cannot be booted by a Grub prompt.

In a Grub prompt you can fire up your renamed menu.lst any time with command
Code:

root (hd0,4)
configfile /boot/grub/rubbish.txt

If your grub configuration file is healthy then Grub can boot it. Without it Grub defaults to a Grub prompt.

You can fire up your Mandriva manually in the following manner

If /boot is in sda5 and / is in sda6 you tell Grub the root is sda5 or (hd0,4) in Grub's term
Code:

root (hd0,4)
You then type
Code:

kernel /vmlinuz-2.6.11
and hit the tap key so that Grub searches the partition to find a file that match the beginning. If it find the kernel it will respond by adding the missing bit which mean you have hit the correct partition and directory. You then add "ro" for ready only and state the location of the / like this
Code:

kernel /vmlinuz-2.6.11-8mdk ro root=/dev/sda6
you then add the ramdisk file again let Grub do the first part as it will find the missing bit Iindicated in red.
Code:

initrd (hd0,4)/initrd-2.6.11-8mdk.img
If Grub has no complaint then there is a 85% chance your Mandriva will boot if you give Grub the green light by command
Code:

boot
The above is to bypass the menu.lst completely. Once you find the correct instructions then edit the menu.lst so that you don't have to boot it manually every time.

Believe me you don't need Supergrub. Just tell Grub directly what you want! You can get everything the horse's mouth this way.

scottstensland 05-13-2010 07:20 PM

here is output of the grub cmd I issued from LiveCD


grub> root (hd0,4)
Filesystem type unknown, partition type 0x83

here is

fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa8a8a8a8

Device Boot Start End Blocks Id System
/dev/sda1 * 1531 33247 254766802+ 7 HPFS/NTFS
/dev/sda2 1460 60801 476664615 5 Extended
/dev/sda3 1 1459 11718976+ a5 FreeBSD
/dev/sda5 1460 1530 570276 83 Linux
/dev/sda6 33248 50569 139138933+ 83 Linux
/dev/sda7 50570 51078 4088511 82 Linux swap / Solaris
/dev/sda8 51079 60801 78099966 83 Linux



let me backup and give context to my GRUB error 17

prior to the GRUB error my mandriva 2010 laptop
ran out of battery and shut down (evidently too abruptly).
On boot it complained about filesystem corruption
and requested I run fsck which I did.
The fsck ran over 90 mins at which point
I did a hard powerdown as I thought it was just looping.
On boot I then started getting GRUB error 17

I have since ran (via LiveCD) a fsck /dev/sda6
which is now clean. I feel /dev/sda5 needs fixing
as its saying

fsck /dev/sda5
fsck from util-linux-ng 2.16.1
e2fsck 1.41.9 (22-Aug-2009)
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sda5

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>


so then when I ran

e2fsck -b 8193 /dev/sda5
e2fsck 1.41.9 (22-Aug-2009)
e2fsck: Bad magic number in super-block while trying to open /dev/sda5

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>


So possible reason why GRUB is erroring is sda5 is bad.
Should I start a new thread ? or is there something above
I have overlooked to fix sda5 to then address the GRUB issue ?

any suggestions are very welcome - Scott

kurwongbah 05-13-2010 08:08 PM

Oh dear, looks like /dev/sda5 is broken beyond repair.
Grub tries to get its config from there and from that the kernel and ramdisk.
They are not there anymore...
Do you have a backup somewhere, dd dump or something?
You should make a point of umounting the /boot (/dev/sda5 in your case) every once in a while and do something like:
dd if=/dev/sda5 of=/var/backups/mybootpartition

There a a few possible scenarios in this case:
1) Boot from the live CD and restore your backup: dd of=/var/backups/mybootpartition if=/dev/sda5
Reboot
2) Boot from the live CD and recreate the boot partition by hand: mke2fs -t ext2 /dev/sda5
Copy files from the original install cd (or download the ones u where using from the repo mirror) to the newly created partition:
- kernel image (vmlinuz-2.6.11-8mdk)
- inird image (initrd-2.6.11-8mdk.img)
Reboot
Start grub boot process by hand as described above
When boot process works, proceed to grub-install
3) Reinstall Linux
If you have files you cannot miss, back em up:
a) Use Live cd and dd to backup root partition, if u have disk space to spare...
or b) Use Live cd and copy important data to your windows partition
or c) Boot windows, install ext2/3 driver from fs-drivers.org to access Linux partition and copy important files over to windows


All times are GMT -5. The time now is 05:28 AM.