[SOLVED] tried to do dual-boot in Ubuntu, won't load WinXP. How to fix MBR?
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.
Unfortunately you have got some bad (unfortunate) advice in this thread. It's hard to know what you have where now. From Ubuntu (or the liveUSB if you have to), go to sf.net and get, and run, the bootinfoscript. That will create a RESULTS.txt - post that. It will tell us what boot loader code is where, what partitions, ...
We can't help without (correct) data.
Check the link for the Grub tutorial I posted earlier. For reinstalling Grub2, Section 4.G, for updating Grub2, Section 4.C;
To reinstall Grub2, boot into Ubuntu and run the command: sudo grub-install /dev/sda (assuming your hard drive is sda?)
to update Grub2 run the command: sudo update-grub. It is "update-grub" not "grub-update".
I don't use Grub2 so I haven't tried these myself. Might be good to review the tutorial.
@yancek,
I did try to read the very detailed grub tutorial at http://www.dedoimedo.com/computers/grub-2.html.
However Im afraid it's a bit too technical for a newbie like me.. :-).
I can only do a few Sudo commands from the Terminal, anything more and i might do more damage...
I did however from that link, saw another link http://www.dedoimedo.com/computers/d...-7-ubuntu.html on How to Install Windows 7 and Ubuntu side by side (Dual-boot). I find it to be very informative and I think Ill be using that guide sometime soon (even if Im using XP, now Win7)
Originally Posted by EDDY1;4178881
I think you should post output of fdisk -l /dev/sda
so someone can tell you what's there.
You'll find that xp is most likely still there.
The problem you're experiencing is that you can only have 4 main partitions. When you installed ubuntu it only recognized the first 3 + ubuntu.
@Eddy1,
Im sure XP is still there, i can see and access it from within Ubuntu. Its Booting it thats been giving me problems.
As for partitioning, I got lost there. I had 2 Windows Partition (1 XP, 1 Hidden for Recovery) and I CREATED 2 new partitions for Linux (1 EXT, 1 Swap). Didnt know I needed more. I do remember a couple of years ago I managed to dual boot (even triple boot) Ubuntu without all these issues and worrying about partitions etc. (unfortunately i forgot how I did that and it was a few iterations ago of Ubuntu)
Unfortunately you have got some bad (unfortunate) advice in this thread. It's hard to know what you have where now. From Ubuntu (or the liveUSB if you have to), go to sf.net and get, and run, the bootinfoscript. That will create a RESULTS.txt - post that. It will tell us what boot loader code is where, what partitions, ...
We can't help without (correct) data.
@syg00,
Thanks so much for the tip! I did what you said and here is the contents of Results.txt (it's a bit long) ..
Quote:
Boot Info Script 0.55 dated February 15th, 2010
============================= Boot Info Summary: ==============================
=> Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
partition #5 for (,msdos5)/boot/grub.
File system: ntfs
Boot sector type: Grub 2
Boot sector info: Grub 2 is installed in the boot sector of sda1 and
looks at sector 72659640 of the same hard drive for
core.img, but core.img can not be found at this
location. No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /BOOT.INI /ntldr /NTDETECT.COM
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by 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
set have_grubenv=true
load_env
fi
set default="6"
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
}
function load_video {
insmod vbe
insmod vga
}
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set a35ecd33-bd2d-4281-a0ee-337895fcc5a0
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set a35ecd33-bd2d-4281-a0ee-337895fcc5a0
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.35-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set a35ecd33-bd2d-4281-a0ee-337895fcc5a0
linux /boot/vmlinuz-2.6.35-23-generic root=UUID=a35ecd33-bd2d-4281-a0ee-337895fcc5a0 ro splash quiet splash
initrd /boot/initrd.img-2.6.35-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set a35ecd33-bd2d-4281-a0ee-337895fcc5a0
echo 'Loading Linux 2.6.35-23-generic ...'
linux /boot/vmlinuz-2.6.35-23-generic root=UUID=a35ecd33-bd2d-4281-a0ee-337895fcc5a0 ro single splash
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set a35ecd33-bd2d-4281-a0ee-337895fcc5a0
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=a35ecd33-bd2d-4281-a0ee-337895fcc5a0 ro splash quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set a35ecd33-bd2d-4281-a0ee-337895fcc5a0
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=a35ecd33-bd2d-4281-a0ee-337895fcc5a0 ro single splash
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set a35ecd33-bd2d-4281-a0ee-337895fcc5a0
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos5)'
search --no-floppy --fs-uuid --set a35ecd33-bd2d-4281-a0ee-337895fcc5a0
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 2e88fc8688fc4db9
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Windows NT/2000/XP (on /dev/sda2)" {
insmod part_msdos
insmod fat
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set 1b33-0a00
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 ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda5 during installation
UUID=a35ecd33-bd2d-4281-a0ee-337895fcc5a0 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=6c153206-3916-4349-b309-d5448e4d3073 none swap sw 0 0
=================== sda5: Location of files loaded by Grub: ===================
Device Boot Start End Blocks Id System
/dev/sda1 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 6375 51097600 7 HPFS/NTFS
/dev/sda3 6375 19458 105088001 5 Extended
/dev/sda5 * 6375 6417 340992 83 Linux
/dev/sda6 6417 7511 8787968 83 Linux
/dev/sda7 7512 7876 2928640 83 Linux
/dev/sda8 7876 8379 4034560 82 Linux swap / Solaris
/dev/sda9 8379 8427 389120 83 Linux
/dev/sda10 8427 19458 88601600 83 Linux
I basically have 3 primary partitions 2 of them were for windows if I add another wins it would have to be in my extended because it'll create 2 more primary partitions and you can only have 4
Looking at that, your XP system is gone. Somehow, you (or the installer) has installed grub2 to the XP partition. That ain't ever going to work - except wubi maybe, but I've never tried it.
Simple fixes (fixboot/fixmbr) aren't going to be sufficeient to fix this - you'll need to re-install XP. And then fix grub2 probably - it's a better boot-loader than M$oft.
From my very first post, I had an idea that the problem is the Ubuntu Install messed Window's MBR. Research showed the solution is to boot to Windows CD and use Recovery Console. Problem is I dont have a CD drive in the laptop. (at the same time, since Im not 100% sure that was the problem, I thought it could be a GRUB or Linux Partition issue)
I was looking for Linux-fixes that will fix Windows MBR without the need for Windows CD. There were some promising fixes I read (installing MS-SYS, SuperGrub2 etc) but it seemed what I read was outdated or Im back with the no-cd drive problem.
Along the way I tried everything that anyone can suggest to me.
Some of the tips here actually helped me arrive at the conclusion that my first thought was right: i just need to fix it if i can only access Windows Recovery.
(for example, the Grub Tutorial guide posted here showed me a guide on how to dual boot Windows and Ubuntu. The guide actually showed step by step what procedures to do.. and STILL THE GUIDE SHOWED WINDOWS WONT BOOT. "Dont Panic!!" , the guide says, simple solution pop in Windows Recovery CD and it will fix it! (Unfortunately the guide didnt show us how to do that if the laptop doesnt have a CD drive)
So I searched "How to boot Windows Recovery from USB" and similar searches.
The results were few, and have DIFFERENT approaches, some very complicated, some not so. Many need you to use the Windows Setup CDs (which I'll have to dig up), some need BARTPE, some requires you to boot to a CDDrive (in a PC), some just needs to access the i386 folder, and then finally I found this site:
It was easy to follow, required only a small download file, and I was done in a few minutes!
(it didnt need or ask for the Windows CD or i386 folders). Took up little space in the USB disk.) Booted my laptop successfully, it entered windows recovery console and ended in a Command Prompt (I was expecting a windows GUI, but I guess its more like a command line interface) I typed "FIXBOOT" and in 1 second it says its FIXED! Rebooted, I still have GRUB2 as the loader, chose Windows XP and it BOOTED!! Yaaaayyy!!
LOL! It was that EASY and FAST and it took me several days to figure it out!
I am just wondering why there is no LINUX script that can do the same thing, figure out where
Windows OS is, get the Boot info and rewrite the MBR.. from what i've seen, this problem pops up more often than you think...
Anyway, it seems the final solution seemed to be Windows-related and not really Linux issue. I just thought there was something that could be done from within Linux.
I'll be marking this thread as SOLVED and I typed up all of this in case some poor noob in the future does a search and maybe stumble here..
I'd like to thank EVERYONE though for their patience and effort in trying to help me here. For me its not about the results, its about the way people try to help you any way they can. For that Im really grateful. LQ is one of the friendliest and helpful forums Ive been in, now that I have both Windows and Ubuntu on my laptop, I think Ill be needing more help soon! :-P
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.