Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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 will not agree to this point that " if you corrupt your MBR then you cannot mount other partitions " I always reinstall Linux and Windows in my dual OS system. I always used to mount windows partitions from Linux, even though I modify the MBR. But I use two different hard drives for Linux and Windows.
If you corrupt only the bootloader, then you can mount the partitions anyway, but it seems centguy destroyed the partition table also (and hopefully nothing more).
Now you must restore the lost partition table using some utility from a live CD, and then repair the bootloader.
If you just reinstall Windows (or anything), it will probably create new partition table, and recovering any data from you disk will be almost impossible.
I know nothing about openSusie rescue, but there is a nice liveCD I use: SystemRescueCD and it has testdisk utility, which helped me a lot when I lost a partition
I am unsure but sda refers to the entire drive, and I am afraid you may have corrupted more than just the partition table and the MBR, hopefully you did not destroy all your data.
didn't have a size limit on it, so it is kind of hard to know exactly what you have done, but it could be very bad. Unlikely to have destroyed sda3, but might have damaged sda1.
You obviously have destroyed your partition table, and the data you need to recover it neatly is on one of the partitions that you cannot access. Interesting conundrum.
Get yourself a copy of testdisk and run it. It will probably find and rebuild your partition table.
Yes, Virginia, the partition table IS in the MBR!!
Anyway, I was extra careful before I committed to such dd operation.
Before I messed up everything, I login as root in opensuse and I overwrote MBR using this command with the correct mbr.image ONCE and
I am able to boot. As the for the size of random.image,
I have used dd if=/mnt/grub/save-mbr-image/a-random-text-file of=/mnt/grub/save-mbr-image/mbr.image count=1 bs=512
so there should be no issue with the size. I used ls -l to check the size of random.image, which is 512.
I tend to believe dr_agon that if I reinstall Windows or linux, the other partition
will be gone according to new partition table. So that's tough luck.
The dd method of overwriting MBR demands that I should not disturb
the existing partition table setting when I reinstall Windows(i.e., let the Windows installer create EXACTLY the same partition as before and overwrite the MBR --- I cannot create D: out of the original entire space for C. If not, the good old mbr.image will be in conflict with the new partition table, and that will be hell again. I hope I am right in this deduction. Well, so much so for the dumb dd method...
As jiml8 has already pointed out your have destroyed the partition table so no operating system can read your hard disk.
The information inside your hard disk may be in perfect order but the mean to read it has been destroyed.
I agree running the "testdisk" program, to let it rebuild your partition table, is the best advice.
If you start to re-partition, format the hard disk and write information on it you can kiss your existing data goodbye.
Actually if you have a copy of the original partition table or know the sizes, types and order of the partitions you can recreate the partition table with any Linux Live CD and not a single byte will be lost. I have done this loads of time. The partition table is positioned between 447th to 510th bytes and is only 64 bytes long. A total destruction of the partition does not affect the internal data of the partitions but without the partition table no operating system knows where to begin or stop when reading a partition.
People should never use dd to mess around the MBR which can always be regenerated by a system command in every operating system, regardless it is a Windows or a Linux.
I tend to believe dr_agon that if I reinstall Windows or linux, the other partition
will be gone according to new partition table. So that's tough luck.
With a destroyed partition table, you may rest assured that a reinstall of anything will wipe out your partitions. I promise you that will happen.
And with respect to recovering partitions and disk structure and so forth, Saikee and I are the ones you want to listen to.
People should never use dd to mess around the MBR which can always be regenerated by a system command in every operating system, regardless it is a Windows or a Linux.
If you were skilled at these things and if the contents of this hard drive were valuable enough to justify serious effort, it could be fixed. (If it happened to me, I would fix it. But I'm barely expert enough to do that for myself, not expert enough to talk you through every detail).
The saved mbr and partition table are somewhere on the disk. The disk can still be read (as raw data in /dev/sda). Once you deduce some distinctive content in the original MBR you can use some search utility to find the copy of it somewhere on /dev/sda and then copy it back where it belongs.
I've never tried that testdisk utility. It sounds like it might solve the problem with less effort and much less expertise required (by the user).
Don't panic as yet. I too came across a similar scenario.
Do you remember the aproximate sizes of your partitions?
Boot with a Live CD(Knoppix is my choice). run parted and try rescue option.
When i came across this i didnt have any experience in rescuing a hd. so try. don't giveup.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.