Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Update: Thanks to all who helped. I gave up and am going to re-install. Not the end of the world, no files will be lost :-) This time will be backing up grub haha. Thanks again, I really appreciate the community's help on this.

I was going along fine when the new pae kernel came down, and it had some bug where the sound was all messed up.

So I used startup manager to choose the older pae kernel and rebooted. But startupmanager must have fuXXored my grub.

When I re-booted, I get thrown directly into memtest and thats it.

I tried to re-install grub using the live disc method that I found in many places. That changed something so I get a prompt and the message: "GNU grub version 1.99 ubuntu. Minimal BASH-like editing is supported. Type help for complete list."

But then I tried the live CD fix again and now am back at the memtest...

What can I do to get my system running again?

UPDATE: Just to be clear,when I start up I get a blinking cursor in the top left, and the word 'ON' in the middle of the screen. Then, after a good minute or two, the memtest starts.

share|improve this question
    
I guess the moral of the story is "don't use Startup Manager" haha! So odd that even the bass-ackwards hack-y way of doing it didn't even work. It might have been a problem with your initramfs... but I guess we'll never know. –  Githlar Feb 19 '12 at 5:19
add comment

3 Answers 3

I'll just make a different answer for this one. It's the same principle as the live-cd, but probably a little different than you did.

Enter the LiveCD, mount your drive, note its mountpoint. Then, open a terminal:

sudo mount --bind /dev /[mountpoint]/dev
sudo chroot [mountpoint]
mount -t sysfs none /sys
mount -t proc none /proc
mount -t devpts none /dev/pts
update-grub
umount /sys
umount /proc
umount /dev/pts
exit
umount /[mountpoint]/dev
reboot

if update-grub doesn't work (which it should) then grub-install /dev/sdaX surely will. I'm assuming you also know the partition it's installed on? If not you can check the Gparted on the LiveCD to be sure.

share|improve this answer
    
I picked up this trick from remastering Ubuntu CD's =) –  Githlar Feb 18 '12 at 15:18
    
yes this is what I have tried...and its gotten me to the prompt and back to memtest. I know where it is on the disk, but how to determine the mountpoint? –  RhZ Feb 18 '12 at 15:33
    
Sorry it took me so long, I was on another case. When you mount it in the file manager, then you can look at the toolbar (you might have to hit the little back arrow thing or Ctrl+L). The standard mount point is /media/[disk_label_or_uuid] –  Githlar Feb 18 '12 at 16:08
    
Thanks for your help Githlar, really appreciate it. However, I did the above and no love...still opens in memtest –  RhZ Feb 18 '12 at 17:11
    
You tried both update-grub and grub-install? –  Githlar Feb 18 '12 at 17:29
show 1 more comment
insmod gzio
insmod part_msdos
insmod ext2
search --no-floppy --file --set=root /boot/grub/grub.cfg
linux   /boot/vmlinuz-3.0.0-16-generic
initrd  /boot/initrd.img-3.0.0-16-generic`

You'll have to know your kernel version though

share|improve this answer
    
thanks for this but now the prompt is gone. But I do know the kernel version. –  RhZ Feb 18 '12 at 14:58
    
What commands did you run using the live-cd recovery method? –  Githlar Feb 18 '12 at 15:05
    
none so far, as the second time of using the live cd has led to the prompt being lost. If it comes back I will try your solution, I have it written down. –  RhZ Feb 18 '12 at 15:39
    
You can use TAB completion on the file name, or ls to see what files are there. –  psusi Feb 18 '12 at 16:00
add comment

It sounds like you tried something like this already, but I don't know exactly what you tried, so I'll post it anyway. Pay attention to the X and Y and make sure you get them right. I have used this method many times and it has always worked, but please forgive me if this is what you already tried.

This is a quick and simple method of restoring a broken system's GRUB 2 files. The terminal is used for entering commands and you must know the device name/partition of the installed system (sda1, sdb5, etc). The problem partition is located and mounted from the LiveCD. The files are then copied from the LiveCD libraries to the proper locations and MBR. If, for example Windows is on sda1 and Ubuntu is on sda5, and Windows has overwritten the MBR, then the target for grub installation will be /dev/sda5, and the MBR in the boot sector of sda will be re-written for grub.

This operation will write to the MBR and restore the modules and core.img to /boot/grub. It will not replace or restore grub.cfg or fix corrupted files.

Boot the LiveCD Desktop.

Open a terminal window.

Determine the partition with the Ubuntu installation. The fdisk option "-l" is a lowercase "L".

sudo fdisk -l

If you're not sure of the partition, look for one of the appropriate size or formatting.

Running sudo blkid may provide more information to help locate the proper partition, especially if the partitions are labeled. The device/drive is designated by sdX, with X being the device designation. sda is the first device, sdb is the second, etc. For most users the MBR will be installed to sda, the first drive on their system. The partition is designated by the Y. The first partition is 1, the second is 2. Note the devices and partitions are counted differently. Mount the partition containing the Ubuntu installation.

sudo mount /dev/sdXY /mnt

Example:

sudo mount /dev/sda1 /mnt

Note: If the user has a separate /boot partition, this must be mounted to /mnt/boot Note: If the user has a separate /home partition, this must be mounted to /mnt/home. Encrypted home partitions should work.

Run the grub-install command as described below. This will reinstall the GRUB 2 files on the mounted partition to the proper location and to the MBR of the designated device.

sudo grub-install --boot-directory=/mnt/boot /dev/sdX

Example:

sudo grub-install --boot-directory=/mnt/boot/ /dev/sda

Reboot

Refresh the GRUB 2 menu with

sudo update-grub

share|improve this answer
    
I would have told him this one, but I can never for the life of me remember what that parameter is on grub-install =P That, and I assumed this was the one he'd already tried. Mine's really off-the-wall compared to most of the things you see on LiveCD GRUB recovery. –  Githlar Feb 18 '12 at 16:11
    
Ok will try this one next. Hoping to get it working this time... –  RhZ Feb 18 '12 at 17:14
    
Sorry Kelley thanks for the help, I gave up and decided to go ahead and grab my files and re-install. Thanks anyway, cheers! –  RhZ Feb 19 '12 at 3:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.