[SOLVED] GRUB error 17 after many partition troubles
Linux - GeneralThis forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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?
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
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.
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
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.
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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.