help: best fix for faulty boot sector or ubuntu bootup file(s)
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.
help: best fix for faulty boot sector or ubuntu bootup file(s)
My ubuntu linux computer stopped booting up last night. After futzing around trying to find a hardware problem, I decided to boot into ubunbu from the installation DVD.
That worked, meaning the motherboard, CPU and most everything is working okay. Once ubuntu was running from the DVD, I ran the file browser program (from Places -> Computer as I recall), and was able to see the directories on the 1TB seagate boot drive (and my attached 2TB USB drive), and I accessed a few text files just to make sure that worked.
This makes me guess that either the HDD boot sector or the linux OS somehow got trashed. The boot drive has only one huge partition with ubuntu linux --- so no dual boot issues.
I guess my question is... what are my options to try to get this drive working again?
I cannot say for sure, but it might be that the MBR needs to be reformatted; that was the case when I had computer that refused to boot.
You can do that with dd; there are instructions here; it must be done carefully. If there's a mistake, an dd takes no prisoners. If you have an old DOS boot disk, you can do it from there with the fdisk /MBR command.
Is that really Jaunty (9.04 ?).
From the boot DVD do you get an option to boot into disk system ?. If so try that. What does
Quote:
My ubuntu linux computer stopped booting up last night.
mean exactly. Do you see a boot menu, can you make a selection, ...
All black and nothing at all ?.
Should be reasonably easy to fix if it's just a grub error - unfortunately the Ubuntu page I was going to refer to has been taken down. Will update later - see above for similar.
Last edited by syg00; 01-06-2012 at 08:14 PM.
Reason: typo and strikeout
Is that really Jaunty (9.04 ?).
From the boot DVD do you get an option to boot into disk system ?. If so try that. What does mean exactly. Do you see a boot menu, can you make a selection, ...
All black and nothing at all ?.
Should be reasonably easy to fix if it's just a grub error - unfortunately the Ubuntu page I was going to refer to has been taken down. Will update later - see above for similar.
The system displays the usual boot screen, then gets to the point where it beeps. Usually a moment after the beep an ubuntu startup screen appears, but now it just prints a single newline and a J character, then nothing further happens. This is version 10.4 of ubuntu.
Is there a way to fix just the master boot record?
Did you read my post above about how to format the MBR?
I did. But when I read the webpage you referenced, I still didn't understand how to replace a busted MBR with a working one. Maybe I just don't understand what he's saying in some way, but I don't see it. He's mostly talking about trying to move from a dual boot system to a single boot system... at least I think so.
strange thing two threads with almost the same issue. if its really a corrupted mbr then your only option is to mount the partition using the live dvd, chroot and reinstall grub.
strange thing two threads with almost the same issue. if its really a corrupted mbr then your only option is to mount the partition using the live dvd, chroot and reinstall grub.
Yes, two slightly different questions about different aspects of the same problem. Sorry if that is confusing.
Here is my question about your suggestion. It appears that the "grub-install" command replaces the MBR. However, it is NOT clear to me whether "grub-install" only repaces the first 446 bytes. Immediately after the first 446 bytes is partition information, so if any more than 446 bytes are written or changed in the "grub-install" process, then my entire filesystem will be destroyed and I'll lose everything.
I have tried to find out whether "grub-install" does this correctly, but so far I haven't been able to find out. I guess I could try it on my new hard drive where I just installed a fresh new ubuntu, but I'm not sure I'd entirely trust that test unless I know for sure what "grub-install" does.
The various boot-loaders (fortunately) are much smarter than the people that write about them on the net. A few exceptions, but (again unfortunately) too few.
(re-)Installation updates the boot code. Only. This is contained in the first 446 bytes, but is not the only occupant. Care is take during the install to maintain flags and disk geometry information that also resides there.
Reinstall of boot-loader code is amongst the safest thing you can do to your system. Can be messed up by the user, but (extremely) rarely by the install itself.
I am yet to be fully convinced this is strictly a stage0 code issue - it may be, and the grub-install will do no damage if done correctly. May fix the issue, may not. Let us know how it goes.
BTW, don't even think of doing the dd command referenced in the link above.
The various boot-loaders (fortunately) are much smarter than the people that write about them on the net. A few exceptions, but (again unfortunately) too few.
(re-)Installation updates the boot code. Only. This is contained in the first 446 bytes, but is not the only occupant. Care is take during the install to maintain flags and disk geometry information that also resides there.
Reinstall of boot-loader code is amongst the safest thing you can do to your system. Can be messed up by the user, but (extremely) rarely by the install itself.
I am yet to be fully convinced this is strictly a stage0 code issue - it may be, and the grub-install will do no damage if done correctly. May fix the issue, may not. Let us know how it goes.
BTW, don't even think of doing the dd command referenced in the link above.
Hmmm. And I was just about to try the "dd" command. Okay, I won't.
So I guess you're saying I can safely run "grub-install" to fix the first 446 bytes in the MBR, correct?
As an aside, let me ask something about your "appendix" that says "don't do anything until you make a complete backup". Okay, how do I do that? I have this 1TB drive that won't boot but has everything working just the way I want. Now I have a new 3TB drive that has a fresh new ubuntu on it (both drives are ubuntu 10.4 LTS), but can be completely erased or overwritten because I have put nothing on it yet. Note: I can boot off the ubuntu installation DVD, and at the screen that lets me boot from the DVD, run a memtest, or boot from the hard disk drive, I ***can*** boot up the rest of the way successfully. The filesystem seems intact and everything I've tried seems to work.
So the question is, before I try to fix the MBR on this drive, how do I make that 3TB drive into an identical bootable copy of the 1TB drive in every way EXCEPT changing the partition information on the 3TB drive? Currently both drives have a /boot partition, a /backup partition, a / partition and a swap partition. I suppose even the partition information could change as long as the main/large partition remains nearly 3TB, not 1TB like the old drive. Obvious I want to do this before I try to fix the MBR, just in case something goes wrong. In case it matters, the new 3TB drive may have 4KB sectors, while the old 1TB drive probably has 512 byte sectors.
LATER: I just ran "sudo parted -l /dev/sda" and it printed out the logical/physical sector sizes of my two drives. They are as follows:
1: old 1TB drive with bad MBR: sector size (logical/physical): 512B/512B
2: new 3TB drive with new OS: sector size (logical/physical): 512B/4096B
I'm not sure the significance or rationale for having a smaller "logical sector size" than the "physical sector size", but... that's what it says. I sure hope they're not starting new files part way through existing/allocated physical sectors, but what do I know (just seems unwise).
Update: I found an application called "boot-repair" and apparently it fixed my MBR. Unfortunately, it fixed my MBR when I had UN-checked both the "repair GRUB" and "restore MBR" options! Yikes! Here is my report about what happened when I ran this very cool little application: http://ubuntuforums.org/showthread.p...2#post11597852
Nonetheless, the drive now boots again, everything appears to still exist on the drive, and everything I tried to execute still worked.
I still figure I should create a backup of this whole drive. Any suggestions on how to do that?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.