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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
05-13-2009, 11:54 PM
|
#1
|
|
Member
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 219
Rep:
|
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 !
|
|
|
|
05-14-2009, 12:02 AM
|
#2
|
|
Senior Member
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079
Rep:
|
|
|
|
|
05-14-2009, 12:28 AM
|
#3
|
|
Member
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 219
Original Poster
Rep:
|
Thank you !
|
|
|
|
05-14-2009, 12:36 AM
|
#4
|
|
Guru
Registered: Aug 2005
Posts: 9,521
|
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 .
|
|
|
|
05-15-2009, 10:22 PM
|
#5
|
|
Member
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 219
Original Poster
Rep:
|
Can you tell me in more detail ????
Thank you !
|
|
|
|
05-16-2009, 12:22 AM
|
#6
|
|
Guru
Registered: Aug 2005
Posts: 9,521
|
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
|
|
|
|
05-16-2009, 12:23 AM
|
#7
|
|
Member
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 219
Original Poster
Rep:
|
using the ' dd' command to be able to use the " MS bootloader " to boot both windows and ubutnu
Thank you !
|
|
|
|
05-16-2009, 01:01 AM
|
#8
|
|
Guru
Registered: Aug 2005
Posts: 9,521
|
-- 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
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"
|
|
|
|
05-16-2009, 01:15 AM
|
#9
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
|
05-19-2009, 08:22 AM
|
#10
|
|
Member
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 219
Original Poster
Rep:
|
Quote:
Originally Posted by John VV
-- 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
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 ?
|
|
|
|
05-19-2009, 09:08 AM
|
#11
|
|
Senior Member
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Peppermint
Posts: 3,388
|
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.
|
|
|
|
05-19-2009, 11:25 AM
|
#12
|
|
Guru
Registered: Aug 2005
Posts: 9,521
|
wlaw
can you post the output of the command
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 ?
|
|
|
|
05-19-2009, 05:06 PM
|
#13
|
|
Member
Registered: Jun 2004
Location: HK
Distribution: Ubuntu
Posts: 219
Original Poster
Rep:
|
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.
|
|
|
|
05-19-2009, 06:40 PM
|
#14
|
|
Senior Member
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Peppermint
Posts: 3,388
|
You need to run the command as root: sudo fdisk -l, post output here.
|
|
|
|
05-19-2009, 06:49 PM
|
#15
|
|
Guru
Registered: Aug 2005
Posts: 9,521
|
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
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:07 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|