quarta-feira, julho 29, 2009

Como Mudar a Sequencia de Boot no Vista/XP Dualboot

Note: In case you want to dual boot your system with Windows XP and Windows Vista, install Windows XP first.

The primary tool to edit Windows Vista boot configuration is BCDEdit.exe, a tool which is included in Windows Vista distribution in the C:\windows\system32 folder (C: being the windows vista system drive). BCDEdit.exe allows you to change and configure boot application data (files) in the BCD (Boot Configuration Data) stores which replace the settings in the boot.ini file in earlier versions of Windows.

BCDEdit basically replaces the BootCfg.exe tool that was used with earlier versions of Windows. BCDEdit provides much better and wider command line options and can do much more tasks than BCDCfg.

Here’s how you can use BCDedit to change the boot sequence and display order in the boot menu.

1. Start > Cmd > Right Click cmd> Run as Administrator

2. At the command prompt :

a. C:\> cd windows/system32

b. C:\windows\system32> bcdedit /?

c. C:\windows\system32> bcdedit /enum all

d. The output displays the boot configuration data of all the operating systems on the computer:

Windows Boot Loader

-------------------

identifier {current}

device partition=C:

path \Windows\system32\winload.exe

description Microsoft Windows Vista

locale en-US

inherit {bootloadersettings}

recoverysequence {572bcd56-ffa7-11d9-aae0-007e994107d}

recoveryenabled Yes

osdevice partition=C:

systemroot \Windows

resumeobject {89b97029-9609-11db-bbfe-cfc7153012f0}

nx OptIn

e. Note the 128-bit GUID of the Windows XP system. You will have a similar entry for that.

f. C:\Windows\system32> bcdedit /default

E.g bcdedit /default {cbd971bf-b7b8-4885-951a-fa03044f5d71}

Where {cbd971bf-b7b8-4885-951a-fa03044f5d71} is the GUID of the Windows XP system.

In case you wish to delete the Windows XP entry from the boot menu:

g. c:\windows\system32> bcdedit /delete

You can also change the description of an entry using the following command:

h. bcdedit /set ID description "The new description"


For example:

bcdedit /set {802d5e32-0784-11da-bd33-000476eba25f} description "My Favorite OS"

You can change the display order of the boot options using the following command:


i. bcdedit /displayorder ID1 [ID2] [ID3] [...]


For example :

bcdedit /displayorder {802d5e32-0784-11da-bd33-000476eba25f}

{cbd971bf-b7b8-4885-951a-fa03044f5d71}

This will change the diplay order of the entries the next time the system is turned on only.

In order to make permanant changes to the boot order you can use the following command:

j. bcdedit /bootsequence ID1 [ID2] [ID3] ...


For example:

bcdedit /bootsequence {802d5e32-0784-11da-bd33-000476eba25f}

{cbd971bf-b7b8-4885-951a-fa03044f5d71}

The following command sets the boot manager’s timeout to 30 seconds:

k. Bcdedit /timeout 30

Refrences: You can download a complete guide on BCD edit at:

http://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/BCDedit_reff.docx

sexta-feira, julho 17, 2009

Como Usar Boot Manager do Windows Vista para Carregar o Linux

The Web is full of explanations on how to dual boot Windows and Linux using a Linux boot manager like GRUB or LILO. If you want to dual boot Windows Vista and Linux using Windows Vista’s Boot Manager, please read on. I will assume that you already have installed Linux on your machine using GRUB as your boot loader.


Step 1 – Install GRUB on the Linux partition (outside of MBR)


As Windows Vista will replace the Master Boot Record (MBR) with its own, we need to relocate GRUB elsewhere by running grub-install with the Linux partition as a parameter.

• On Linux, launch a Terminal with root privileges

• Find the name of the partition Linux is installed on by running fdisk –l (the partition you’re looking for is the one whose system is Linux, can be something like /dev/sda1 or /dev/hda1. For the rest of this post, I’ll use /dev/sda1)

• Install GRUB on the Linux partition by running : grub-install /dev/sda1


Step 2 – Get a copy of Linux boot sector


We will need to instruct Windows Boot Manager how to boot correctly Linux using Linux boot sector, which we will extract using dd.

• On Linux, launch a Terminal with root privileges

• Take a copy of Linux boot sector : dd if=/dev/sda1 of=/tmp/linux.bin bs=512 count=1

• Copy linux.bin on a FAT formatted USB key or any storage accessible from Windows Vista


Step 3 – Install Windows Vista


Step 4 – Configure dual booting in Windows Vista


We will create an entry for GRUB in Windows Vista boot configuration data store using bcdedit.

• On Windows Vista, launch a command prompt with administrative privileges (by right clicking on cmd and choosing Run as Administrator)

• Copy Linux boot sector on the root of the Windows boot (active) partition, namely the one containing bootmgr. If you don’t know for sure you can use diskpart or diskmgmt.msc to find out which one it is.

• Create an entry for GRUB :

o bcdedit /create /d “GRUB” /application BOOTSECTOR

o Note: bcdedit will return an ID for this entry that we will call {LinuxID} below. You will need to replace {LinuxID} by the returned identifier in this step. An example of {LinuxID} is {81ed7925-47ee-11db-bd26-cbb4e160eb27}

• Specify which device hosts a copy of the Linux boot sector

o bcdedit /set {LinuxID} device boot

• Specify the path to a copy of the Linux boot sector

o bcdedit /set {LinuxID} PATH \linux.bin

• Add Linux entry to the displayed menu at boot time

o bcdedit /displayorder {LinuxID} /addlast

• Let the menu be displayed 10 seconds to allow for OS selection

o bcdedit /timeout 10