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.
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:
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.
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.
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
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.