Restoring the MBR on a CD-ROM less Notebook
Tom H
tomh0665 at gmail.com
Fri May 21 17:07:19 UTC 2010
On Fri, May 21, 2010 at 10:41 AM, Amichai Rotman <amichai at iglu.org.il> wrote:
> On Wed, May 19, 2010 at 16:21, Tom H <tomh0665 at gmail.com> wrote:
>> On Wed, May 19, 2010 at 3:07 AM, Amichai Rotman <amichai at iglu.org.il>
>> wrote:
>> > On Wed, May 19, 2010 at 07:22, Tom H <tomh0665 at gmail.com> wrote:
>> >>
>> >> At the grub rescue prompt:
>> >>
>> >> Run "ls" to display your disks and partitions
>> >>
>> >> Run "set" and check the values of "root" and "prefix"
>> >>
>> >> If "root" and "prefix" are incorrect (if you do not know what they
>> >> should be, run "ls (hdX,Y)/boot" for the different values of X and Y
>> >> since search isn't available in rescue mode), run
>> >> set root=(hdX,Y)
>> >> set prefix=(hdX,Y)/boot/grub
>> >> to set them to the correct values
>> >>
>> >> Run
>> >> insmod normal.mod
>> >> or, if necessary,
>> >> insmod /boot/grub/normal.mod
>> >>
>> >> Run
>> >> linux /boot/vmlinuz-2.6.x.x root=/dev/sdXY ro
>> >> initrd /boot/initrd.img-2.6.x.x
>> >> boot
>> >> (use tab completion)
>> >
>> > Thank for the great info, except there isn't any Linux on it now. I need
>> > to
>> > re-create Windows 7 boot loader or whatever.
>> > I started a live Ubuntu 10.04 stick and I found out the partitin I need
>> > to
>> > boot is /dev/sda2...
>>
>> You're welcome.
>>
>> What I forgot to say in my earlier email is that once booted up in
>> Ubuntu, you would have had to run "grub-install" and "update-grub" to
>> set up grub properly and then check whether you could boot into
>> Windows by paging through /boot/grub/grub.cfg to see whether there is
>> a Windows entry and then trying to boot from it.
>>
>> If you just want to fix Win7, you have to boot from a recovery CD and
>> run "bootrec /rebuildbcd", "bootrec /fixmbr", "bootrec /fixboot" (in
>> ascending order of change to the Win setup).
> I "got rid" of the "grub rescue>" prompt with the following steps:
> 1. Booting the Notebook from a USB Live Ubuntu Lucid.
> 2. Installing the mbr package.
> 3. running the following in a console: "install-mbr -i n -p D -t 0 /dev/sda"
> now I, when i boot the Notebook, it gets to the regular Win 7 boot loader
> thats gives me a error saying that due to a hardware change there is a
> problem starting Windows and I should start a repair from a Windows 7
> Installation CD.
> I got that CD, but no CD drive. I tried to use dd to dump the ISO I've made
> from that CD to a USB stick, but it wouldn't boot from it.
> I know the CD is bootable. Can someone tell me what's the syntax for dd to
> make a USB Stick "look like" a CD to the system? Maybe the bs= parameter?
> Is there away to create a bootable USB stick with those tools mentioned at
> the end of Tom's last post?
> As for the fact I am a Linux guy trying to fix a Windows problem - believe
> me I am doing this under protest - it's my sister's Netbook and she insists
> I put Windows back after trying Ubuntu Lucid for a week. Not because she
> wasn't happy with it - she actually liked it very much, but she says she
> wants to give Windows 7 a try too and she is afraid she won't be able to get
> help if she has a problem with her computer (I don't live near enough to pop
> in if she gets stuck)...
I posted earlier a Win7 fix involving the mbr package and install-mbr.
>From the links in that other thread, it looks like:
. Windows recovery/security software (whether that of MS, Dell, etc)
writes over the area of the disk where grub installs stage 1.5 or
core.img (it probably tags the grub file as a security threat)
. the mbr package allows grub to bypass that file
The commands that I had posted earlier are grub commands. grub2 goes
to a grub prompt if it finds its configuration and cannot boot and it
goes to a grub rescue prompt if it cannot find its configuration. The
grub rescue commands are a subset of the grub prompt commands; so, for
example, you cannot use "search" as you would with a grub prompt to
find the grub directory.
If you run update-grub, you should have a Win7 entry and be able to boot to it.
One last thing is that the Windows partition must not be marked as
bootable. It is the partition with the kernel that must be marked
bootable; so either / or /boot if it is mounted separately.
More information about the ubuntu-users
mailing list