LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-13-2009, 11:54 PM   #1
wlaw
Member
 
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 245

Rep: Reputation: 30
how to add an bootloader ?


I got two HDs.

One is Primary master running WinXP(Drive A, and the other one is primary

slave running Ubuntu.(Drive B)

I installed Ubuntu in Drive B after I unplug the Drive A.

After installation, I connected Drive A back to primary master and Drive

B to primary slave.

Now, I want to have a bootloader installed to choose the two OS.

What can I do ?

Thank you !
 
Old 05-14-2009, 12:02 AM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
http://ubuntuforums.org/showthread.php?t=224351
This might be of some help
 
Old 05-14-2009, 12:28 AM   #3
wlaw
Member
 
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 245

Original Poster
Rep: Reputation: 30
Thank you !
 
Old 05-14-2009, 12:36 AM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
seeing as you disconnected the windows drive ubuntu was unable to AUTO add windows to the grub bootloarer

if you want to continue using the MS Windows bootloader ( on the MBR) then you will need to fallow the "how to" for using the "dd" command .Or uninstall the ubuntu bootloader ( /dev/sdb1) and reinstall it to the MBR /sda1 ) and have the ubuntu install dvd auto set up a duel boot .
 
Old 05-15-2009, 10:22 PM   #5
wlaw
Member
 
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 245

Original Poster
Rep: Reputation: 30
Can you tell me in more detail ????

Thank you !
 
Old 05-16-2009, 12:22 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
more detail on what?
the " How to install Grub from a live Ubuntu cd." help page
to have grub boot windows and ubuntu
or
using the ' dd' command to be able to use the " MS bootloader " to boot both windows and ubutnu
 
Old 05-16-2009, 12:23 AM   #7
wlaw
Member
 
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 245

Original Poster
Rep: Reputation: 30
using the ' dd' command to be able to use the " MS bootloader " to boot both windows and ubutnu


Thank you !
 
Old 05-16-2009, 01:01 AM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
-- below assumes that when you boot the computer MS windows is what starts and only xp --

first you will need to run the command ( and write the output down )
as root run
Code:
fdisk -l
in the output you will have TWO drives listed
sda? -- as windows
sdb? -- as ubuntu

in the sda1 line there SHOULD be a " * " that is *
in the description .
the same might ?? be true for the second drive"sdb1 " there should be a * next to it
the * means that partition IS WHERE the bootloader is
example for my output( part of it)
Code:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          1        9731    78164226    7  HPFS/NTFS

Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00bce113

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   83  Linux
/dev/sdb2              14        1971    15727635   83  Linux
---------------- to ----------------------------
/dev/sdb9            5510       24792   154890666   83  Linux
you will need to know WHERE THE UBUNTU grub is located on the drive
next - be very careful with this command a typo can KILL ubuntu and will NOT give you a warning --
in this i am assuming grub is in sdb1
AND you can write to the windows ntfs ( using ntfs-3g) drive from ubuntu
and it is mounted as /mnt/windows ( change as needed )
as root run
Code:
dd if=/dev/sdb1 of=/mnt/windows/ubuntu.bin bs=512 count=1
vi /mnt/windows/boot.ini
or your favorite text editor and edit the xp boot.ini as such ( the stuff in red )
Code:
[boot loader]

timeout=30

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect

C:\ubuntu.bin= " Ubuntu"
reboot
the windows bootloader on the MBR will give you 30 sec to hit the down arrow to select ubuntu and hit "enter"
 
Old 05-16-2009, 01:15 AM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
There isn't a need to unplug one of the drives. It can cause problems as well, because the old (HD0) is now (HD1).

Be sure to check the /boot/grub/menu.lst file. Lately, device UUID references are used, to prevent the need for editing all of your drive references. Make sure that the root disk definition in the menu.lst preamble is correct. Double check /etc/fstab. A reference to /dev/sda# may be wrong. Here, the UUID numbers are used, so if your lucky, you may not need to fix /etc/fstab.
 
Old 05-19-2009, 08:22 AM   #10
wlaw
Member
 
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 245

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by John VV View Post
-- below assumes that when you boot the computer MS windows is what starts and only xp --

first you will need to run the command ( and write the output down )
as root run
Code:
fdisk -l
in the output you will have TWO drives listed
sda? -- as windows
sdb? -- as ubuntu

