[SOLVED] [B]Can't Boot Windows Xp in a dual-boot e[/B]
UbuntuThis forum is for the discussion of Ubuntu Linux.
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.
The first byte being zero means this partition is not bootable (contains value 0x80 for bootable).
The type identifier is the 5th byte, this is 0x15 which my sources do not recognize. In other words, this is not a valid identifier. This is a problem.
Your other two physical partitions are properly identified as a hidden linux partition and as a FAT32 partition, btw.
Do you have another hard drive available? Alternatively, do you know how to use a hex editor?
That identifier needs to be changed from a 0x15 to something else, but exactly what else depends on whether this is actually a physical partition or an extended partition.
The reason I would like to know if you have another HD available is that you really should image this one for safety before messing with it.
Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 2 9791 78638175 15 Unknown
/dev/hda2 9792 19326 76589887+ 93 Amoeba
/dev/hda3 19327 19457 1052257+ b W95 FAT32
The "93" type identifier for hda2 is EITHER Amoeba OR Hidden Linux Partition.
I note that sfdisk identifies hda1 as type 15, as I extracted from the hex.
This can be fixed easily enough, but it would certainly help if I knew whether this was supposed to be an extended or a physical partition. You said it was a physical partition; if you are willing to go with that and you are not afraid of khexedit, we can put this thing back the way it should be.
If you mean another harddrive having two harddrives in this screwd up computer, no. I only use one harddrive in this computer. I never edited hexadecimal information before, but I don't mind trying it.
I would just like to be able to copy all my information from the 75GB NTFS partition to my external device and, afterwards, I would reinstall Windows XP and Ubuntu in that order, so as to get everything back to normal.
EDITED
oh! you meant backing up an image of this partition?
I think I can't do it because i'ts 75GB and my other computer uses Windows XP x64 with a 80GB disk with more than half used... And my external device hasn't got enough free space either...
EDITED
by the way, when did I say anything about something being a physical partition?
No, I just want to know if you have another hard drive big enough to hold the contents of this hard drive. If you do then imaging the system is at this point the safest thing to do. The image won't work either, but if something goes badly wrong recovering this system, then this way you won't lose any data.
In any case, assuming that the first partition is supposed to be a physical partition and not an extended one, I'll talk you through the changes which should make it bootable (there is a windows boot manager in the MBR at the present time). Follow these instructions EXACTLY, and if you get confused, DO NOT PROCEED: ASK!
First, you need to make a copy of the MBR to work on. Working as root from the live CD, do it this way:
dd if=/dev/hda of=mbrimage.bin bs=512 count=1
This will create a file called mbrimage.bin in the directory /root.
Now, start khexedit. If you do not have khexedit, figure out what hex editor you have and start it.
khexedit mbrimage.bin
When khexedit starts, you will see a display window that looks a lot like the hex output I had you create earlier.
Look for this data, which starts at location 0x01b0 (should be an entire line in the editor)
Code:
00 00 00 00 00 2c 44 63 f8 17 f8 17 00 00 00 00
change it exactly as I show it (change is in bold)
Code:
00 00 00 00 00 2c 44 63 f8 17 f8 17 00 00 80 00
Now move down to the next line which is this:
Code:
01 01 15 fe ff ff c1 3e 00 00 be d8 5f 09 00 fe
Change it exactly as I show it (change is in bold)
Code:
01 01 07 fe ff ff c1 3e 00 00 be d8 5f 09 00 fe
Now save the changes.
Now write the modified MBR back to the hard drive:
dd if=mbrimage.bin of=/dev/hda bs=512 count=1
When you have done this, if your WinXP was indeed a primary partition, it should boot. Once you have WinXP booting, we'll get Linux sorted out.
when I try opening the hex editor, it opens, but there are some things in the terminal similar to errors:
---
ubuntu@ubuntu:~$ sudo khexedit mbrimage.bin
X Error: BadDevice, invalid or uninitialized input device 167
Major opcode: 144
Minor opcode: 3
Resource id: 0x0
Failed to open device
X Error: BadDevice, invalid or uninitialized input device 167
Major opcode: 144
Minor opcode: 3
Resource id: 0x0
Failed to open device
/usr/bin/iceauth: creating new authority file /root/.ICEauthority
X Error: BadDevice, invalid or uninitialized input device 167
Major opcode: 144
Minor opcode: 3
Resource id: 0x0
Failed to open device
X Error: BadDevice, invalid or uninitialized input device 167
Major opcode: 144
Minor opcode: 3
Resource id: 0x0
Failed to open device
Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
kbuildsycoca running...
kio (KService*): WARNING: The desktop entry file /usr/share/applications/DefaultPlugins.desktop has Type=Link instead of "Application" or "Service"
kio (KService*): WARNING: Invalid Service : /usr/share/applications/DefaultPlugins.desktop
kio (KSycoca): ERROR: No database available!
QLayout "unnamed" added to CHexToolWidget "unnamed", which already has a layout
QLayout "unnamed" added to CHexToolWidget "unnamed", which already has a layout
---
Is this a problem?
Should I proceed with what you told me to do?
Just ignore all that stuff as long as the editor opened and loaded the boot image.
I did what you told me to, but I did not reboot yet.
GParted still shows the first partition as with unknown file system. Isn't there a way I can just have access to this partition as a NTFS partition so I could copy all the files from it and reinstall both Windows XP and Ubuntu from scratch?
I might be a bit off here, but might this be a short cut to recover the XP data (I understand the Ubuntu data has already been recovered)? Sounds like Jim18 could answer this better than I.
I am proposing:
Remove the hard drive(s) from the machine.
Beg, borrow or buy a cheap hard drive, install it as master (the only installed hard drive) and then install fresh copy of XP onto it.
Next reinstall the problem filled drive into the computer as slave.
Would it then be possible to copy any desired XP files off the problem drive into the new master drive by mounting the problem drive? A variation of this method was how I recovered my Feisty files when I completely messed up my system. If its possible to transfer the Feisty files to the new, master drive by making it dual boot, then possibly all files can be recovered and the old drive could then be reformatted, partitioned, etc to make it the eventual master drive again (or use one drive for each system). Does this sound reasonable?
I might be a bit off here, but might this be a short cut to recover the XP data (I understand the Ubuntu data has already been recovered)? Sounds like Jim18 could answer this better than I.
I am proposing:
Remove the hard drive(s) from the machine.
Beg, borrow or buy a cheap hard drive, install it as master (the only installed hard drive) and then install fresh copy of XP onto it.
Next reinstall the problem filled drive into the computer as slave.
Would it then be possible to copy any desired XP files off the problem drive into the new master drive by mounting the problem drive? A variation of this method was how I recovered my Feisty files when I completely messed up my system. If its possible to transfer the Feisty files to the new, master drive by making it dual boot, then possibly all files can be recovered and the old drive could then be reformatted, partitioned, etc to make it the eventual master drive again (or use one drive for each system). Does this sound reasonable?
As I said, I have an external device ready to take the windows XP data. Isn't there just a way to mount this partition as NTFS (now the file system is shown as unknown in GParted) while using the live cd like I'm doing now so I could copy the Windows XP files?
I'm serious. I'm not sure wether I will be able not to panic...
I'm afraid a lot of the help you've been getting to just try to recover the data is beyond my knowledge base. I just thought the method suggested in my last post might be the shortest, easiest route in the long run. But again I think someone like Jim18 could answer this better. Sounds like he or one of the others has a better idea just how recoverable your data might be. Good luck.
Stay away from graphical tools right now; they won't help. You need to be down and dirty with the command line because that is where the real power is.
Stay away from graphical tools right now; they won't help. You need to be down and dirty with the command line because that is where the real power is.
Disk /dev/hda: 19457 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/hda1 * 1 9790 9790 78638175 7 HPFS/NTFS
/dev/hda2 9791 19325 9535 76589887+ 93 Amoeba
/dev/hda3 19326 19456 131 1052257+ b W95 FAT32
/dev/hda4 0 - 0 0 0 Empty
Also if gparted continues to identify the partition as unknown either (a) gparted is hosed or (b) you did not save the changes to the mbrimage.bin file or (c) you did not write the mbrimage.bin file back to hda.
Changing the 00 to an 80 makes the partition bootable; changing the 15 to 07 identifies it as ntfs.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.