Author Topic: Fix GRUB?  (Read 1630 times)

0 Members and 1 Guest are viewing this topic.

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Fix GRUB?
« on: August 28, 2013, 09:43:49 am »
Im aware that if you somehow fuck up a dual boot, all you have to do is boot up a live Windows usb and run fix mbr and fix boot. That brings the windows boot back. But what if I have windows working already, and I am positive that all of the linux partitions still exist. How do I bring the GRUB back without installing linux all over again.
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Fix GRUB?
« Reply #1 on: August 28, 2013, 09:53:02 am »
This seems to give multiple outlets
 http://www.av8n.com/computer/htm/grub-reinstall.htm

If anythin I would think it is a matter of reinstalling the bootloader, whether it be grub or other. If the OS is okay, the bootloader should see it.
>>>import this
-----------------------------

Offline flowjob

  • Knight
  • **
  • Posts: 327
  • Cookies: 46
  • Pastafarian
    • View Profile
Re: Fix GRUB?
« Reply #2 on: August 28, 2013, 10:35:11 am »
On arch reinstalling grub helped me...
But it should be possible with grub-setup (or grub-bios-setup for bios in arch) too..
Quote
<phil> I'm gonna DDOS the washing machine with clothes packets.
<deviant_sheep> dont use too much soap or youll cause a bubble overflow

Offline Mordred

  • Knight
  • **
  • Posts: 360
  • Cookies: 135
  • Nvllivs in Verba
    • View Profile
Re: Fix GRUB?
« Reply #3 on: August 28, 2013, 01:18:56 pm »
EasyBCD can automatically install a GRUB-based bootloader called NeoGrub. It'll be chainloaded from the Windows bootloader, and you can edit its configuration file from within Windows. Basically you will first get the Windows loader and then, if you select a linux partition for instance it will load NeoGrub.

If I'm not mistaking I even managed to update NeoGrub to GRUB2.
\x57\x68\x79\x20\x64\x69\x64\x20\x79\x6f\x75\x20\x65\x76\x65\x6e\x20\x66\x75\x63\x6b\x69\x6e\x67\x20\x73\x70\x65\x6e\x64\x20\x74\x68\x65\x20\x74\x69\x6d\x65\x20\x74\x6f\x20\x64\x65\x63\x6f\x64\x65\x20\x74\x68\x69\x73\x20\x6e\x69\x67\x67\x72\x3f\x20\x44\x61\x66\x75\x71\x20\x69\x73\x20\x77\x72\x6f\x6e\x67\x20\x77\x69\x74\x68\x20\x79\x6f\x75\x2e

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: Fix GRUB?
« Reply #4 on: August 28, 2013, 09:44:55 pm »
Well, I've actually gone through the install process for reinstalling GRUB. To no avail. Much to my surprise that EasyBCD thing worked, thanks Mordred. I've already read quite a few articles on it but I just can't figure out how to get it back to GRUB2 instead of that Neosmart loader though. How did you do it Mordred?

Quote
- mkdir /mnt/root/

- mount /dev/sdXX /mnt/root

- arch-chroot /mnt/root

- mount /boot

- grub-mkconfig -o /boot/grub/grub.cfg

- grub-install /dev/sdXX

Those are basically the commands I ran. Normally once I get to the arch-chroot step it says some error along the lines of: /mnt/root/proc does not exist. Or something like that.
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python

Offline Mordred

  • Knight
  • **
  • Posts: 360
  • Cookies: 135
  • Nvllivs in Verba
    • View Profile
Re: Fix GRUB?
« Reply #5 on: August 28, 2013, 09:56:06 pm »
Well if with NeoGrub you managed to solve it, then you can use EasyBCD again to add the linux installation with GRUB2.

You should have an option like the one in this image



As you can see you can select GRUB2 from there and add it to the boot.

