LinuxQuestions.org
Review your favorite Linux distribution.
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 09-22-2009, 01:48 AM   #1
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Rep: Reputation: 48
installing grub in windows


Hi I am using windows XP.I wish to install GRUB bootloader so that I can modify menu.lst & add lines to boot from an ext2 partition having iso of linux distro.One way is to use live cd & try 'sudo grub-install <device>' but I don't have live cd.I came to know about open source software 'wingrub' but I am not able to understand how to use it even after reading http://grub4dos.sourceforge.net/wiki...s_tutorial.Can anybody tell me what should I do to install GRUB in mbr & have option to boot to c drive which has windows & another partition (/dev/sda2) which has linux.

Last edited by sumeet inani; 09-22-2009 at 01:50 AM.
 
Old 09-22-2009, 04:06 AM   #2
TaylanUB
LQ Newbie
 
Registered: Sep 2009
Posts: 8

Rep: Reputation: 0
I don't know much on this stuff yet myself, but after having played around a bit with GRUB while trying to get an Arch installation to work, my `senses' are telling me that GRUB should be installable on any partition of your HDD, as long as it is formatted at all.
Although on a second thought, i actually have no real idea where it would keep all of its files, which are normally kept in /boot/grub in the Unix directory hierarchy. So my senses might be lying. =P

Anyway, i'll just re-direct you to GNU's official GRUB manual: gnu.org/software/grub/manual/grub.html
It includes a section on creating a GRUB boot floppy. And after that it should be easy.


Oh and, actually you don't really need a LIVE CD i think. Your distro installation CD should work just as well.
But i don't exactly know how.

This is how i once had to do it in my very first Linux days (less than a year ago):
1) Insert the CD and boot from it.
2) When you come to some kind of greeting screen or whatever (after booting is done) you should be able to access a command-line-interface (aka CLI) by pressing Ctrl+Alt+F1.
3) In the CLI, you have to enter the command `grub', and it will take you to the GRUB CLI.
4) There you have to `change' your `root' to where-ever your Linux is installed.
4.1) If you don't know already how GRUB sees your HDDs and their partitions, just type root ( and press TAB. You'll see the available HDDs. Let's say you chose root (hd0,. Press TAB again to see the partitions of that HDD. Then choose the correct one of those as well. For example you might now have root (hd0,0) which is the first partition of the first HDD. Or if you have two HDDs in your PC and the Linux is on a second partition of a USB stick, it might be root (hd2,1). (Remember they start with 0. So the 2 means the 3rd drive (the first two being the HDDs) and the 1 means second partition.)
5) Now after having entered the correct root, you have to enter setup (hd0). I think that hd0 there always has to be hd0, as it is now relative to the root you entered or something.


I hope that any of what i wrote will help.
And let me warn you: I take no responsibilities if you screw up anything, even if it's my fault! =P

Last edited by TaylanUB; 09-22-2009 at 04:10 AM.
 
Old 09-22-2009, 04:35 AM   #3
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,852

Rep: Reputation: 260Reputation: 260Reputation: 260
If Windows is installed, and you want to install linux, you boot from the linux CD, and it will install along side Windows, on a separate partition, using grub as the bootloader. You will end up with boot menu options for both Windows and linux.

If you installed linux, and then Windows, boot the linux CD, and choose 'rescue'. Different distros work differently in rescue mode, but you want to chroot to the linux installation and run grub-install or update-grub. Then you will have two boot menu options for Windows and linux.
 
Old 09-22-2009, 05:12 AM   #4
TaylanUB
LQ Newbie
 
Registered: Sep 2009
Posts: 8

Rep: Reputation: 0
Quote:
Originally Posted by AwesomeMachine View Post
If you installed linux, and then Windows, boot the linux CD, and choose 'rescue'. Different distros work differently in rescue mode, but you want to chroot to the linux installation and run grub-install or update-grub. Then you will have two boot menu options for Windows and linux.
From all i know, not all distros feature a rescue mode in their installation CDs.


By the way, i never thought of it really but how much is it possible to boot from an ISO in your HDD via GRUB anyway?
 
Old 09-30-2009, 08:39 AM   #5
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Original Poster
Rep: Reputation: 48
If you want to try a distro(like livecd version or portable lightweight) without installing them then you can extract content of iso to a primary partition(ext2 or fat32 work fine) & add lines in grub about title,root,kernel & initrd.Details are on this link:http://www.linuxforu.com/teach-me/ti...t-from-an-iso/.Also I found out that you have to install win4grub(available from www.sourceforge.net) which creates menu.lst in c:\grub which you can edit through notepad.I like to distribute whatever little I know.
REMEMBERuring the above process no cd was needed at any instant.

Last edited by sumeet inani; 09-30-2009 at 08:42 AM.
 
Old 09-30-2009, 09:47 AM   #6
TaylanUB
LQ Newbie
 
Registered: Sep 2009
Posts: 8

Rep: Reputation: 0
Thanks!
I didn't know you can use GRUB to boot an ISO on your HDD.
Saved me some potentially to-be-wasted CDs.
 
  


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
Installing Windows XP using Linux GRUB _ Linux - General 2 09-01-2009 02:56 AM
Installing windows without losing grub setlec_seta Linux - Newbie 1 04-27-2008 07:02 PM
Installing GRUB from Windows XP trotsky Linux - Software 1 03-05-2005 05:32 AM
installing GRUB from windows XP ELconkestador Linux - Software 6 02-12-2005 01:35 AM
installing Windows XP + Linux + Grub GoldenWing Linux - Software 1 02-24-2002 11:39 AM


All times are GMT -5. The time now is 02:25 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