Dual Booting SUSE Linux from the Microsoft Windows NTLDR
This document (3150378) is provided subject to the disclaimer at the end of this document.
Environment
Microsoft Windows XP Professional
Situation
- Microsoft Windows XP overwrites the Master Boot Record (MBR) portion of the hard disk causing the GRUB (GRand Unified Boot) loader to fail to start.
- It is desired to bypass the GRUB boot platform and use the NTLDR boot mechanism provided with Microsoft Windows.
Resolution
- Locate the primary hard drive that the workstation boots from (typically /boot, but may vary on the system). If this is notknown, consult the additional notes section of this document for a mechanism to locate this information. In the example commands, this document will be using an example where the root partition is stored on the /dev/hda5 partition, making the /dev/hda device name become the primary boot hard disk.
- Copy the GRUB master boot record by running the command :
dd if=[PRIMARY PARTITION] bs=512 count=1 of=/root/linux.bin
In the example using /dev/hda, the command would read :dd if=/dev/hda bs=512 count=1 of=/root/linux.bin
- Copy the /root/linux.bin file to a location that can be read from within Windows (e.g. a USB storage device, a floppy disk, or a CD-ROM).
- Boot into Microsoft Windows, and run the FIXMBR command to repair the master boot record as Microsoft Windows expects it to be. Note, this command may only be available via the Windows recovery console.
- Copy the linux.bin file into the root of the C: drive.
- Change directories to the root of the C: drive :
cd \
- Alter the attributes of the boot.ini file :
attrib -s -h -r boot.ini
- Open the boot.ini file to edit it. It will contain something similar to :
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
- Add the following line :
c:\linux.bin="SUSE Linux Enterprise Desktop"
The resulting file should look similar to (added line in bold) :[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
c:\linux.bin="SUSE Linux Enterprise Desktop"
- Save the file and exit.
- Set the file attributes back to their original state with the following command:
attrib +s +h +r boot.ini
- Reboot and test.
Additional Information
mount|grep 'on / type'|awk '{print $1}'may be used to locate the desired partition. To explain this command, the "mount" command simply creates a list of mounted partitions. The"grep" phase of the command removes everything except the line containing 'on / type' (meaning the data now only contains the root partition). The"awk" command prints only the first piece of this line (meaning the data now only has the device node that houses the root partition). The result will contain a number (e.g. "/dev/hda5"). This number should be removed (e.g. become "/dev/hda"). This final value should represent the linux device name of the boot hard drive.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:3150378
- Creation Date: 01-Oct-2007
- Modified Date:05-Mar-2021
-
- SUSE Linux Enterprise Desktop
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com