LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-14-2013, 05:19 PM   #1
spyke100
LQ Newbie
 
Registered: Feb 2013
Posts: 4

Rep: Reputation: Disabled
Screwed up my MBR


I tried installing lilo for a dual-boot (Win 7, Ubuntu), but ended up unsuccessful. After removing it, and installing grub again. I found that Lilo is still written as default on the MBR. Problem is now, I have the Linux option but it doesnt load Linux at all.

I've been forced to but into the Ubuntu LiveCD for the moment. Is there a way I can clear/create/repair my harddrives MBR (without booting into it)?
 
Old 02-14-2013, 06:23 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
I guess the first qn is; do you want to retain the MSWin and go for dual boot again, or are you ok to just have Linux on that box?

Given you can boot off the Live-CD, can you open up a terminal and run
Code:
sudo fdisk -l
lowercase L there
 
Old 02-14-2013, 06:59 PM   #3
BeaverusIV
Member
 
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 133

Rep: Reputation: 18
https://help.ubuntu.com/community/Wi...s_After_Ubuntu

This should help. Reinstall GRUB that way to get back your menu and you can either try again or reclaim the partition.
 
Old 02-14-2013, 07:40 PM   #4
spyke100
LQ Newbie
 
Registered: Feb 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
I guess the first qn is; do you want to retain the MSWin and go for dual boot again, or are you ok to just have Linux on that box?

Given you can boot off the Live-CD, can you open up a terminal and run
Code:
sudo fdisk -l
lowercase L there
Yes. so far this is the information it spits out. Thanks in advance.

Code:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000415ba

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      409599      203776   17  Hidden HPFS/NTFS
/dev/sda2          409600   904607743   452099072    7  HPFS/NTFS/exFAT
/dev/sda3       904609790   935329791    15360001    5  Extended
/dev/sda4       935329792   976560127    20615168   17  Hidden HPFS/NTFS
/dev/sda5       904609792   927475711    11432960   83  Linux
/dev/sda6       927477760   935329791     3926016   82  Linux swap / Solaris

Disk /dev/sdb: 4083 MB, 4083351552 bytes
128 heads, 63 sectors/track, 989 cylinders, total 7975296 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          56     7975295     3987620    c  W95 FAT32 (LBA)
 
Old 02-14-2013, 08:20 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Yes to what??

1. attempt dual boot again
(if this, see the link by BeaverusIV)
OR
2. go with Linux only
 
Old 02-14-2013, 09:01 PM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Repair windows boot first then reinstall grub, it clearly shows wins is there
 
1 members found this post helpful.
Old 02-14-2013, 09:06 PM   #7
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by EDDY1 View Post
Repair windows boot first then reinstall grub, it clearly shows wins is there
If you don't have windows dvd you can download from neosmart it's no longer free not sure how much. http://neosmart.net/blog/2009/window...-repair-discs/
 
1 members found this post helpful.
Old 02-14-2013, 09:14 PM   #8
rokytnji
Senior Member
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: AntiX 15 , ChromeOS
Posts: 4,919
Blog Entries: 19

Rep: Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137
Quote:
Originally Posted by EDDY1 View Post
If you don't have windows dvd you can download from neosmart it's no longer free not sure how much. http://neosmart.net/blog/2009/window...-repair-discs/


http://www.smartestcomputing.us.com/...allation-disk/
 
1 members found this post helpful.
Old 02-15-2013, 12:02 AM   #9
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by rokytnji View Post
Thats a good 1 all you need to do is use your own product key on repair install.
 
Old 02-15-2013, 12:20 AM   #10
spyke100
LQ Newbie
 
Registered: Feb 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
First of all thank you all very much for your help. I've managed to get back to my Ubuntu using boot-repair. Only problem I'm coming across is I cannot boot into my Windows at all. I get a the Lilo menu after boot, but it is not installed in the system.

On an alternate note: I have a recovery partition for my Windows(/dev/sda4 - if you look at the table above) and not the actual disk/key. What would be your recommendations going about that.
 
Old 02-15-2013, 12:29 AM   #11
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Is the windows recovery partition xp or 7 either way for windows recovery partition you don't need a key.
 