I think this is how I ended up doing it. I'm not 100% sure because it was like a year ago that I needed this and I had some bookmarks saved from then.
\x57\x68\x79\x20\x64\x69\x64\x20\x79\x6f\x75\x20\x65\x76\x65\x6e\x20\x66\x75\x63\x6b\x69\x6e\x67\x20\x73\x70\x65\x6e\x64\x20\x74\x68\x65\x20\x74\x69\x6d\x65\x20\x74\x6f\x20\x64\x65\x63\x6f\x64\x65\x20\x74\x68\x69\x73\x20\x6e\x69\x67\x67\x72\x3f\x20\x44\x61\x66\x75\x71\x20\x69\x73\x20\x77\x72\x6f\x6e\x67\x20\x77\x69\x74\x68\x20\x79\x6f\x75\x2e

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: Fix GRUB?
« Reply #6 on: August 28, 2013, 10:09:28 pm »
Even though it appears that we have the same software and version and everything, my options are slightly different. So you are saying that doing that makes it so that it loads straight to GRUB? Because I don't really want to see that ugly neosmart booter beforehand.

EDIT: Eh fuck it. Maybe I'll just reinstall  >:( :'(

« Last Edit: August 28, 2013, 10:11:54 pm by lucid »
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Fix GRUB?
« Reply #7 on: August 28, 2013, 10:29:11 pm »
You shouldn't need to reinstall since it is a bootloader issue. Have you checked what it says its missing?
>>>import this
-----------------------------

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: Fix GRUB?
« Reply #8 on: August 28, 2013, 10:36:29 pm »
You shouldn't need to reinstall since it is a bootloader issue. Have you checked what it says its missing?

I know, but recently I was kind of considering it anyway. Get a fresh start you know? This just isn't the way I wanted it to go down. Could you be more specific about your last question though? I would easily be able to reinstall GRUB except that arch-chroot doesn't want to work for me this time.

I know what I did wrong though. I was installing an OS onto a usb(no not burning it, I was actually installing it on my usb partition instead of my PC) and like a dumbass, when it got to the part about installing a bootloader I quickly just said yes because I've done this a million times(but not on a usb).

So basically I effectively wiped the boot part and installed in on the usb only. So the only way I could start up anything besides Windows was with the usb plugged in. Which, if done in purpose, is a really great way to secure your computer from physical intrusion  ;) , but not what I wanted at the time. Before I realized what happened I sort of panicked and went right to fixing the MBR.

So I fucked up.. and now I can't entirely fix it. At least I can still get into Arch now though...
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: Fix GRUB?
« Reply #9 on: August 30, 2013, 06:25:11 am »
Sorry for the double post but since I'm kind of updating the thread I figured a new post would be in order. So here's what I ended up doing.

I installed Debian onto my USB. It's not a live USB, I actually installed the system on it. I also installed GRUB onto said USB. Now, the only way anyone can get into any of my operating systems is if the flash drive is plugged in. When it loads up the GRUB I see Win7 and Arch(which were already on there) and Debian. If the flash drive isn't plugged in then it gives me an error and I can't boot into anything.

Kind of a fun little trick if you are paranoid. I'm going to try it out for awhile. The issue in this thread is solved, but I will leave it open for discussion about what was mentioned in this post.

EDIT:
Well if with NeoGrub you managed to solve it, then you can use EasyBCD again to add the linux installation with GRUB2.

You should have an option like the one in this image



As you can see you can select GRUB2 from there and add it to the boot.

I think this is how I ended up doing it. I'm not 100% sure because it was like a year ago that I needed this and I had some bookmarks saved from then.


Somehow I knew that this solution was gonna have a catch. Never trust a god damn Windows application that promises to fix a large problem. Now I  can't get rid of the damn thing. I plugged in the USB in order to see the Debian GRUB loader pop up, but if I select Win7 it takes me through the Neosmart loader as well. Which is a really unfavorable, and ugly trait. So I booted up my liveCD and ran fixboot and fixmbr. That way at least the Arch part is hidden without the USB, but instead of just booting straight into Windows as expected, it still takes me through the damn NeoSmart thing.

Also, another random question, and maybe this is obvious. But, when I plugged in my Debian usb to my girlfriend's computer it doesn't load up the GRUB like I thought it would. Instead it just doesn't boot at all. Any idea why?
« Last Edit: August 30, 2013, 06:53:20 am by lucid »
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python

Offline flowjob

  • Knight
  • **
  • Posts: 327
  • Cookies: 46
  • Pastafarian
    • View Profile
