Install GRUB from Mint Live CD

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

Install GRUB from Mint Live CD

Postby piratesmack on Thu Nov 27, 2008 5:50 pm

OUTDATED!

This is for Grub legacy (0.9x) ONLY
Linux Mint now uses Grub2


Step 1: Boot from a Linux Mint Live CD
-Most of you probably know how to do this. In most cases, you just reboot your computer with the CD in the drive. Sometimes, you will need to change the BIOS settings so it tries to boot from the CD drive before the hard drive.

Step 2: Mount your Linux root partition:
-Open a terminal, and type:
Code: Select all
sudo fdisk -l

-The command above will print out a list of partitions, find the device node for your Linux partition (/dev/hda1, /dev/hda2, /dev/sda1, /dev/sda2, etc)
-Now mount it with:
Code: Select all
sudo mount /dev/xxxx /mnt
# replace the x's with the device node you just took note of
# feel free to change /mnt if you want to mount it somewhere else


Step 3: Install GRUB to the MBR:
Code: Select all
sudo grub-install --root-directory=/mnt hd0

-After installation, it will print the contents of /boot/grub/device.map. If something is wrong, edit device.map and rerun the command above.

Last step: Write a menu.lst
-Run the command:
Code: Select all
sudo nano /boot/grub/menu.lst

-That will open the nano text editor and tell it to save as /boot/grub/menu.lst, everyone's menu.lst will look a little different.
Here is a basic menu.lst example for a Linux/Windows dual-boot:
Code: Select all
# Linux boot entry
title Linux
root (hdx,x)
kernel /boot/vmlinuz root=/dev/xxx ro
initrd /boot/initrd.gz
# End of Linux boot entry

# Windows boot entry
title Windows
root (hdx,x)
makeactive
chainloader +1
# End of Windows boot entry

-For the (hdx,x) part, the first x represents the hard drive number. 0 is the first hard drive, 1 is the second, 2 is the third, and so on. The second x represents the partition number. /dev/hda1 is 1, /dev/hda2 is 2, and so on. Note: Grub doesnt seem to count your swap partition, so ignore it when determining the partition order.
-You can check your Linux Mint /boot/grub/menu.lst for a better example
-Press Ctrl+o in nano to save your menu.lst



Easier way, using the "Grubconfig" script
-From the Mint live cd, download the script:
http://www.tux.org/pub/people/kent-robotti/looplinux/
-Extract it:
Code: Select all
tar -xvzf grubconfig-*.tar.gz

-Navigate to the grub config directory:
Code: Select all
cd grubconfig-x.xx #Replace x's with version number

-Make the grubconfig script executable:
Code: Select all
chmod +x grubconfig

-Run the script:
Code: Select all
sudo ./grubconfig

-Then just follow the simple instructions to install grub
Last edited by piratesmack on Sat Dec 18, 2010 11:22 pm, edited 9 times in total.
piratesmack
Level 5
Level 5
 
Posts: 710
Joined: Mon May 26, 2008 3:08 pm

Linux Mint is funded by ads and donations.
 

Re: Install GRUB from Mint Live CD

Postby Husse on Fri Nov 28, 2008 8:45 am

I have linked to this topic from the "repair grub" article in the wiki
As long as the grub prompt does not cooperate this is useful solution
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Install GRUB from Mint Live CD

Postby piratesmack on Fri Nov 28, 2008 5:32 pm

Husse wrote:I have linked to this topic from the "repair grub" article in the wiki
As long as the grub prompt does not cooperate this is useful solution


Thanks.

Did you get the workaround I sent you?

If you mount your Linux root partition, proc, and /dev under /mnt/root, you should be able to repair from the Grub shell no problem (At least it worked for me).

So the process should be something like:
Code: Select all
sudo mkdir /mnt/root

sudo mount -t ext3 /dev/xxxx /mnt/root # replace the x's with your linux root partition

sudo mount -t proc none /mnt/root/proc

sudo mount -o bind /dev /mnt/root/dev

sudo grub

find /boot/grub/stage1

root (hdx,x)

setup (hd0)


Perhaps that should be added to the wiki?
Last edited by piratesmack on Sun Feb 22, 2009 4:45 am, edited 1 time in total.
piratesmack
Level 5
Level 5
 
Posts: 710
Joined: Mon May 26, 2008 3:08 pm

Re: Install GRUB from Mint Live CD

Postby piratesmack on Fri Nov 28, 2008 6:21 pm

I just found a really nice script that helps you install grub, it's called "grubconfig"
http://www.tux.org/pub/people/kent-robo ... .29.tar.gz
It's pretty easy to use, it's very similar to Slackware's liloconfig script

It even backs up your mbr in /boot/grub before it installs

Here's a screenshot:
http://www.vulomedia.com/images/11837screenshot.png
piratesmack
Level 5
Level 5
 
Posts: 710
Joined: Mon May 26, 2008 3:08 pm

Re: Install GRUB from Mint Live CD

Postby Husse on Sat Nov 29, 2008 1:07 pm

Thanks - the problem is that I can't even repair grub from my installed systems and I have done that many times on my two desktops and I think from my laptop as well....
Something is broken and not only in my system, but my time is too limited to chase down the cause now
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Install GRUB from Mint Live CD

