1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
<HTML>
<BODY BGCOLOR="#ffffff" TEXT="#000000" LINK="#4f4fff" VLINK="#0000ff" ALINK="#00ff00">
<H1>Rewrite Bootsector Example</H1>
<FONT COLOR="red">WARNING:</FONT><BR>
The way descriped below may be not the only way to use the rewrite option, but this is the way I use
it and the way it works.
<BR>You need a Linux Bootdisk and should have a install version of Windows95 or NT.
<BR><FONT COLOR="red">PLEASE BACKUP ALL IMPORTANT DATA ON YOU HARDDISKS BEFORE TRYING
THESE.</FONT>
<P>
Let's assume you have a working Linux / DOS6.22 & Windows3.11 system:
<TABLE BORDER=1>
<TR>
<TH>OS</TH><TH>dev</TH><TH>Type</TH><TH>active</TH>
</TR>
<TR>
<TD>Linux</TD><TD>/dev/hda1 (1st partition table entry)</TD>
<TD><B>83</B> (Linux)</TD><TD ALIGN=CENTER>no</TD>
</TR>
<TR>
<TD>SWAP</TD><TD>/dev/hda2 (2nd partition table entry)</TD>
<TD><B>82</B> (Linux SWAP)</TD><TD ALIGN=CENTER>no</TD>
</TR>
<TR>
<TD>DOS/Windows</TD><TD>/dev/hda3 (3rd partition table entry)</TD>
<TD><B>06</B> (DOS 16-bit >=32M)</TD><TD ALIGN=CENTER>yes</TD>
</TR>
<TR>
<TD>----</TD><TD>/dev/hda4 (4th partition table entry)</TD>
<TD>---</TD><TD ALIGN=CENTER>---</TD>
</TR>
</TABLE>
<P>
Now assume you want to use the 4th partition to install Win95 and would keep W95 away from your old
DOS/Windows3.11 partition (nobody knows what W95 does with files on HD :-) )
<P>
1. Create the partition for Win95 with fdisk or cfdisk, set the type to 99 (unknown). The partition
table should look as follow:
<TABLE BORDER=1>
<TR>
<TH>OS</TH><TH>dev</TH><TH>Type</TH><TH>active</TH>
</TR>
<TR>
<TD>Linux</TD><TD>/dev/hda1 (1st partition table entry)</TD>
<TD><B>83</B> (Linux)</TD><TD ALIGN=CENTER>no</TD>
</TR>
<TR>
<TD>SWAP</TD><TD>/dev/hda2 (2nd partition table entry)</TD>
<TD><B>82</B> (Linux SWAP)</TD><TD ALIGN=CENTER>no</TD>
</TR>
<TR>
<TD>DOS/Windows</TD><TD>/dev/hda3 (3rd partition table entry)</TD>
<TD><B>06</B> (DOS 16-bit >=32M)</TD><TD ALIGN=CENTER>yes</TD>
</TR>
<TR>
<TD>Windows 95</TD><TD>/dev/hda4 (4th partition table entry)</TD>
<TD><B>99</B> (unknown)</TD><TD ALIGN=CENTER>no</TD>
</TR>
</TABLE>
<P>
2. Boot DOS and use fdisk to write a clean DOS MBR (fdisk /mbr)<P>
3. Boot Linux using a Linux <a href="tips.html#normal">bootdisk</a> (yes you need a bootdisk :-) )<P>
4. Save the DOS MBR (dd if=/dev/hda of=dos.mbr bs=512 count=1)<P>
5. Change the partition table (using fdisk / cfdisk) so that it look as follow:
<TABLE BORDER=1>
<TR>
<TH>OS</TH><TH>dev</TH><TH>Type</TH><TH>active</TH>
</TR>
<TR>
<TD>Linux</TD><TD>/dev/hda1 (1st partition table entry)</TD>
<TD><B>83</B> (Linux)</TD><TD ALIGN=CENTER>no</TD>
</TR>
<TR>
<TD>SWAP</TD><TD>/dev/hda2 (2nd partition table entry)</TD>
<TD><B>82</B> (Linux SWAP)</TD><TD ALIGN=CENTER>no</TD>
</TR>
<TR>
<TD>DOS/Windows</TD><TD>/dev/hda3 (3rd partition table entry)</TD>
<TD><B>99</B> (unknown)</TD><TD ALIGN=CENTER>no</TD>
</TR>
<TR>
<TD>Windows 95</TD><TD>/dev/hda4 (4th partition table entry)</TD>
<TD><B>06</B> (DOS 16-bit >=32M)</TD><TD ALIGN=CENTER>yes</TD>
</TR>
</TABLE>
<P>
6. Install Windows 95 (this will overwrite the DOS MBR with a "Win95 MBR")<P>
7. Boot Linux using a Linux bootdisk <P>
8. Save the WIN95 MBR (dd if=/dev/hda of=win95.mbr bs=512 count=1)<P>
9. Create a Chos configuration file (you may use <A HREF="vchos.html">Visual Chos</A> from me).
Choose <I>bootsect</I> or <I>bootfile</I>, set image to the saved MBR and enable the rewrite
option. The config file should contain the following lines (names may different):
<BLOCKQUOTE><PRE>
bootsect "Windows 95" {
image=/boot/win95.mbr
rewrite=yes
}
bootsect "Dos 6.2" {
image=/boot/dos.mbr
rewrite=yes
}
</PRE></BLOCKQUOTE><P>
10. Install <B>Choose-OS</B>
<P>
Every time you boot DOS or Windows95 the bootsector loader compares the partition type and active
flags of the file loaded (dos.mbr or win95.mbr) with the installed MBR. If the flags are different
they will be changed (only the flags would be changed not the size of the partitions). After the
flags had been changed you hear a "Beep" and the changed MBR is rewritten. If the flags are equal
(e.g. you boot DOS the 10th time) the MBR would not be rewritten.
<P>
If you find Bugs or have a improvement idea feel free to contact me:
<<a href="mailto:flower@Informatik.uni-bremen.de">flower@Informatik.uni-bremen.de</a>>
</BODY>
</HTML>
|