LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-19-2008, 02:33 AM   #1
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908
Blog Entries: 26

Rep: Reputation: 49
deleted option to boot windows from bootloader


i am using open suse 10.3.I have deleted 'booting windows option' from bootloader.Can you tell me how to add bootsector of windows partition.In windows 'bootpart program' allows you to add bootsector of another partition for booting is there a similiar tool in linux.
 
Old 12-19-2008, 02:47 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
You dont need any third party tool to add windows to grub. Reinstalling grub will add it automatically.
from the terminal just give the command:
sudo grub-install /dev/sda/

Assuming grub is to be installed on sda. Check out the name for your drive.

Last edited by linuxlover.chaitanya; 12-19-2008 at 02:48 AM.
 
Old 12-22-2008, 02:29 AM   #3
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
FOR ALL READERS
If you want to boot into windows.
I read this from magazine 'linux for you' simply do the following as root
#gedit /boot/grub/menu.lst
then add following to end of file

title windows xp
rootnoverify (hd0,0)
chainloader +1

NOTE
(hd0,0) represents /dev/sda1
(hd0,4) represents /dev/sda5
(hd1,0) represents /dev/sdb1
hd0=primary master hard disk
hd1=primary slave hard disk
hd=secondary master hard disk

If you find my post useful than thank me by pressing thumbs up button.Happy hacking.

Last edited by sumeet inani; 12-11-2009 at 06:26 AM.
 
Old 06-21-2010, 06:58 AM   #4
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
Tip for all

Actually I deleted my ext3 partition which contained bootloader.It seemed now I won't be able to boot windows till I reinstall my ubuntu.
Then
I booted from live cd
Mounted ext3 partition as /ubuntu (let us say)
Then I ran command as root
Code:
grub-install --root-directory=/ubuntu --no-floppy <File system>
Now I created file /ubuntu/boot/grub/menu.lst containing (my windows is on /dev/sda1)
Code:
title xp
root  (hd0,0) 
makeactive
chainloader +1
Now i can boot windows till I don't install a linux OS whih will add its entry to bootloader.
Hope , it helps

Last edited by sumeet inani; 08-02-2010 at 05:31 AM. Reason: you have to write device at end of command
 
Old 06-22-2010, 02:33 AM   #5
tommyttt
Member
 
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Rep: Reputation: 34
Quote:
Originally Posted by sumeet inani View Post
Actually I deleted my ext3 partition which contained bootloader.It seemed now I won't be able to boot windows till I reinstall my ubuntu.
Then
I booted from live cd
Mounted ext3 partition as /ubuntu (let us say)
Then I ran command as root
Code:
grub-install --root-directory=/ubuntu --no-floppy
Now I created file /ubuntu/boot/grub/menu.lst containing (my windows is on /dev/sda1)
Code:
title xp
root  (hd0,0) 
makeactive
chainloader +1
Now i can boot windows till I don't install a linux OS whih will add its entry to bootloader.
Hope , it helps
One option any dual-boot user has to boot into windows if grub/lilo isn't functioning is Hiren's Boot CD, available as free download from: http://www.hirensbootcd.net/

Download and burn to CD. It will boot into moat versions of windows (including 7 & vista) as well as rescue boot into linux.

Tom
 
Old 08-04-2010, 10:44 PM   #6
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
QUESTIONS at end

Last edited by sumeet inani; 08-05-2010 at 12:26 AM.
 
Old 08-05-2010, 12:15 AM   #7
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
I love Super Grub!

http://www.supergrubdisk.org/

Great tool for issues such as this.
 
Old 08-05-2010, 12:26 AM   #8
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
tommyttt , In my case grub was gone . How can hiren fix MBR to boot from the windows xp partition ? Can you explain ?

To leopard ,
i had deleted ext3 partition containing ubuntu & my grub bootloader. How can supergrub help in this case ? i saw http://rescatux.berlios.de/wiki/Main_Page . Rescatux wants the linux partition but i have deleted it so its unallocated space.

Last edited by sumeet inani; 08-05-2010 at 12:28 AM.
 
Old 08-05-2010, 12:46 AM   #9
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
http://www.supergrubdisk.org/wiki/Ho...thout_problems ?
 
Old 08-05-2010, 09:06 AM   #10
sumeet inani
Member
 
Registered: Oct 2008
Posts: 908

Original Poster
Blog Entries: 26

Rep: Reputation: 49
Thanks leopard.
I read the wiki & my windows is on /dev/sda1 so 'WIN' option will make windows as default boot option , appropriate for me.

Code:
I  downloaded  super_grub_disk_english_usb_0.9799.tar.gz .
Then extracted boot folder to pendrive.
Unmounted pendrive.
Now run
#sync;grub
grub>root (Press tab because we want to find out our pendrive
 Possible disks are:  hd0 hd1
grub>geometry (hd0)
drive 0x80: C/H/S = 38913/255/63, The number of sectors = 625142448, /dev/sda
   Partition num: 0,  Filesystem type unknown, partition type 0x27
   Partition num: 1,  Filesystem type unknown, partition type 0x7
   Partition num: 2,  Filesystem type unknown, partition type 0x7
   Partition num: 4,  Filesystem type unknown, partition type 0x82
   Partition num: 5,  Filesystem type is ext2fs, partition type 0x8
That was my hard disk because i have ubuntu on my 6th partition (part of extended 4th) while others are ntfs.
grub>geometry (hd1)
drive 0x81: C/H/S = 1187/120/55, The number of sectors = 7837696, /dev/sdb
   Partition num: 0,  Filesystem type is fat, partition type 0xb
This was my pendrive with single partition of fat32 
grub>root (hd1,0)Set the current "root device" to pendrive
grub>makeactive setting boot flag of USB partition
grub>setup (hd1,0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/fat_stage1_5" exists... yes
 Running "embed /boot/grub/fat_stage1_5 (hd1,0)"... failed (this is not fatal)
 Running "embed /boot/grub/fat_stage1_5 (hd1,0)"... failed (this is not fatal)
 Running "install /boot/grub/stage1 (hd1,0) /boot/grub/stage2 p /boot/grub/menu
.lst "... succeeded
Done.
grub>setup (hd1)
Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/fat_stage1_5" exists... yes
 Running "embed /boot/grub/fat_stage1_5 (hd1)"...  22 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd1) (hd1)1+22 p (hd1,0)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.
Now boot
Quick way for those with internet
Select 'super grub disk' in distribution of unetbootin then it downloads a .img file & creates a working USB .

The other question that remains is
tommyttt , In my case grub was gone . How can hiren fix MBR to boot from the windows xp partition ? Can you explain ?

Last edited by sumeet inani; 08-06-2010 at 05:58 AM.
 
  


Reply



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
Windows Won't Boot From Bootloader prasanna7287 Linux - General 3 01-14-2006 11:33 AM
Dual Boot : Making Windows First Option in boot menu Maxwell Rain Linux - Software 3 11-27-2004 03:00 PM
Deleted all my bootloader stuff from windows/linux system jimdaworm Red Hat 2 09-04-2003 05:54 PM
Deleted boot option for LILO in Mandrake... how do i get it back?! CrossfireCurt Linux - Newbie 9 06-17-2002 03:50 PM
Help! - Deleted boot option for Windows from LILO! - HOW DO I GET IT BACK?! CrossfireCurt Linux - General 2 06-16-2002 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:29 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
Open Source Consulting | Domain Registration