Postby kvaju on Sat Feb 21, 2009 4:24 pm

both link are dead
kvaju
Level 1
Level 1
 
Posts: 30
Joined: Tue Dec 02, 2008 6:32 pm
Location: Mostar


Re: Install GRUB from Mint Live CD

Postby mokoia on Sun Oct 18, 2009 8:35 am

I just wanted to say thanks. I was having trouble getting Grub to work after installing XP and this post solved my issues
mokoia
Level 1
Level 1
 
Posts: 8
Joined: Fri Jul 03, 2009 4:41 pm

Re: Install GRUB from Mint Live CD

Postby lorenberg on Sun Oct 25, 2009 11:52 pm

Thanks!!! I will give that a try.

Loren Berg
Loren Berg
(612) 384-3997
lorenberg@earthlink.net
lorenberg
Level 1
Level 1
 
Posts: 8
Joined: Sat Oct 17, 2009 5:25 pm

Re: Install GRUB from Mint Live CD

Postby BananasInPajamas on Sun Nov 08, 2009 1:59 am

When I try running the script, it says I need the "Dialogue" program to run.
BananasInPajamas
Level 1
Level 1
 
Posts: 21
Joined: Fri Aug 14, 2009 9:43 am

Re: Install GRUB from Mint Live CD

Postby piratesmack on Sun Nov 08, 2009 1:37 pm

BananasInPajamas wrote:When I try running the script, it says I need the "Dialogue" program to run.


Dialog is the program that creates those curses-based menus.

Code: Select all
sudo apt-get install dialog
piratesmack
Level 5
Level 5
 
Posts: 710
Joined: Mon May 26, 2008 3:08 pm

Re: Install GRUB from Mint Live CD

Postby BananasInPajamas on Mon Nov 09, 2009 4:15 am

Bummer, there was an error returned when trying to install grub. Is there a way to figure this out, or what do I do to reinstall the Windows boot loader? Either one will work
BananasInPajamas
Level 1
Level 1
 
Posts: 21
Joined: Fri Aug 14, 2009 9:43 am

Re: Install GRUB from Mint Live CD

Postby piratesmack on Tue Nov 10, 2009 11:08 pm

BananasInPajamas wrote:Bummer, there was an error returned when trying to install grub. Is there a way to figure this out, or what do I do to reinstall the Windows boot loader? Either one will work



What was the error?

And you can use a program called ms-sys to install a windows-compatible boot record. Not sure if there's a package for mint, but I know it's included on the partedmagic and puppy linux live cds.

I think the command you want is "ms-sys -w /dev/sdx"
piratesmack
Level 5
Level 5
 
Posts: 710
Joined: Mon May 26, 2008 3:08 pm

Re: Install GRUB from Mint Live CD

Postby Pierre on Wed Nov 11, 2009 9:00 am

I actually just used this TUT to re-install my Minty boot, after the re-install of another O/S.
worked just peachy. .. didn't follow the Last Step, as I wanted to keep the original menu.lst already in the Mint partition.
:D
Image
User avatar
Pierre
Level 7
Level 7
 
Posts: 1813
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Install GRUB from Mint Live CD

Postby COKEDUDE on Tue May 25, 2010 12:03 am

piratesmack wrote:
BananasInPajamas wrote:When I try running the script, it says I need the "Dialogue" program to run.


Dialog is the program that creates those curses-based menus.

Code: Select all
sudo apt-get install dialog


I assume you need a internet connection for that to work. Is that correct?
Image
Image
User avatar
COKEDUDE
Level 4
Level 4
 
Posts: 319
Joined: Sun May 23, 2010 9:06 pm

Re: Install GRUB from Mint Live CD

Postby Fred on Tue May 25, 2010 12:06 am

COKEDUDE,

yes

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Install GRUB from Mint Live CD

Postby COKEDUDE on Tue May 25, 2010 1:21 am

After reading this I assume Mint 9 doesn't use the menu.lst file anymore. Is that correct?

Grub Legacy uses boot/grub/menu.lst.

Grub 2 uses uses boot/grub/grub.cfg.

https://help.ubuntu.com/community/Recov ... ingWindows
Image
Image
User avatar
COKEDUDE
Level 4
Level 4
 
Posts: 319
Joined: Sun May 23, 2010 9:06 pm

Re: Install GRUB from Mint Live CD

Postby Fred on Tue May 25, 2010 1:29 am

COKEDUDE,

yes

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Install GRUB from Mint Live CD

Postby COKEDUDE on Tue May 25, 2010 2:50 am

Which file controls the GRUB boot menu now? My boot menu is not showing up for some reason.
Image
Image
User avatar
COKEDUDE
Level 4
Level 4
 
Posts: 319
Joined: Sun May 23, 2010 9:06 pm

Re: Install GRUB from Mint Live CD

Postby piratesmack on Tue May 25, 2010 2:16 pm

@COKEDUDE
/boot/grub/grub.cfg

Use grub2config
http://www.tux.org/pub/people/kent-robo ... 1.5.tar.gz
piratesmack
Level 5
Level 5
 
Posts: 710
Joined: Mon May 26, 2008 3:08 pm

Linux Mint is funded by ads and donations.
 

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 13 guests