Old 02-15-2013, 02:13 AM   #12
spyke100
LQ Newbie
 
Registered: Feb 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Its windows 7. However the partition is not mounted at all. I can edit the lilo.conf file, and add the partition to the menu, however I cannot write (run) lilo since I dont have it installed. This is where it gets tricky. When I boot up, I still get the Lilo bootloader with the old options.

Last edited by spyke100; 02-15-2013 at 02:15 AM.
 
Old 02-15-2013, 11:47 AM   #13
Arelatensis
Member
 
Registered: Oct 2010
Location: Russian Federation, Udmurtia
Distribution: CentOS, Aptosid, Mageia, OpenMandriva, Ubuntu
Posts: 48

Rep: Reputation: 2
I suppose, that you reinstall Grub2 package, not boot records for it, and vice versa uninstalled that of Lilo but it still has boot record.
So you must reinstall grub for MBR. Here is a simple instruction through Live CD. in terminal http://blogging.dragon.org.uk/index....rub2-on-ubuntu. The community official instruction also apt (https://help.ubuntu.com/community/Gr...talling_GRUB_2), but it has many details (as using btrfs file system), that as, I can understand not important for you.
Some tips.
Sudo is good for one action as Super User. If you need make a series of the actions, it is better switch to SU mode entirely for a time: sudo -s command gives you #
Root partition (for first command), where /boot/grub files are, In you case it sda5.
grub-install (grub-install --recheck) must have format /dev/sda without any number. If you put a number e. g. /dev/sda5, you will install grub in partition not in MBR of first hard drive.
It is also advices to mount /sys (sudo mount --bind /sys /mnt/sys); from my experience I don't find it necessary.
You can process it also from a terminal emulator in full graphical Live session, it is not necessary fall back in console mode.

So when you make ubuntu boot able through the Grub 2 (I hope successfully), it needs costomize Grub so that it could boot Windows. The simplest way in Ubuntu install graphical utility Grub-Costomizer from PPPA (https://launchpad.net/~danielrichter...rub-customizer). Otherwise you can manually edit /etc/drub.d/40_costom and add something like this:
}
menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 32C2B4EDC2B4B707
chainloader +1
}
Excuse me I don't use Windows.
 
Old 02-15-2013, 04:22 PM   #14
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 173
Blog Entries: 5

Rep: Reputation: 17
A small question: where did you install your LILO bootloader? Under Linux or under Windows??
 
Old 02-15-2013, 04:36 PM   #15
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 173
Blog Entries: 5

Rep: Reputation: 17
There's one other thing you may be able to use: if you have a hidden repair partition that can be booted from a bootloader, then boot it.

Then you may be able to use the "startup recovery" or a "recovery console". "Startup recovery" must fix all bootup issues automatically, without asking for a key.
If it doesn't/can't/"can't find any system to repair"(you know silly standard answers MS tools spit off), then you can choose "recovery console" and use the
Quote:
`bootrec.exe`
utility to restore the partitions boot record windows-style.
That will recover your Windows boot capabilities, then you'll have to reinstall GRUB2 into MBR, but your Windows partition will be bootable at least. Unlike Linux, there's no way to recover Windows partition boot capabilities by editing conf. files. They use binary formats produced by MS Win tools only.

Oh, and to boot it with GRUB you may need to use "unhide" option as described here...

I beg everyone's pardon for posting Windows-specific info here, but you see I spent you won't believe how much time trying to find these most simple answers. As you all know that poor OS is as poorly supported/documented.
...

Last edited by kostya; 02-15-2013 at 04:37 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Screwed up the mbr of Windows install! need help? Nabeel Linux - Newbie 6 02-15-2013 01:14 PM
Suse 10.1 has screwed up my MBR d_GeNeRiT SUSE / openSUSE 2 10-12-2006 10:59 PM
Duel boot MBR screwed 101010 Linux - Newbie 20 07-22-2004 01:23 PM
really screwed MBR jimmywithtorch Linux - Software 4 03-15-2004 04:34 AM
screwed up mbr hooligan Linux - Software 5 10-17-2001 01:59 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration