GRUB problem! Arghhh! Help!

Nesh

Double Agent
Legend
AFter having a little undesired adventure described here http://forum.beyond3d.com/showthread.php?t=46195

it seems that I have even more problems now.

Ubuntu got literally fucked up, so I reformatted the external disk with the Ubuntu OS and reinstalled it.

Now I cant access neither Ubuntu nor Vista.

I get a GRUB Error 17!

What do I do now??

I access my PC with Live CD, enter the GRUB folder, try to change a number in a file that is supposed to make my PC boot Vista as the default OS, but it is not letting me because it says I dont have the permission!

I would greatly appreciate any help
 
When using the LiveCD sure you are root. By default you are not root. All you should need to do is use "su" to change to root in a terminal window.
 
I just opened a terminal
Typed "su"
It then asked for a password. I dont know what password it wants, I used the password I created at the installation and pressed enter but that doesnt seem to work. Unless I did something else wrong.
 
Yeah found how to do it in google. But it seems that despite that I "root" I still dont have permission!!

Damn it!!

What do I do now? Any more ideas?
 
Perhaps the livecd mounts your partitions read-only? Can you modify any other files on the partition?
 
if you speak about the device-map file - dont bother, it wont fix anything (though you should fix it once your system can boot again).
If you have access to a floppy, id recommend you to install Grub to it (via Live-CD) and boot it, then follow that Procedure. Installing on USB-Stick should work too, but might mess up your boot order(installing grub wrong again).

But then installing grub to depend on an external disk is probably asking for trouble - it wont be able to boot without that disk, and probably wont work if you change the Sata/USB-Port your disk is attached to.
 
Can you get the GRUB command prompt? Is GRUB getting as far as displaying a menu of possible operating systems to boot, or is it error 17'ing before that?

I Googled for "grub error 17" and a few posts seem to suggest the problem might be related to the boot drive order set in the BIOS.
 
Yeah I think it should be related to the boot drive order too. Grub is not getting into the menu where the possible operating systems are listed.

It showed that before it got screwed.

Unfortunately I dont have a floppy drive

I ve made a thread in the ubuntu forums and this is the situation currently

http://ubuntuforums.org/showthread.php?t=657971
 
Last edited by a moderator:
You can't write to any other file either? That does sound as if it is read-only

Type "mount" to the command line and see if your partitions have "rw" or just "r".
 
If it's a boot order (error 17 usually is) then you need to change the boot order in your BIOS.
 
The problem is, that editing files on the Ubuntu-partition wont help.
You need to install grub on your first drive( Bios-Boot-Order ) while giving it the right parameters.
eg.

sudo grub --device-map=mydev.map // should create a device-map file
quit

you need to edit this "mydev.map" file so it correspondends to the bios-boot-order (i dunno how to get this information reliable, youll need to guess). You can then install grub and hope the mapping was right:

sudo grub --device-map=mydev.map // start interactive mode
root (hdx,y) // select partition with ubuntu to search for grub-images
setup (hd0) // install (only a very small part of) Grub to the first drive
quit
 
If it's a boot order (error 17 usually is) then you need to change the boot order in your BIOS.
He reinstalled Ubuntu, the problem is that when Grub is installed, it gets the position of some crucial files (stage2) hardcoded as position on the disk (it cant deal with filesystems at that time). Likely this position wont be the same if you reinstall and the result is that Grub wont load.
 
Thats weird. I run mount and everything is RW still it wont let me change files.
The problem is, that editing files on the Ubuntu-partition wont help.
You need to install grub on your first drive( Bios-Boot-Order ) while giving it the right parameters.
eg.

sudo grub --device-map=mydev.map // should create a device-map file
quit

you need to edit this "mydev.map" file so it correspondends to the bios-boot-order (i dunno how to get this information reliable, youll need to guess). You can then install grub and hope the mapping was right:

sudo grub --device-map=mydev.map // start interactive mode
root (hdx,y) // select partition with ubuntu to search for grub-images
setup (hd0) // install (only a very small part of) Grub to the first drive
quit
Ok done it. In the mydev.map I get

(hd0) /dev/sda
(hd1) /dev/sdf
(hd2) /dev/sdg

Which ones do I change? the numbers in hd#'s?

I did sommthing similar to what you suggested but didnt work and it goes like this.
The method shown above puts GRUB back on the MBR (master boot record) of the hard drive instead of in the root partition. But you probably won't want that, if you use a third-party boot manager like Boot Magic or System Commander. (The original poster also suggested that this would be useful to restore the Grub menu after a re-ghosting.) In that case, use this alternative.

This alternative, used without a third-party boot manager, will not cause Ubuntu to boot.

1. Boot from a Live CD, like Ubuntu Live, Knoppix, Mepis, or similar.

2. Open a Terminal. Open a root terminal (that is, type "su" in a non-Ubuntu distro, or "sudo -i" in Ubuntu). Enter root passwords as necessary.

3. Type "grub" which makes a GRUB prompt appear.

4. Type "find /boot/grub/stage1". You'll get a response like "(hd0)" or in my case "(hd0,3)". Use whatever your computer spits out for the following lines. Note that you should have mounted the partition which has your Linux system before typing this command. (e.g. In Knoppix Live CD partitions are shown on the desktop but they're not mounted until you double-click on them or mount them manually)

5. Type "root (hd0,3)".

6. Type "setup (hd0,3)". This is key. Other instructions say to use "(hd0)", and that's fine if you want to write GRUB to the MBR. If you want to write it to your linux root partition, then you want the number after the comma, such as "(hd0,3)".

7. Type "quit".

8. Restart the system. Remove the bootable CD.
 
Thats weird. I run mount and everything is RW still it wont let me change files.

Ok done it. In the mydev.map I get

(hd0) /dev/sda
(hd1) /dev/sdf
(hd2) /dev/sdg

Which ones do I change? the numbers in hd#'s?
you can change either side. hd0 should point to the drive thats set as first boot device in your bios - if you can choose drives there, then hd1 to the "next" one. The Bios will enumerate them in some way, which aint controlled by standard or a common procedure. But usually if eg. all drives are Sata they are gonna be in the order of the numbers on the connectors. You can unfortunatly only guess there - booting with a floppy or CD with grub installed would be the safe way (come to think of it - you can try installing ubuntu with the Alternate-CD if everything else fails - Im not 100% sure, but this should take care of it)

Edit: and youll finally need to set root (hdx,y) according to the device-map. if Ubuntu is for example /dev/sdf2 and /dev/sdf is mapped to hd1, then use root (hd1,2)

I did sommthing similar to what you suggested but didnt work and it goes like this.
Well, they said you need a third party Bootmanager for this to work.
 
Last edited by a moderator:
Ok I disconnected my internal HDD living only the external, did the first step and it worked this time :)

Now the only think I am left to do is set Windows as the default OS but I dont know how

edit: Last also fixed :D
 
Last edited by a moderator:
Ok I disconnected my internal HDD living only the external, did the first step and it worked this time :)

Now the only think I am left to do is set Windows as the default OS but I dont know how

edit: Last also fixed :D
Uhh.. does it work if you reconnect the internal drive?
 
Back
Top