Search This Blog

Thursday, January 8, 2009

Recovery problems

Bootrec.exe tool in the Windows Recovery

It repairs the following items in Windows Vista:
• A master boot record (MBR)
• A boot sector


To run the Bootrec.exe tool, you must start Windows RE(recovery environment). To do this, follow these steps:
1. Put the Windows Vista installation disc in the disc drive, and then start the computer.
2. Press a key when you are prompted.
3. Select a language, a time, a currency, a keyboard or an input method, and then click Next.
4. Click Repair your computer.
5. Click the operating system that you want to repair, and then click Next.
6. In the System Recovery Options dialog box, click Command Prompt.
7. Type Bootrec.exe, and then press ENTER.

Note: This is only possible with windows vista recovery cd which you can get with vista installation cd/dvd or from

net you can download it.

Bootrec.exe options
The Bootrec.exe tool supports the following options. Use the option that is appropriate for your situation.

Note: If rebuilding the BCD does not resolve the startup issue, you can export and delete the BCD, and then run

this option again. By doing this, you make sure that the BCD is completely rebuilt. To do this, type the following

commands at the Windows RE command prompt:
• bcdedit /export C:\BCD_Backup
• c:
• cd boot
• attrib bcd -s -h -r
• ren c:\boot\bcd bcd.old
• bootrec /RebuildBcd
/FixMbr
The /FixMbr option writes a Windows Vista-compatible MBR to the system partition. This option does not overwrite

the existing partition table. Use this option when you must resolve MBR corruption issues, or when you have to

remove non-standard code from the MBR.
/FixBoot
The /FixBoot option writes a new boot sector to the system partition by using a boot sector that is compatible with

Windows Vista. Use this option if one of the following conditions is true:
• The boot sector has been replaced with a non-standard Windows Vista boot sector.
• The boot sector is damaged.
• An earlier Windows operating system has been installed after Windows Vista was installed. In this scenario,

the computer starts by using Windows NT Loader (NTLDR) instead of Windows Boot Manager (Bootmgr.exe).
/ScanOs
The /ScanOs option scans all disks for installations that are compatible with Windows Vista. Additionally, this

option displays the entries that are currently not in the BCD store. Use this option when there are Windows Vista

installations that the Boot Manager menu does not list.
/RebuildBcd
The /RebuildBcd option scans all disks for installations that are compatible with Windows Vista. Additionally, this

option lets you select the installations that you want to add to the BCD store. Use this option when you must

completely rebuild the BCD

Reinstalling Grub boot loader
BY
COMMANDS @ TERMINAL
COMMANDS TO REINSTALL GRUB:
U just need to enter the terminal using the installation CD/DVD of your GNU/Linux operating system.

Once you are at the terminal. type this:
$ grub
If it says that you don’t have the permission. Type this command at the terminal:
$ sudo grub
You will get the grub-shell prompt:
grub>

Now, you need to find out in which partition Grub had been installed before, so that you reinstall in that

partition only. Give this command at the terminal:
grub> find /boot/grub/stage1
(returns value)
It returns the number of the partition in which Grub i.e your GNU/Linux had been installed.
e.g.,

grub> find /boot/grub/stage1
(hd0,2)


NOTE:
Sometimes, when Grub has not been installed properly, the file “/boot/grub/stage1″ may not exist. So, the output

will be “Error 15: File not found”. In such a case, come out of the grub-shell by pressing “Ctrl+c”. Then, at the

shell prompt, give this command at the terminal:
$ fdisk -l
Again, if you are not logged in as root, give this command at the terminal:
$ sudo fdisk -l
The output will list all the partitions and it’s properties, including the file system type.
e.g.,
Device Boot Start End Blocks Id System
/dev/sda1 1 654 5253223+ b FAT32
/dev/sda2 * 655 1962 10506510 7 HPFS/NTFS
/dev/sda3 1963 3924 15759765 83 Linux
The “System” attribute of your GNU/Linux operating system will be “Linux”. So note down that partition number.
e.g., sda3
Since it’s array numbering, sdaN is mapped to (hd0,N-1).
Just (hd0) will be the Master Boot Record(MBR).
sda1 will be (hd0,0) and so on.
So, sda3 will be (hd0,2)
Now, log into the grub-shell prompt again.

Before reinstalling Grub, you will have to notify the partition that your Grub i.e. GNU/Linux is resided in. So,

give this command at the terminal:
grub> root (returned value)
e.g.,
grub> root (hd0,2)

Now, reinstall grub in the MBR i.e. the returned value without number part.
e.g., (hd0)
So, give this command at the terminal:
grub> setup (returned value without number part)
e.g.,
grub> setup (hd0)

Exit the grub-shell prompt using “Ctrl+c”.
Exit the shell prompt using “Ctrl+d”.

NOTE :

You can also reinstall Grub in your GNU/Linux partition, only if this GNU/Linux partition is “primary” and you have

another boot loader installed at the MBR(in case of more than one GNU/Linux operating systems) through which you

can boot this primary partition. To do that, give this command at the terminal:
grub> setup (returned value)
e.g.,
grub> setup (hd0,2)