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 - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-17-2007, 11:17 AM   #46
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16

What can I do now? Am I screwed?
 
Old 07-17-2007, 11:32 AM   #47
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
OK. This is the definition of hda1:
Code:
00 00 01 01 15 fe ff ff c1 3e 00 00 be d8 5f 09
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.
 
Old 07-17-2007, 11:34 AM   #48
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by 512upload
ubuntu@ubuntu:~$ sudo sfdisk -l

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 15 Unknown
/dev/hda2 9791 19325 9535 76589887+ 93 Amoeba
/dev/hda3 19326 19456 131 1052257+ b W95 FAT32
/dev/hda4 0 - 0 0 0 Empty
ubuntu@ubuntu:~$ sudo fdisk -l

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.
 
Old 07-17-2007, 11:39 AM   #49
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
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?

Last edited by 512upload; 07-17-2007 at 11:46 AM.
 
Old 07-17-2007, 11:55 AM   #50
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
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.
 
Old 07-17-2007, 12:02 PM   #51
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
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?
 
Old 07-17-2007, 12:09 PM   #52
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Just ignore all that stuff as long as the editor opened and loaded the boot image.
 
Old 07-17-2007, 12:14 PM   #53
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jiml8
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?

Should I try and reboot my computer now?

Last edited by 512upload; 07-17-2007 at 12:33 PM.
 
Old 07-17-2007, 12:16 PM   #54
Thane
Member
 
Registered: Aug 2006
Location: Ontario,Canada
Distribution: Linux Mint19.3 Cinnamon 64bit
Posts: 223

Rep: Reputation: Disabled
a proposed method - feasible?

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?
 
Old 07-17-2007, 12:21 PM   #55
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Thane
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...


Last edited by 512upload; 07-17-2007 at 12:26 PM.
 
Old 07-17-2007, 12:26 PM   #56
Thane
Member
 
Registered: Aug 2006
Location: Ontario,Canada
Distribution: Linux Mint19.3 Cinnamon 64bit
Posts: 223

Rep: Reputation: Disabled
dunno

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.
 
Old 07-17-2007, 12:31 PM   #57
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
jim18 and jthuber, please help me

should I try to reboot the computer now?

EDITED

I tried rebooting and I still get the same error message:

"Reboot and Select proper Boot device
or Insert Boot Media in selected Boot device and press a key"


Last edited by 512upload; 07-17-2007 at 12:52 PM.
 
Old 07-17-2007, 12:52 PM   #58
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
what does sfdisk -l say?

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.
 
Old 07-17-2007, 12:53 PM   #59
512upload
Member
 
Registered: Jul 2007
Distribution: Ubuntu
Posts: 137

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jiml8
what does sfdisk -l say?

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
 
Old 07-17-2007, 12:55 PM   #60
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
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.
 
  


Reply



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
Dual Boot w/ WinXP Pro, Windows wont boot. bobbyj99 Linux - General 2 04-20-2006 01:27 PM
Grub/Dual boot - Windows partition restored via dd won't boot pazzport Ubuntu 1 01-06-2006 01:29 PM
trying to dual boot windowsxp/fc2 using windows boot loader. dr_zayus69 Linux - Software 7 02-08-2005 11:59 PM
Dual Boot : Making Windows First Option in boot menu Maxwell Rain Linux - Software 3 11-27-2004 03:00 PM
Win98/Linux - dual boot : windows boot says logical drives exist past z ashpai Linux - Software 3 03-22-2001 09:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 02:47 AM.

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