in the sda1 line there SHOULD be a " * " that is *
in the description .
the same might ?? be true for the second drive"sdb1 " there should be a * next to it
the * means that partition IS WHERE the bootloader is
example for my output( part of it)
Code:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          1        9731    78164226    7  HPFS/NTFS

Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00bce113

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   83  Linux
/dev/sdb2              14        1971    15727635   83  Linux
---------------- to ----------------------------
/dev/sdb9            5510       24792   154890666   83  Linux
you will need to know WHERE THE UBUNTU grub is located on the drive
next - be very careful with this command a typo can KILL ubuntu and will NOT give you a warning --
in this i am assuming grub is in sdb1
AND you can write to the windows ntfs ( using ntfs-3g) drive from ubuntu
and it is mounted as /mnt/windows ( change as needed )
as root run
Code:
dd if=/dev/sdb1 of=/mnt/windows/ubuntu.bin bs=512 count=1
vi /mnt/windows/boot.ini
or your favorite text editor and edit the xp boot.ini as such ( the stuff in red )
Code:
[boot loader]

timeout=30

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect

C:\ubuntu.bin= " Ubuntu"
reboot
the windows bootloader on the MBR will give you 30 sec to hit the down arrow to select ubuntu and hit "enter"
I tried to edit the boot.ini file in XP but it doen't boot the drive D which is ubuntu installed.

I want to clarify that both Primary Master (C)=WinXP and Primary Slave (D) =Ubuntu can be booted NOW by changing the boot sequence in the BIOS.

Now, I want to install or edit the bootloader in C or D to choose which OS to boot.

What can I do ?
 
Old 05-19-2009, 09:08 AM   #11
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,502

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
If you want to boot windows and Linux from the windows bootloader, follow this tutorial:

http://www.linux.com/archive/articles/113945

If you want to boot both from Grub, run the command: sudo fdisk -l and post the output here. You should be able to get specific instructions.
 
Old 05-19-2009, 11:25 AM   #12
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
wlaw
can you post the output of the command
Code:
fdisk -l
and how is windows mounted in ubuntu ? or is it NOT mounted
where did you save the ubuntu.bin file ? Is it on your windows C drive ?
 
Old 05-19-2009, 05:06 PM   #13
wlaw
Member
 
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 245

Original Poster
Rep: Reputation: 30
Usage: fdisk [-b SSZ] [-u] DISK Change partition table
fdisk -l [-b SSZ] [-u] DISK List partition table(s)
fdisk -s PARTITION Give partition size(s) in blocks
fdisk -v Give fdisk version
Here DISK is something like /dev/hdb or /dev/sda
and PARTITION is something like /dev/hda7
-u: give Start and End in sector (instead of cylinder) units
-b 2048: (for certain MO disks) use 2048-byte sectors


It is Mounted but I don't know how it is mounted . I am not sure where the file ubuntu.bin is saved, but most likely, it is not the windows C drive as I disconnect the windows drive C physically before ubuntu installation.
Many thanks !

Last edited by wlaw; 05-19-2009 at 05:12 PM.
 
Old 05-19-2009, 06:40 PM   #14
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,502

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
You need to run the command as root: sudo fdisk -l, post output here.
 
Old 05-19-2009, 06:49 PM   #15
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
the ubuntu.bin file that was made with the dd commane ( if sdb1 is where grub is installed ) but if the win drive is not connected then grub is in sda1
the ubuntu.bin file MUST be on your windows drive in C:\\ubuntu.bin

leaving the windows drive INSTALLED would have made things a lot easer .

once it is installed( the windows drive) the boot order in grub.conf will need to be edited

Code:
sudo
fdisk -l
we need to see that output
for example part of mine
Quote:
sda1 is windows
Disk /dev/sda: 80.0 GB, 80054059008 bytes
255 heads, 63 sectors/track, 9732 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdcfbdcfb

Device Boot Start End Blocks Id System
/dev/sda1 * 1 9731 78164226 7 HPFS/NTFS
sdb is fedora 9 and CentOS 5.3
Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00bce113

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 1971 15727635 83 Linux
----------- to -------------------------
/dev/sdb9 5510 24792 154890666 83 Linux
and to see your /boot/menu.lis or /boot/grub/grub.conf

reinstalling with the windows drive installed will be easer.

Last edited by John VV; 05-19-2009 at 09:05 PM.
 
  


Reply

Tags
boot loader



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
Command help to mount INITRD.img and add files to it to create bootloader newtovanilla Linux - Newbie 5 07-01-2013 04:23 PM
Windows 2000 Bootloader vs. Mandriva LILO Bootloader Dregnan Mandriva 7 12-03-2007 09:55 PM
Add Mandriva to Suse 9.3 bootloader raysr SUSE / openSUSE 6 05-15-2006 01:15 AM
How can I disable the grub bootloader and enable the lilo bootloader? abefroman Linux - General 1 08-06-2005 08:53 AM
syntax for grub.conf to add win98 to bootloader menu 7689mich Linux - Newbie 3 08-26-2004 12:13 AM

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

All times are GMT -5. The time now is 10:37 PM.

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