<?xml version="1.0"?>
<linuxdoc><article opts="null"><titlepag><title>NT OS Loader + Linux mini-HOWTO</title><author><name>Bernd Reichert, entreichert@dial.eunet.chent</name></author><date>v1.11, 2 September 1997</date></titlepag><sect><heading>Abstract</heading><p>This document describes the use of the Windows NT boot loader to
start Linux.
This procedures have been tested with Windows NT 4.0 WS and Linux 2.0.</p><p></p></sect><sect><heading>How does the NT OS Loader work</heading><p>The NT OS loader likes to have the boot sector from the other
operating systems available as a file. It reads this file and 
starts the operating system selected, i.e. either Windows NT in 
different Modes or any other OS.</p><p></p></sect><sect><heading>Tips on how to install Windows NT and Linux on the same System</heading><sect1><heading>Windows NT installation</heading><p>Try to install Windows NT first. If you want to use NTFS for your Windows 
NT-partition, keep in mind, that the todays production version of Linux
cannot access NTFS partitions. 
An alpha driver that can read NTFS-Partitions is available at 
<tt>http://www.informatik.hu-berlin.de/entloewis/ntfs</tt>.
You may create a separate FAT-Partition for data exchange 
or you have to use DOS-formatted floppies.</p><p></p></sect1><sect1><heading>Partitioning</heading><p>Another Mini-howto recommends not to use NTs "Disk Administartor" 
to create the Linux swap- and root-partitions. It is sufficient to 
see the free space there. I also recommend to use linux's fdisk later.</p><p></p></sect1><sect1><heading>Linux installation</heading><p>Now boot linux from diskettes, create the swap and root-partition.
Fdisk assumes the ntfs-partition to be a HPFS-partition. 
This is normal.
Boot again from diskettes and install Linux as you like.</p><p></p><p>Just in case the installation procedure suggests that you could mount 
the HPFS partition which it has found: Ignore it. </p><p></p></sect1><sect1><heading>Lilo</heading><p>When you come to the Lilo-Section, specify your Linux-root-partition 
as your boot device because the Master Boot Record (MBR) of your
harddisk is owned by Windows NT. This means that the root-entry and
the boot-entry in your <tt>/etc/lilo.conf</tt> have the same value.
If you have a IDE-harddisk and your Linux-partition is the second 
partition, your boot-entry in <tt>/etc/lilo.conf</tt> looks like:</p><p><tscreen><verb>boot=/dev/hda2</verb></tscreen></p><p>If you have two disks and your Linux resides on the first partition
of your second disk, your boot-entry in <tt>/etc/lilo.conf</tt> looks like:</p><p><tscreen><verb>boot=/dev/hdb1</verb></tscreen></p><p>Run lilo with a kernel that matches your system. 
Check the kernel by booting from diskette first if you are not sure.</p><p></p><p>If you cannot boot Windows NT now, you have a problem.
I hope you have created a repair-disk recently.</p><p></p><p></p></sect1></sect><sect><heading>Bootpart</heading><p>There is a NT-programm called bootpart written by G. Vollant that can do
the jobs from the next two points for you. Bootpart is available at 
<tt>http://ourworld.compuserve.com/homepages/gvollant/bootpart.htm</tt>.</p><p></p><p>If you want to know how things are working together, use the procedures 
described in point 5 and 6.</p><p></p><p></p></sect><sect><heading>The Linux part of the work</heading><p>You have to boot from diskettes until the NT-part is fixed.</p><p></p><p>Now you have to peel the bootsector from your Linux-root-Partition.
With /dev/hda2 as your linux-partition, the dd-command is:</p><p><tscreen><verb># dd if=/dev/hda2 of=/bootsect.lnx bs=512 count=1</verb></tscreen></p><p>There is something wrong if your bootsect.lnx has more 
than 512 bytes.</p><p>Now copy the file bootsect.lnx to a DOS-formated floppy if this is 
your way to transfer files to the NTFS-Windows-partition.</p><p>You can copy it with </p><p><tscreen><verb># mcopy /bootsect.lnx a:</verb></tscreen></p><p>or with</p><p><tscreen><verb># mount -t msdos /dev/fd0 /mnt
# copy /bootsect.lnx /mnt
# umount /mnt</verb></tscreen></p><p></p><p></p></sect><sect><heading>The Windows NT part of the work</heading><p>Copy the file from the diskette to <tt>C:\\bootsect.lnx</tt>. I don't tell you
how to do that.</p><p>What lilo.conf is for linux is <tt>c:\\boot.ini</tt> for Windows NT.
Remove the, system- and the read-only-attribute before you 
can modify it with:</p><p><tscreen><verb>C:\attrib -s -r c:\boot.ini </verb></tscreen></p><p>Now change the file boot.ini with an editor, notepad for example, as follows: </p><p><tscreen><verb>[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation ... 
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows NT Workstation ...
C:\BOOTSECT.LNX="Linux"</verb></tscreen></p><p>Only the last line has been added in this example.
Restore the attributes after you have saved <tt>boot.ini</tt> with: </p><p><tscreen><verb>C:\attrib +s +r c:\boot.ini </verb></tscreen></p><p>After a shutdown of your Windows NT and a restart your should
see the following:</p><p><tscreen><verb>  OS Loader V4.00
 
  Please select the operating system to start:

  Windows NT Workstation Version 4.0
  Windows NT Workstation Version 4.0 [VGA mode]
  Linux

Select Linux and see

  LILO loading zImage ....</verb></tscreen></p><p></p><p></p></sect><sect><heading>Play it again Sam</heading><p>A new copy of bootsect.lnx must be transfererd to <tt>C:entBOOTSECT.LNX</tt>
evry time the bootsector of your linux-partition has been modified.
This happens for example when you install a new kernel with lilo.   
As you can see such a system in not ideal for testing experimental 
kernels.</p><p></p><p></p></sect><sect><heading>Troubleshooting </heading><p>If things do not work as expected, check bootability with a floppy disk.
With <tt>/dev/hdb1</tt> as your Linux-partition, your <tt>/etc/lilo.conf</tt> 
has the following entries:</p><p><tscreen><verb>root=/dev/hdb1
boot=/dev/fd0</verb></tscreen></p><p>Run lilo with a diskette inserted. Now try to boot from the diskette. 
If your Linux on <tt>/dev/hdb1</tt> can't be 
started, the NT OS loader will also fail to start it.  
If you see a lot of <tt>01 01 01 01</tt>, your root-disk is not accessible.
Check whether all your disks are known by the bios.</p><p></p><p>If the floppy boots your Linux partition, you can peel of your 
boot-sector for the NT OS loader with: </p><p><tscreen><verb># dd if=/dev/fd0 of=/bootsect.lnx bs=512 count=1</verb></tscreen></p><p></p><p>You can keep this diskette as your rescue-diskette just in case
your Windows NT installation breaks.</p><p></p><p></p></sect><sect><heading>References</heading><p><itemize><item>The Linux+WindowsNT mini-HOWTO</item><item>The FAQ for FreeBSD 2.X</item></itemize></p><p></p></sect><sect><heading>Acknowledgements</heading><p><itemize><item>Thanks to Xiaoming Yi entz3c20@ttacs.ttu.eduent for the tip that
the procedures work also with other disks than the first one.</item><item>Thanks to Frank Dennler entFrank.Dennler@zkb.chent for the
diskette-trick.</item></itemize></p><p></p></sect><sect><heading>Feedback</heading><p>Any comments are welcome.</p><p></p></sect></article></linuxdoc>

