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. If you do this, you will likely have to reinstall Grub. Back up any data on the hard drive before trying this. |
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:
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. |
Quote:
Is there a way to fix just the master boot record? |
Did you read my post above about how to format the MBR?
|
Quote:
|
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.
|
Quote:
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. |
Quote:
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? |
All times are GMT -5. The time now is 04:25 AM. |