Pages

Tuesday, November 20, 2012

Prepare bootloader for Safeboot


Environment :
Windows 7
Ubuntu

Installation / Usage :
This would be the most critical part in getting the dual boot to work properly with SafeBoot/McAfee Endpoint Encryption installed. We are using a method called "chain loading".

Pre-requisite:
A) Windows 7 installed (Without SafeBoot/McAfee Endpoint Encryption)
B) Ubuntu installed (During boot, GRUB is the boot manager)

The following step is to backup the Ubuntu bootloader:
1. Login Ubuntu
2. Issue the command "df" without quotes and note down the entry which says "Mounted on "/" .. what is the /dev/sda?
3. Issue the command "sudo grub-install --force /dev/sda?" .. where sda? is referring from result from step #2
4. Backup the bootloader, issue the command "dd if=/dev/sda of=grub.bin bs=512 count=1" (you can specify the thumbdrive at the 'of' paramenter)

The following step is to default the bootloader back to the original Windows 7 bootloader:
1. Boot PC
2. Press F8 after BIOS and Before Windows logo (Bring up the recovery console)
3. Select "Command Prompt"
4. Issue the command "bootrec /fixmbr"
5. Reboot

Upon reboot you should see the generic Window boot selection and GRUB is missing. This is expected.

6. Boot into Windows 7
7. Copy the grub.bin file from the thumbdrive into C:\Windows\System32

The following step is to update the Windows 7 boot menu to add the entry for Ubuntu:

9. Open a command prompt (Run > cmd)
10. Issue the following command to update the boot menu

BcdEdit commands:

    10a. Create a ID for the entry "Ubuntu"
    bcdedit /create /d "Ubuntu" /application BOOTSECTOR
    The entry {5a9684fa-9ec0-11e1-a7c3-00137290c993} was successfully created.
   
    * eg. ID -> {5a9684fa-9ec0-11e1-a7c3-00137290c993}
    * Copy the ID generated from this command as it will be reference in the following commands

   
    10b. Specifying which partition contains the bootloader (grub.bin)
    bcdedit /set {5a9684fa-9ec0-11e1-a7c3-00137290c993} device partition=c:
   
    10c. Specifying the path to the bootloader (grub.bin)
    bcdedit /set {5a9684fa-9ec0-11e1-a7c3-00137290c993} path \Windows\System32\grub.bin
   
    10d. Add the entry to the boot menu
    bcdedit /displayorder {5a9684fa-9ec0-11e1-a7c3-00137290c993} /addlast
   
    10e. Specifying menu display time
    bcdedit /timeout 10

11. Verify the Window 7 boot menu has the entry
Right-click "Computer" > Advanced system settings > Advanced > Startup and Recovery > Settings >
Under the drop down of "Default operating system", you should see Ubuntu.

12. Reboot and Choose the "Ubuntu" entry
13. GRUB should be loaded if all had been done properly
14. Allow it to boot into Ubuntu to see if it working properly

! For Windows XP users, you can edit the Boot.ini file and specify the path to the Linux bootloader
! For Windows 7 users, you can download a software called EasyBCD which is free and edit the boot menu entries via a GUI. It also has an option to default the boot loader back to Windows 7 original.

No comments:

Post a Comment