LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problems with setiing up dual boot between UBUNTU AND WINDOWS (https://www.linuxquestions.org/questions/linux-newbie-8/problems-with-setiing-up-dual-boot-between-ubuntu-and-windows-921211/)

Aagam 12-30-2011 06:08 AM

Problems with setiing up dual boot between UBUNTU AND WINDOWS
 
since a few days i ve trying to setup dual boot between UBUNTU 11.10 and WINDOWS 7. i ve tried many things one of which is as following from a live cd
Code:

root (hd0,0)
setup (hd0)
exit

in this when i execute second line in grub prompt i get
Code:

cannot setup mentioned partition
in another one i.e.
Code:

sudo mount /dev/sda1 /boot
sudo apt-get update && sudo apt-get install grub-pc
sudo grub-setup /dev/sda
sudo umount /boot

here in second line i get
Code:

grub-setup: error: cannot stat /boot/grub/
my windows partion is /dev/sda1 and ubuntu partion is /dev/sda8
i first installed ubuntu and then windows....
i ve not used dual boot before so i am new to it and so expect an answer in detail....
THNX...:)

spiky0011 12-30-2011 06:17 AM

Hi

As you have just installed the OS,s it might make it easier to reinstall loading windows 1st then Ubuntu. That way grub sorts out the problem of loading both systems.

Roken 12-30-2011 06:48 AM

Quote:

Originally Posted by Aagam (Post 4561654)
in another one i.e.
Code:

sudo mount /dev/sda1 /boot
sudo apt-get update && sudo apt-get install grub-pc
sudo grub-setup /dev/sda
sudo umount /boot

here in second line i get
Code:

grub-setup: error: cannot stat /boot/grub/

Your mount is making everything wrong. You are mounting /dev/sda1 in boot, which places the full sda1 filesystem in /boot, and so grub can't find it. (you effectively have /boot/boot/grub when grub expects to find /boot/grub).

I assume that you are doing this all from a live CD and that Ubuntu is on /dev/sda1, so try:

Code:

sudo mount /dev/sda1 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda



andrewthomas 12-30-2011 07:02 AM

Quote:

Originally Posted by Roken (Post 4561666)
I assume that you are doing this all from a live CD and that Ubuntu is on /dev/sda1, so try:

Code:

sudo mount /dev/sda1 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda



Yet, the OP states in the first post that windows is on sda1 and ubuntu is on sda8
Quote:

Originally Posted by Aagam (Post 4561654)
my windows partion is /dev/sda1 and ubuntu partion is /dev/sda8

EDIT: just follow the ubuntu docs and you should bo OK.

https://help.ubuntu.com/community/Re...tallingWindows

Roken 12-30-2011 07:07 AM

Ahh, I missed that. OK, small revision:
Code:

sudo mount /dev/sda8 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda


Aagam 12-30-2011 12:52 PM

Quote:

As you have just installed the OS,s it might make it easier to reinstall loading windows 1st then Ubuntu. That way grub sorts out the problem of loading both systems.
i agree...but its not that. I have used ubuntu for much of the time earlier and have some imoportant things on it...however thnx


Quote:

sudo mount /dev/sda8 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda
i did that.....but now only ubuntu boots....i want both...plz tell me how to get that.

Roken 12-30-2011 01:37 PM

Boot Ubuntu as normal then run
Code:

sudo update-grub
It should find Windows and add it to the boot menu.

spiky0011 12-30-2011 03:45 PM

try
Code:

sudo update-grub

Aagam 12-31-2011 03:54 AM

i used this
Code:

sudo update-grub
and i get the following
Code:

Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-3.0.0-13-generic
Found kernel: /boot/vmlinuz-3.0.0-12-generic
Found GRUB 2: /boot/grub/core.img
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

windows is not being listed here...

blue_print 12-31-2011 04:11 AM

OK.. Can you try adding the entries manually in GRUB Configuration file and see if you can booth the Windows?

Quote:

title Windows
rootnoverify (hd0,0)
chainloader +1

Aagam 12-31-2011 09:16 AM

Code:

title Windows
rootnoverify (hd0,0)
chainloader +1

i tried that but then too ubuntu boots directly....BTW this is my menu.lst file...maybe, i can help..
Code:

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=9ed5964e-61ff-4785-a755-bd2d60483b87 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=9ed5964e-61ff-4785-a755-bd2d60483b87

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
##      indomU=true
##      indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

title Windows
rootnoverify (hd0,0)
chainloader +1


Roken 12-31-2011 09:25 AM

Are you using grub legacy or grub 2? (grub 2 version is 1.99)

Aagam 12-31-2011 10:25 AM

i think i was using grub
which uses "menu.lst"
but now i upgraded to grub2 and using grub.cfg i got dual boot
i did
Code:

sudo apt-get install grub2
sudo update-grub

and then it showed win7 in the menu
THNX EVERYBODY THERE....:):):)


All times are GMT -5. The time now is 03:47 PM.