LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   GRUB error 17 after many partition troubles (http://www.linuxquestions.org/questions/linux-general-1/grub-error-17-after-many-partition-troubles-761501/)

rbl_10 10-12-2009 10:06 PM

GRUB error 17 after many partition troubles
 
Hello,

At first I had problems with the LiveCD partitions manager, which frozen half-way into the process of reorganizating. Then, I got a totally unallocated disk under GParted, which I left alone as is, because I didnt want to start messing into that...

But then I booted with windows to take a look at its partition manager, which worked and showed me my linux partition, the windows one, the dell recovery one, one RAW of 2,2 GB and another one of 1,98. I disallocated the last two, because I knew one was the SWAP (which Linux didnt see anymore...) and the other one, well, I just didn't know.

Then when I tried to boot, I got the error 22 from GRUB which I solved myself, using forum posts and a usb key with Super Grub. It looked like wrong adressing only (GRUB thought root was on sda6 while it had moved to sda5 after windows repartionning), but now looks like I've come to a dead end... Linux boots well from the usb key and supergrub (I get the splash screen and the good root adressing), but not from the HD. I don't know what I should modify. I've read it might be a mouting point problem, and about that my sda5 is mounted on both "/" and "/dev/.static/dev. Maybe that's the problem?



So here's my fstab
Code:

# /etc/fstab: static file system information.
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
# /dev/sda5
UUID=9048964e-b6c7-4ff3-968c-5a8b3c05ae65 /              ext3    relatime,errors=remount-ro 0      1
# /dev/sda6
UUID=33bb40de-cbc4-4fc9-b04b-19a6a77a4475 none            swap    sw              0      0
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto,exec,utf8 0      0

and my fdisk
Code:

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe8000000

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1        655    5261256    7  HPFS/NTFS
/dev/sda2            656        3033    19101285    7  HPFS/NTFS
/dev/sda3            3034      14484    91980157+  5  Extended
/dev/sda5  *        3034      14349    90895707  83  Linux
/dev/sda6          14350      14484    1084356  82  Linux swap / Solaris

and menu.lst

Code:

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-legacy-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default                0

## Graphical boot menu location
gfxmenu=/boot/gfxmenu/default.message

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout                10

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title                Windows 95/98/NT/2000
# root                (hd0,0)
# makeactive
# chainloader        +1
#
# title                Linux
# root                (hd0,1)
# kernel        /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/sd5 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,4)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title                Linux Mint 6, kernel 2.6.27-7-generic
root                (hd1,4)
kernel                /boot/vmlinuz-2.6.27-7-generic root=/dev/sda5 ro quiet splash
initrd                /boot/initrd.img-2.6.27-7-generic
quiet

title                Linux Mint 6, kernel 2.6.27-7-generic (recovery mode)
root                (hd1,4)
kernel                /boot/vmlinuz-2.6.27-7-generic root=/dev/sda5 ro single
initrd                /boot/initrd.img-2.6.27-7-generic

title                Linux Mint 6, kernel Last successful boot
root                (hd1,4)
kernel                /boot/last-good-boot/vmlinuz root=/dev/sda5 ro quiet splash  last-good-boot
quiet

title                Linux Mint 6, memtest86+
root                (hd1,4)
kernel                /boot/memtest86+.bin root=/dev/sda5
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title                Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title                Dell Utility Partition
root                (hd1,0)
savedefault
makeactive
chainloader        +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title                Vista
root                (hd1,1)
savedefault
makeactive
chainloader        +1


device.map is set to (hd1) /dev/sda

and finally blkid

Code:

/dev/sda2: UUID="E87A9AC67A9A9144" LABEL="VISTA" TYPE="ntfs"
/dev/sda3: UUID="E87A9AC67A9A9144" LABEL="VISTA" TYPE="ntfs"
/dev/sda5: UUID="9048964e-b6c7-4ff3-968c-5a8b3c05ae65" TYPE="ext3"
/dev/sda6: UUID="1c0c58bc-d1ca-449b-814b-4951d1d860b7" TYPE="swap"
/dev/loop0: TYPE="squashfs"
/dev/mmcblk0p1: SEC_TYPE="msdos" UUID="172C-2B05" TYPE="vfat"
/dev/sda1: UUID="28CA626ACA62346A" LABEL="RECOVER" TYPE="ntfs"

Hope somebody can help me out of this!

Thanks alot,

Raphael

Wim Sturkenboom 10-12-2009 11:18 PM

Doesn't grub start counting from 0? So hd1,4 should be hd0,4? I don't have a machine with grub at hand to verify.

rbl_10 10-13-2009 12:50 PM

Well, it looks like my root is situated at hd(1,4), but I could try changing that to (0,4) and changing everything else in menu.lst and default.map. Default value in GRUB after partions changes was hd(0,5) if I remember correctly. I'll try that right away.

rbl_10 10-13-2009 12:58 PM

Tried it, and at first, w/o the usb key, I got the error 17 as usual, but after booting with usb, i also got error 22. That means that the error is probably not in the partition table itself, but more in something that happens "before" the reading of the table.. mounting point maybe? But thx anyway :)

yancek 10-13-2009 05:09 PM

Your fdisk output shows only one hard drive with windows on sda1 and sda2 and Linux on sda5. Your entries in menu.lst should all be (hd0), (hd0,0) for windows if the OS is on sda1 and (hd0,4) for Mint.

Use your USB key or a Live CD, go to a terminal, create a mount point for sda5, mount it and then navigate to /boot/grub/menu.lst file and make the changes. Be sure to remove the USB key or Live CD, set the hard drive to first boot priority.

rbl_10 10-13-2009 06:25 PM

Well I managed to find the solution... You two were right about the (hd0) thing. I changed everything to (hd0,x) and it works fine now. But I also had to do

sudo grub
grub> root (hd0,4)
grub> setup (hd0)

And I think thats the important part; just changing parameters in menu.lst is not enough (I tried doing only that a while ago)

So thanks again, problem solved!


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