Linux - NewbieThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 .
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
-- 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"
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.
-- 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.
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 !
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.