LinuxQuestions.org
Visit Jeremy's Blog.
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-30-2007, 07:39 PM   #31
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15

I checked out that post. It seems straight forward enough. Since I recovered all that I could I am not to worried if it fails, though I would love it if this works. I am cutting and pasting part of post #50 here and changing the hda to sda.

First two questions.

1- Can I do this from my installed Ubuntu or should I use my SystemRescueCD 0.3.5?
2 - sda is not bootable but this should work?

Quote:
"""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/sda 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/sda bs=512 count=1""
 
Old 07-30-2007, 07:56 PM   #32
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
You can do it from ubuntu, and the fact that sda doesn't have a bootable partition on it doesn't matter.
 
Old 07-30-2007, 08:06 PM   #33
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8
You can do it from ubuntu, and the fact that sda doesn't have a bootable partition on it doesn't matter.

OK. I am going to give this a try. I am vaguely familiar with hex editors (editing cheat codes for games, etc,) So lets see if I can do this right. Thanks.
 
Old 07-30-2007, 08:29 PM   #34
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
LMAO.... Well,

I am not sure what I screwed up but I have decided to do something. I am setting up my older computer and teaching myself some new things. For ex. I am going to install Linux and probably Win98 and create problems and then see if I can fix them correctly (starting first with recreating this problem,) and doing that as many times as I need to until I get it right.

I somehow got the first partition to fill the whole drive (getting rid of the second partition.) No big deal, so I used the backup mbrimage.bin I created and put that back. I got all the correct sizes back but partition 2 is unallocated (I think I now what to do to fix that.) I just knew I was going to do something like that but it is helping me understand a few more things about this, which is why I want to set up my older computer and learn more.

Either way thank you.
 
Old 07-30-2007, 09:54 PM   #35
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Uhhh...

I guess I steered you a bit wrong. Post 50 told the person on that other thread how to fix her partition. Yours is different.

You would have wanted to change a type 82 to a type 83 partition.

What I really wanted you to do was post the contents of the MBR here on this board, as I had her do it on that other thread.
 
Old 07-30-2007, 10:11 PM   #36
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jiml8
Uhhh...

I guess I steered you a bit wrong. Post 50 told the person on that other thread how to fix her partition. Yours is different.

You would have wanted to change a type 82 to a type 83 partition.

What I really wanted you to do was post the contents of the MBR here on this board, as I had her do it on that other thread.

Ok. I misunderstood. I can still do that if it will still work?
 
Old 07-30-2007, 10:12 PM   #37
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
It certainly should still work
 
Old 07-30-2007, 10:15 PM   #38
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Ok Give me a minute and I will post it. Now to make sure I understand this you want the contents of the file that I get using khexedit?
 
Old 07-30-2007, 10:27 PM   #39
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Ok. I wanted to give you the exact file I saved originally before I started messing with it, unless you want the one that is there now, (both?). So I uploaded it in pdf format here http://free-voices.net/print.pdf
 
Old 07-30-2007, 10:29 PM   #40
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
I also added this, the actual file gz http://free-voices.net/mbrimage.bin.gz
 
Old 07-30-2007, 10:40 PM   #41
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Follow the instructions in post 42 of that other thread. This will give a hex listing of the MBR, and it will report what sfdisk -l has to say about the drive. The combination will give all the info needed to fix the partition table
 
Old 07-30-2007, 10:40 PM   #42
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
actually that pdf works as well...wait a minute...
 
Old 07-30-2007, 10:42 PM   #43
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
ok, I will leave that on and the gz file.
 
Old 07-30-2007, 10:44 PM   #44
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
OK, from that pdf, you presently have only one partition defined on that hd. That partition is defined as a linux ext2/3 partition. Have you tried to mount it?

Even if the partition boundaries are messed up (and they might be; the second partition entry is completely zeroed out), we can still probably recover the partition table correctly so long as the first partition is correctly identified.

The file system is not the same as the partition; even if the partition has been redefined to cover the whole HD, the file system is the size of the old partition. So, try running fsck on /dev/sda1 and see if the file system can be recovered. If it can, then we'll work on getting the second partition back.

What does fdisk -l or sfdisk -l have to say?
 
Old 07-30-2007, 10:47 PM   #45
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
$ sudo sfdisk -l /dev/sda1

Warning: start=63 - this looks like a partition rather than
the entire disk. Using fdisk on it is probably meaningless.
[Use the --force option if you really want this]


Also I can mount it but there is nothing there. I ran testdisk before and I could see all the files there, and folders.

Last edited by Neo-Leper; 07-30-2007 at 10:49 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Recover lost data under Solaris10 intel (Urgent) dsids Solaris / OpenSolaris 4 07-06-2007 07:08 AM
urgent! how to recover files from os x? stairwayoflight Other *NIX 12 06-10-2007 06:55 PM
recover a missing partition pankaj99 Linux - General 5 06-03-2006 07:09 PM
Recover Partition??? HELP!!!! villusion Linux - Hardware 7 10-11-2005 04:34 PM
Recover a lost partition!!!!! Caveman Linux - Newbie 4 09-26-2003 01:10 PM

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

All times are GMT -5. The time now is 12:24 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