Install GRUB from Mint Live CD

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
piratesmack

Install GRUB from Mint Live CD

Post by piratesmack »

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.
Husse

Re: Install GRUB from Mint Live CD

Post by Husse »

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
piratesmack

Re: Install GRUB from Mint Live CD

Post by piratesmack »

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

Re: Install GRUB from Mint Live CD

Post by piratesmack »

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
Husse

Re: Install GRUB from Mint Live CD

Post by Husse »

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
kvaju

Re: Install GRUB from Mint Live CD

Post by kvaju »

both link are dead
User avatar
merlwiz79
Level 8
Level 8
Posts: 2418
Joined: Wed Apr 04, 2007 1:50 pm
Location: Here again :)

Re: Install GRUB from Mint Live CD

Post by merlwiz79 »

Image
mokoia

Re: Install GRUB from Mint Live CD

Post by mokoia »

I just wanted to say thanks. I was having trouble getting Grub to work after installing XP and this post solved my issues
lorenberg

Re: Install GRUB from Mint Live CD

Post by lorenberg »

Thanks!!! I will give that a try.

Loren Berg
BananasInPajamas

Re: Install GRUB from Mint Live CD

Post by BananasInPajamas »

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

Re: Install GRUB from Mint Live CD

Post by piratesmack »

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
BananasInPajamas

Re: Install GRUB from Mint Live CD

Post by BananasInPajamas »

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
piratesmack

Re: Install GRUB from Mint Live CD

Post by piratesmack »

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"
User avatar
Pierre
Level 21
Level 21
Posts: 13215
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Install GRUB from Mint Live CD

Post by Pierre »

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
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
COKEDUDE

Re: Install GRUB from Mint Live CD

Post by COKEDUDE »

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?
Fred

Re: Install GRUB from Mint Live CD

Post by Fred »

COKEDUDE,

yes

Fred
COKEDUDE

Re: Install GRUB from Mint Live CD

Post by COKEDUDE »

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
Fred

Re: Install GRUB from Mint Live CD

Post by Fred »

COKEDUDE,

yes

Fred
COKEDUDE

Re: Install GRUB from Mint Live CD

Post by COKEDUDE »

Which file controls the GRUB boot menu now? My boot menu is not showing up for some reason.
piratesmack

Re: Install GRUB from Mint Live CD

Post by piratesmack »

@COKEDUDE
/boot/grub/grub.cfg

Use grub2config
http://www.tux.org/pub/people/kent-robo ... 1.5.tar.gz
Post Reply

Return to “Tutorials”