Re: Fix GRUB?
« Reply #10 on: August 30, 2013, 11:17:37 am »
Arch needs the /proc, /dev (and probably others) for starting as /proc contains important data about your hardware, and /dev the drive arch is installed on.
You'll have to bind the directory to the according chroot-directory
Code: [Select]
mount --bind /proc /mnt/procYou'll have to do the same at least for /dev too....
« Last Edit: August 30, 2013, 11:20:44 am by flowjob »
Quote
<phil> I'm gonna DDOS the washing machine with clothes packets.
<deviant_sheep> dont use too much soap or youll cause a bubble overflow

Offline Daemon

  • VIP
  • Baron
  • *
  • Posts: 845
  • Cookies: 153
  • A wise man fears a gentle mans anger
    • View Profile
Re: Fix GRUB?
« Reply #11 on: September 01, 2013, 01:35:54 am »
Quote
Also, another random question, and maybe this is obvious. But, when I plugged in my Debian usb to my girlfriend's computer it doesn't load up the GRUB like I thought it would. Instead it just doesn't boot at all. Any idea why?

You did press boot options (f12 as soon as it boots) and choose to boot from a USB device, right?


As for the GRUB re-install, what happens is that if you have a linux partition installed, with GRUB, then install windows, windows over-writes GRUB with its own bootloader. So *nix is still there, taking up HDD space, theres just no pointer to where it's located on the drive (to use programming terms)
Now im seriously getting pissed off though, because your the second person to have this problem recently, and i had the MOST excellent article detailing how to fix it easily. But... I can't find it. I cant recall if it was in one of my magazines, or online, but whatever the case I seem to have lost it :(
I'm going to keep searching, but try doing a google for something like "windows overwrite GRUB fix" and that might point you in the right direction
 
This lifestyle is strictly DIY or GTFO - lucid

Because sexploits are for h0edays - noncetonic


Xires burns the souls of HF skids as a power supply

Offline lucid

  • #Underground
  • Titan
  • **
  • Posts: 2683
  • Cookies: 243
  • psychonaut
    • View Profile
Re: Fix GRUB?
« Reply #12 on: September 01, 2013, 02:15:41 am »
You did press boot options (f12 as soon as it boots) and choose to boot from a USB device, right?


As for the GRUB re-install, what happens is that if you have a linux partition installed, with GRUB, then install windows, windows over-writes GRUB with its own bootloader. So *nix is still there, taking up HDD space, theres just no pointer to where it's located on the drive (to use programming terms)
Now im seriously getting pissed off though, because your the second person to have this problem recently, and i had the MOST excellent article detailing how to fix it easily. But... I can't find it. I cant recall if it was in one of my magazines, or online, but whatever the case I seem to have lost it :(
I'm going to keep searching, but try doing a google for something like "windows overwrite GRUB fix" and that might point you in the right direction

No my problem isn't that simple. I know how to fix the windows and GRUB problem, that's easy. What I'm trying to do at this point, is get this damn NeoSmart bootloader off my computer. Even if I fix the MBR it still loads the NeoSmart bootloader instead of booting straight into windows. Which is what I want it to do at the moment so I can then reinstall GRUB afterwards and my computer would be back to normal. But even if I uninstall the NeoSmart bootloader using the EasyBCD program and uninstall the EasyBCD program the fucking neosmart shit is still there.
« Last Edit: September 01, 2013, 02:16:36 am by lucid »
"Hacking is at least as much about ideas as about computers and technology. We use our skills to open doors that should never have been shut. We open these doors not only for our own benefit but for the benefit of others, too." - Brian the Hacker

Quote
15:04  @Phage : I'm bored of Python

xC

  • Guest
Re: Fix GRUB?
« Reply #13 on: September 01, 2013, 04:32:52 am »
The EasyBSD site says to simply remove the NeoSmart entry from the boot menu through the program, it should be listed as a variant of Linux. You should be able to choose GRUB from there as well if it doesn't automagically boot to it. I remember I overwrote my partitions MBR with EasyBCD awhile back and it somehow corrupt it, virtually unbootable until I did your method of reinstalling GRUB totally.