Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 24-05-2010, 09:00 PM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Oct 2006
Posts: 10
Exclamation A Question on Dual Boot Problem(Ubuntu/Windows7)


I have Windows XP & Ubuntu 10.04 in my machine.

I have installed XP on C: drive(sda1),& ubuntu( root partition)on D: drive(sda5).I didnt create a separate /boot partition during ubuntu installation & the drive letter for swap partition is N: as seen from XP Disk Manager).

When i run "sudo fdisk -l" in ubuntu it gives following output-
-----------------------------------------------------------------------------------
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7a3cfdca

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 7 HPFS/NTFS
/dev/sda2 1276 30401 233954564+ f W95 Ext'd (LBA)
/dev/sda5 1276 3302 16281846 83 Linux
/dev/sda6 3303 3570 2152678+ 82 Linux swap / Solaris
/dev/sda7 3571 4207 5116671 7 HPFS/NTFS
/dev/sda8 4208 6756 20474811 7 HPFS/NTFS
/dev/sda9 6757 7648 7164958+ 7 HPFS/NTFS
/dev/sda10 7649 8922 10233373+ 7 HPFS/NTFS
/dev/sda11 8923 11471 20474811 7 HPFS/NTFS
/dev/sda12 11472 17845 51199123+ 7 HPFS/NTFS
/dev/sda13 17846 23581 46074388+ 7 HPFS/NTFS
/dev/sda14 23582 29062 44026101 7 HPFS/NTFS
/dev/sda15 29063 30401 10755486 7 HPFS/NTFS
----------------------------------------------------------------------------------

when i run " sudo blkid" it gives me following output:
--------------------------------------------------------------------------------
/dev/sda1: LABEL="WIN XP" UUID="40EA5D8CEA5D7EDA" TYPE="ntfs"
/dev/sda5: UUID="66617334-1c9d-48d9-a2be-141a30d978c7" TYPE="ext3"
/dev/sda6: UUID="69b6b265-3958-4a75-9cf0-0749f1464ff8" TYPE="swap"
/dev/sda7: LABEL="TEMP" UUID="01CA22AC9F071040" TYPE="ntfs"
/dev/sda8: LABEL="TOOLS" UUID="01CA22ACA12F4770" TYPE="ntfs"
/dev/sda9: LABEL="DOCUMENTS" UUID="01CA22ACA3E40730" TYPE="ntfs"
/dev/sda10: LABEL="Downloads" UUID="01CA22ACA5E618C0" TYPE="ntfs"
/dev/sda11: LABEL="MUSIC & MOVIES" UUID="01CA22ACA86B3D00" TYPE="ntfs"
/dev/sda12: LABEL="GAMES (Action)" UUID="01CA22ACAB355980" TYPE="ntfs"
/dev/sda13: LABEL="GAMES (Racing)" UUID="01CA22AD2F34DA80" TYPE="ntfs"
/dev/sda14: LABEL="GAMES (Strategy)" UUID="01CA22AD321DC9A0" TYPE="ntfs"
/dev/sda15: LABEL="LINUX" UUID="01CA22AD353B3640" TYPE="ntfs"
-------------------------------------------------------------------------------------


I want to install Windows 7 on my C: partition. For that reason, to increase the space on my primary partition, i am going to merge C: drive(sda1) & L: Drive( the entire L drive as a folder of c ). My L: drive(sda14) is completely empty.

Now as we know installing windows 7 will rewrite the boot loader, my question is-

How to restore default grub boot loader so that I can select the desired OS from the boot menu without re-installing Ubuntu?


plz help.

My current grub.cfg:
---------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 66617334-1c9d-48d9-a2be-141a30d978c7
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 66617334-1c9d-48d9-a2be-141a30d978c7
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 66617334-1c9d-48d9-a2be-141a30d978c7
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=66617334-1c9d-48d9-a2be-141a30d978c7 ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 66617334-1c9d-48d9-a2be-141a30d978c7
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=66617334-1c9d-48d9-a2be-141a30d978c7 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 66617334-1c9d-48d9-a2be-141a30d978c7
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 66617334-1c9d-48d9-a2be-141a30d978c7
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows NT/2000/XP (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 40ea5d8cea5d7eda
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

------------------------------------------------------------------------------------
sunny_sigara is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 24-05-2010, 09:20 PM   #2 (permalink)
Linoob
 
celldweller1591's Avatar
 
Join Date: Mar 2010
Location: ambala, haryana
Posts: 705
Default Re: A Question on Dual Boot Problem(Ubuntu/Windows7)

win7 will probably wipe out grub. So boot from livecd.In the desktop, open terminal and type
sudo grub
This will set it to grub mode
find /boot/grub/stage1
This will locate your boot partition. Since we know that your root is hd(0,5),we can ignore it.
After that type in :
root (hd0,5)
setup (hd0)
quit
Reboot your system. for details see here
then run
sudo apt-get update grub
and your win7 bootloader will be detected by grub and you will get an option to select b/w ubuntu and win7 at grub menu. Try it
__________________
root@Celldweller#ping www.linoob.com

Ubuntu User # 31222
Linux User # 516252

Last edited by celldweller1591; 24-05-2010 at 09:30 PM.
celldweller1591 is offline  
Old 24-05-2010, 10:51 PM   #3 (permalink)
Right Off the Assembly Line
 
Join Date: Oct 2006
Posts: 10
Default Re: A Question on Dual Boot Problem(Ubuntu/Windows7)

Thanks for the info...i will definitely try it.
sunny_sigara is offline  
Old 28-05-2010, 06:08 AM   #4 (permalink)
ico
.
 
ico's Avatar
 
Join Date: Jun 2007
Location: New Delhi
Posts: 8,944
Default Re: A Question on Dual Boot Problem(Ubuntu/Windows7)

https://help.ubuntu.com/community/Gr...ing%20GRUB%202
__________________
.
ico is offline  
Old 28-05-2010, 07:26 AM   #5 (permalink)
Linux User
 
ghost at rest's Avatar
 
Join Date: Jan 2008
Location: Chandigarh, India
Posts: 145
Default Re: A Question on Dual Boot Problem(Ubuntu/Windows7)

You are using Ubuntu 10.4 and it has GRUB2 by default.
After installing Windows OS, boot up from Ubuntu 10.04 LiveCD, open Terminal and execute this
Code:
sudo mount /dev/sda5 /mnt
sudo grub-install --root-directory=/mnt /dev/sda  
sudo umount /mnt
That's it ! It will re-install GRUB.
ghost at rest is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dual boot laptop Vostro 1200 choklate_007 Open Source 0 08-02-2010 05:31 PM
How to boot in xp in safe mode (Vista + XP Dual Boot) CadCrazy Software Q&A 6 14-08-2007 11:43 AM
Removing Vista from Xp-Vista Dual boot *GandaBerunda* Tutorials 2 01-07-2007 10:20 PM
win98se & xp dual boot help... sr123 Software Q&A 10 03-02-2007 12:56 AM

 
Latest Threads
- by Charan
- by Charan

Advertisement




All times are GMT +5.5. The time now is 04:49 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2