PDA

View Full Version : [SOLVED] 10.04 Grub & MBR repair



DrDevice
January 6th, 2011, 12:42 PM
Hello again! Once more I prostrate myself before the mighty gurus here, looking for a wee bit of assistance.

In a nutshell:

I have a dualboot XP/10.04 Ubuntu setup. I have 3 SATA hard drives. First has just WinXP, second has 10.04 on one partition, NTFS storage on the other, and third is another NTFS drive (friend's drive I'm running for him while his computer is down). fdisk -l output below (last one is my LiveUSB):

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x99c199c1

Device Boot Start End Blocks Id System
/dev/sda1 * 1 30400 244187968+ 7 HPFS/NTFS

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e2aa2

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 7418 59585053+ 83 Linux
/dev/sdb2 7419 60801 428798947+ 7 HPFS/NTFS

Disk /dev/sdc: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb2b8f831

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 38913 312568641 7 HPFS/NTFS

Disk /dev/sdd: 4022 MB, 4022337024 bytes
255 heads, 63 sectors/track, 489 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdd1 * 1 488 3919841 b W95 FAT32


I was happily playing in Windows and had a great time (Mass Effect 2, if you're interested :)). When I was done, I restarted my system, chose my Ubuntu from Grub2 (i think), and that's when all heck broke loose.

The Ubuntu logo/loading screen came up, and just sat there blinking the dots at me. I did a Ctrl+Alt+F1, and all I got was basically a scrolling screen of what I assume are errors, going by so fast that I couldn't really make out much. The very left of the lines seemed to be time indications in seconds (ie: 4.443734, 120.978784, etc), the next was on every line: ATA 7.0 and the rest was going by too fast to read. I did not panic.

I tried going to recovery mode. Same thing, just not with the Ubuntu logo thingie. I did not panic.

I tried booting back into windows. It came up with the XP logo and had the booting line on it...and it was stuck. Rebooted and tried safe mode, it got stuck. I did not panic.

I borrowed my friend's Win7 laptop and made an Ubuntu LiveUSB with unetbootin. Popped it in and...same behavior, only now I coudn't do the Ctrl+Alt+F1 to see messages, it was just blank. I began to feel like panicking. I didn't, but it was close.

I opened up my PC and unhooked the data cables from all but one of my drives. I powered back up: LiveUSB loaded. Woot! Problem is not that drive (WinXP). I did the same with each consecutive drive: each worked.

Hooked 'em all back together, turned on the PC: LiveUSB loaded, I have access to all drives. :confused:

Hokay, shut down, remove USB, reboot: "NTLDR IS MISSING". Ah, okay, Grub's gone for some reason. I did some searching on the forums, and came across https://help.ubuntu.com/community/Grub2#Reinstalling%20GRUB%202. I followed the Simplest method, all seemed well; no errors. Rebooted normally and got...

"NTLDR IS MISSING"

So now I'm kinda confused. I don't know what I did wrong, and the other methods are intimidating enough that I'd rather get some advice from people who are wiser than I before continuing.

So...anybody care to chime in?:grin:

DrDevice
January 7th, 2011, 12:13 PM
So yeah, I fixed it. Came home tonight, mounted the linux drive in my LiveUSB via Nautilus (auto mounted to the /media directory), and once again ran
sudo grub-install --root-directory=/media/longhasnameorsomething /dev/sda.

I got no errors, just as before, and I wasn't really sure it was gonna work but what the hey, right? Reboot...and there's my sweet Grub2 menu. Open Ubuntu and...I'm back. So yeah, whatever didn't happen the first time through that tutorial happened this time, and I think it's because Nautilus auto mounted the drive in a way that made it work.

Anyhoo, if anybody else has a problem like this, and the help page above didn't work for you, try loading the drive though Nautilus and change your grub-install command to suit. :D