Have a dual boot system but need to change the MBR


Results 1 to 5 of 5

Thread: Have a dual boot system but need to change the MBR

  1. #1
    Join Date
    Sep 2009
    Posts
    2

    Question Have a dual boot system but need to change the MBR

    Hi

    I have been using a dual boot Windows/Ubuntu system since 8.04 and successfully upgraded to 8.10 and 9.04 (Windows is XP sp3).

    I now need to encrypt my hard drive but only the windows partition. The software I will be using can cope with this as long as I have the original Windows MBR in place and then add an extra option in the windows boot loader to boot to linux.

    My windows partition is ntfs and I have followed the following instructions given in the encryption software guide.

    sudo dd if=/dev/sda3 of=/media/linux.tr0 bs=512 count=1 [Enter]
    sudo mkdir /media/disk-c [Enter]

    sudo mount -t ntfs /dev/sda2 /media/disk-c [Enter]

    I then had to boot into Windows and go to the System Control Panel, click the advance tab and in the Startup and Recovery section, click the Settings button. I then clicked the EDIT button to edit the Boot.ini file.

    My file had the following

    [boot loader]
    timeout=30
    default=multi(0)disk(0)rdisk(0)partition(2)\WINDOW S
    [operating systems]
    multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Micro soft Windows XP
    Professional" /noexecute=optin /fastdetect

    and I added
    c:\linux.tr0="Linux"
    to the end and saved

    Finally in the Command Prompt window, I typed
    attrib +H +S +R BOOT.INI [Enter]
    attrib +H +S +R linux.tr0 [Enter]

    I then rebooted... GRUB still took over as bootloader and I selected Windows
    As Windows began to boot I got the Windows Boot Manager and there I selected Linux.

    This took me to GRUB and an error 18
    eventually the machine rebooted and I got GRUB as the initial bootloader.

    I want to be sure that if I now use fixmbr in Windows I will still be able to boot into Linux without getting the Error 18.

    Should I go ahead and use fixmbr or is there something else I need to do. Once the bootloader is windows then I can use the encryption software and encrypt the windows partition only.

    Any help appreciated

  2. #2
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    Mych,

    Welcome to Justlinux!



    What you are doing is tyoical of using a boot loader A (XP) to boot a boot loader B (Grub from Ubuntu). This will only work if the second boot loader is inside the root partition of the OS.

    A MS Windows always places the boot loader in its root partition. A Linux doing a dual boot usually places the boot loader in the MBR.

    Therefore your scheme can only work if you restore/install/replicate Grub in sda3 first.

    This you can do first by booting up any Ubuntu Linux Live CD and choose a terminal and then issue these commands
    Code:
    sudo grub
    root (hd0,2)
    setup (hd0,2)
    quit
    If you are able to boot up Ubuntu in sda3 the above will work too in addition to the follow alternative (also in terminal)
    Code:
    sudo grub-install /dev/sda3
    Thereafter your Ubuntu is "chainloadable" and you can repeat what you do, starting with the "dd" because the first 512 bytes of sda3 now has the address to pick up Grub inside sda3.

    Once done the above you can restore Xp's MBR using the "fixmbr" command off a Recovery Console.

    You are effectively change from Grub to Xp's boot loader to dual boot the two OSes.

    If you have any problem of not able to fire up Ubuntu, boot a Linux Live CD and Grub can be restored in the MBR by commands
    Code:
    sudo grub
    root (hd0,2)
    setup (hd0)
    quit
    Please note omitting the partition number "2" will make Grub to restore itself in the whole of (hd0) and that is the MBR of sda. Grub counts from zero so sda3 is (hd0,2). If you have Grub2 (standard in Ubuntu 9.10) the partition reference will need to be (hd0,3)).

    You can generate Xp's or Linux's MBR any number of times.

    Have fun.
    Last edited by saikee; 09-23-2009 at 12:48 PM.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  3. #3
    Join Date
    Sep 2009
    Posts
    2
    Many Thanks Saikee... Your help appreciated...

    As a side note I tried to use fixmbr via the Recovery Console but it asks for the admin password. Found some software called MBRFix which allowed me to fix the mbr from the cmd line without the need for admin password. Now would Linux let you do that... I think not.

  4. #4
    Join Date
    Jun 2004
    Location
    Newcastle upon Tyne
    Posts
    2,978
    You can use any Linux Live CD to read/write any standard Linux of NTFS partition without bothering with a password.

    The password to use a Recovery Console on a Xp partition is only specific to the Xp Prof version. You do not get such hassle with the Xp Home. In any case Xp MBR can be fixed by a Dos floppy so I wouldn't lose sleep if it protected by a password. I also believe any Vista or Win7 DVD can fix Xp's MBR.

    For Xp's text and hidden files , like boot.ini, any Linux Live CD can be used to access and edit them directly in a root console.
    Linux user started Jun 2004 - No. 361921
    Using a Linux live CD to clone XP
    To install Linux and keep Windows MBR untouched
    Adding extra Linux & Doing it in a lazy way
    A Grub menu booting 100+ systems & A "Howto" to install and boot 145 systems
    Just cloning tips Just booting tips A collection of booting tips

    Judge asked Linux "You are being charged murdering Windoze by stabbing its heart with a weapon, what was it?" Replied Linux "A Live CD"

  5. #5
    Join Date
    Jul 2002
    Location
    Vladivostok, Russia
    Posts
    9,053
    As an additional note...the Recovery Console in XP will ask you for the password when attempting to issue any command. 9 times out of 10 you can hit enter and it will proceed. Unless you have actually set up an admin account with a password, it will work.
    "I was pulled over for speeding today. The officer said, "Don't you know
    the speed limit is 55 miles an hour?" And I said, "Yes, but I wasn't going
    to be out that long."

    How To Ask Questions The Smart Way
    COME VISIT ME IN RUSSIA NOW!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •