LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-05-2009, 10:50 AM   #1
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,739
Blog Entries: 27

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
How do I restore my original GRUB and menu.lst?


Whilst adding OS #3 (SliTaz) to my multi-boot system, I somehow managed to allow the little blighter to install its GRUB to MBR.

How do I restore my original GRUB and /boot/grub/menu.lst (which did show just Ubuntu 8.10 and antiX?

Partitions as follows:

Ubuntu 8.10 sda1 (root partition*), sda2 swap, sda3 /home

antiX sda5 (root partition), sda6 swap, sda7 /home

SliTaz sda8 (root partition), sda9 swap, sda10 /home

I have used the Ubuntu 8.10 Live CD to try to restore GRUB to MBR but I still end up with SliTaz booting from (hd0,0) and not Ubuntu 8.10.

Do I need to use Midnight Commander or similar to get my original Ubuntu/antiX GRUB back on MBR?

I do have a backup of my original Ubuntu home partition on my 2nd HDD (sdb) but I would prefer to locate the original /boot/grub/menu.lst and copy this to (hd0,0).

Any suggestions will be gratefully received.

Last edited by beachboy2; 05-06-2009 at 04:05 AM.
 
Old 05-05-2009, 11:52 AM   #2
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
Just to be sure can you post the out come of the command fdisk - l as root and youŕe menu.lst
(hd0,0) only means the first partition of the boot HD.
Meaning if you make sdb the first boot HD during install the first partition of sdb is (hd0,0) too

Last edited by ronlau9; 05-05-2009 at 11:54 AM. Reason: save too soon
 
Old 05-05-2009, 12:54 PM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
can you boot into Ubuntu with the current grub menu ?

if so then boot into Ubuntu, backup your menu.lst just in case and then install grub to the MBR using grub-install /dev/sda

if your current grub menu won't allow you to boot into Ubuntu an easy work around is to grab the supergrub boot disk, boot your PC with it and use it to boot into Ubuntu. then do the grub-install once you are in Ubuntu,
 
Old 05-05-2009, 03:55 PM   #4
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,739

Original Poster
Blog Entries: 27

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
farslayer,

Thanks for your reply.
The current boot menu is that of SliTaz so the standard “GRUB Restore” method, via GRUB prompt (grub>), does not change this to that of Ubuntu.

I have just downloaded SGBD and burned it to a CD.

I cannot find too much info on my particular situation at the SGBD website.
Once I have booted from the SGBD what can I expect to see? Will there be several options or what?

Is it clear how I should proceed to boot into Ubuntu?

My Ubuntu root partition is sda1, so do I use:

# grub-install /dev/sda1

instead of sda as you suggested?

Thanking you in anticipation.
 
Old 05-05-2009, 07:20 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware, Ubuntu
Posts: 10,094

Rep: Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369
Quote:
My Ubuntu root partition is sda1, so do I use:

# grub-install /dev/sda1

instead of sda as you suggested?
No. If you use sda1 it will install files to the root partition and you won't have anything in the mbr and likely no change. You haven't posted your fdisk -l output or your menu.lst. Your setup isn't clear to me. What you indicate in your first post is that you have a boot, swap and home partition for Ubuntu. Where are your system files (root) or was that just a type?

A backup of your /home partitin won't help you get your menu.lst as it is not in the /home directory, unless you made a copy and saved it there??

If your Ubuntu root partition is sda1 you can go to the Grub prompt and type:

root (hd0,0)
setup (hd0)
quit

to re-install Grub.
 
Old 05-06-2009, 04:05 AM   #6
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,739

Original Poster
Blog Entries: 27

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
yancek,
Thanks for your response about sda.
I have amended my original post to try to clarify matters.
sda1 is my Ubuntu root partitition, where I originally booted from. My Ubuntu GRUB originally resided on the MBR.
The Ubuntu menu.lst also took care of the booting of antiX from sda5. The GRUB for antiX resides in its root partition, sda5.
I was trying to add a third OS (SliTaz), booting from its root partition,sda8, but unfortunately I replaced the Ubuntu GRUB on MBR with the one from SliTaz.

I need to find the original file for the Ubuntu GRUB and replace the current one from
SliTaz.

I have tried the method you suggest (grub> prompt method) and all it does is put the SliTaz GRUB on MBR.

The Super Grub Disk method may work but I have never used it and I have no wish to make things even worse.

Is there a way for Midnight Commander (mc) to track down my original Ubuntu GRUB and menu.lst to replace the SliTaz ones?

To those who requested fdisk -l and menu.lst outputs, I am sorry but things are SNAFU at the moment for reasons which are too complicated to explain.

If you need further clarification, please ask.
 
Old 05-06-2009, 04:11 AM   #7
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,629

Rep: Reputation: Disabled
Another way is to boot from the Ubuntu LiveCD and reinstall grub. That will give you your original grub but hopefully with newer distribution already added to menu.lst.
 
Old 05-06-2009, 04:17 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681Reputation: 681
You can manually enter the "kernel" & "initrd" lines in the grub shell. Use tab completion to find the partitions & files. Then enter "boot". Once you are running Ubuntu, it will be easy to reinstall grub. Copy the stanza for SliTaz from the other menu.lst file and paste in the one for Ubuntu.
 
Old 05-06-2009, 04:28 AM   #9
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,739

Original Poster
Blog Entries: 27

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
Thanks for the additional replies.
Quote:
SGBD boot your PC with it and use it to boot into Ubuntu. then do the grub-install once you are in Ubuntu
farslayer,
Would you mind giving me a little more fine detail please on your suggested method?
I am armed with my SGBD and a trifle apprehensive that I am going to mess up things irretrievably if I am not VERY careful!
I appreciate your patience in this matter.

linuxlover.chaitanya,

I also tried that method and I still end up with the SliTaz GRUB to MBR.

Last edited by beachboy2; 05-06-2009 at 04:33 AM.
 
Old 05-06-2009, 04:37 AM   #10
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally Posted by beachboy2 View Post

linuxlover.chaitanya,

I also tried that method and I still end up with the SliTaz GRUB to MBR.
Did you install the grub on the root partition of Ubuntu? If you install it on MBR then it should definitely erase the old grub and put new one.
 
Old 05-06-2009, 05:59 AM   #11
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,739

Original Poster
Blog Entries: 27

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
Success at last!!

Success at last! Apologies to linuxlover.chaitanya. In my earlier attempt using the Ubuntu Live CD I mistakenly used “setup (hd0,0)" instead of “setup (hd0)”.

For the benefit of others who may find themselves in such a situation in the future, please make a note of the following.
For other non-Ubuntu users e.g Mepis, at instruction #3 use:
type “su” and give root password (root) when requested.
1. Boot from Ubuntu Live CD.
2. Open a Terminal. (Applications > Accessories > Terminal)
Only type what is between the quote marks.
3. Type "sudo grub" which makes a GRUB prompt appear.
4. Type "find /boot/grub/stage1". You may get several responses if you have different OSs and you are multi-booting.
5. Type "root (hd0,0)". (OR, for example, “root (hd0,4)”. See 6. below)
6. Type "setup (hd0)". This will write GRUB to the MBR. If you wish to write GRUB to another OS's root partition such as sda5, then you type "(hd0,4)".
7. Type "quit".
8. Restart the system. Remove the bootable CD.

Many thanks to all who responded. I appreciate your assistance.

farslayer,
I would still like to have more details of your SGBD method please.

Last edited by beachboy2; 05-06-2009 at 06:02 AM.
 
Old 05-06-2009, 06:11 AM   #12
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,629

Rep: Reputation: Disabled
Good news.
 
Old 05-06-2009, 08:55 AM   #13
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Super grub disk

The following example sorta matches your situation.
Quote:

I installed GRUB, (or LiLo), to MBR but I can't find it. I have more than one hard disk in this computer. Maybe it went to the MBR of the wrong hard disk. I want to try booting from another hard disk to find out.

1. boot your SGD floppy disk, USB disk or CD-ROM
2. English Super Grub Disk
3. Boot and Tools
4. Boot Master Boot Record (MBR)
5. Boot Master Boot Record
6. Choose a hard disk from the list
So now that you are in your system you could use the grub-install command I mentioned earlier to re-install grub from the current OS to the MBR.


Look at some of the Quick Help options..

http://users.bigpond.net.au/hermanzo...isk_Quick_Help

the SGBD is just a way to get your system back up if you botch grub. it won't change anything unless you tell it to, so read the menu options carefully before selecting.

Really a useful tool
 
  


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
Where does grub looks for its grub.conf (menu.lst), where is encoded ? chipotphe Linux - Software 4 12-01-2008 12:22 AM
Grub Menu doesn't reflect menu.lst file fatsheep Linux - Software 4 06-11-2007 01:29 PM
GRUB menu.lst/grub.conf file with multiple partitions dasy2k1 Linux - General 1 04-19-2007 08:42 AM
/grub/menu.lst file disappeared but computer still boots (grub) rrrssssss Linux - General 5 04-08-2007 09:02 AM
Grub 0.97 issues on slackware - grub-install is very slow, & updating menu.lst fails dieyouspammer Linux - Software 1 02-27-2006 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:03 PM.

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
Open Source Consulting | Domain Registration