old-www/HOWTO/SRM-HOWTO/x661.html

484 lines
9.3 KiB
HTML

<HTML
><HEAD
><TITLE
>Sharing a Disk With DEC Unix</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
REL="HOME"
TITLE="SRM Firmware Howto"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="The aboot Loader"
HREF="aboot.html"><LINK
REL="NEXT"
TITLE="Installation of Distributions"
HREF="x733.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>SRM Firmware Howto</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="aboot.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x733.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="AEN661"
>6. Sharing a Disk With DEC Unix</A
></H1
><P
>Unfortunately, DEC Unix doesn't know anything about Linux, so sharing
a single disk between the two OSes is not entirely trivial. However,
it is not a difficult task if you heed the tips in this section. The
section assumes you are using <TT
CLASS="LITERAL"
>aboot</TT
> version 0.5 or newer.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN665"
>6.1. Partitioning the disk</A
></H2
><P
>First and foremost: <I
CLASS="EMPHASIS"
>never</I
> use any of the Linux partitioning
programs (<TT
CLASS="LITERAL"
>minlabel</TT
> or <TT
CLASS="LITERAL"
>fdisk</TT
>) on a disk that is also
used by DEC Unix. The Linux <TT
CLASS="LITERAL"
>minlabel</TT
> program uses the same
partition table format as DEC Unix <TT
CLASS="LITERAL"
>disklabel</TT
>, but there are
some incompatibilities in the data that <TT
CLASS="LITERAL"
>minlabel</TT
> fills in, so
DEC Unix will simply refuse to accept a partition table generated by
<TT
CLASS="LITERAL"
>minlabel</TT
>. To setup a Linux <TT
CLASS="LITERAL"
>ext2</TT
> partition under DEC
Unix, you'll have to change the disktab entry for your disk. For the
purpose of this discussion, let's assume that you have an rz26 disk (a
common 1GB drive) on which you want to install Linux. The disktab
entry under DEC Unix v3.2 looks like this (see file
<TT
CLASS="LITERAL"
>/etc/disktab</TT
>):
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>rz26|RZ26|DEC RZ26 Winchester:\
:ty=winchester:dt=SCSI:ns#57:nt#14:nc#2570:\
:oa#0:pa#131072:ba#8192:fa#1024:\
:ob#131072:pb#262144:bb#8192:fb#1024:\
:oc#0:pc#2050860:bc#8192:fc#1024:\
:od#393216:pd#552548:bd#8192:fd#1024:\
:oe#945764:pe#552548:be#8192:fe#1024:\
:of#1498312:pf#552548:bf#8192:ff#1024:\
:og#393216:pg#819200:bg#8192:fg#1024:\
:oh#1212416:ph#838444:bh#8192:fh#1024:</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>The interesting fields here are <TT
CLASS="LITERAL"
>o</TT
><I
CLASS="EMPHASIS"
>?</I
>, and
<TT
CLASS="LITERAL"
>p</TT
><I
CLASS="EMPHASIS"
>?</I
>, where <I
CLASS="EMPHASIS"
>?</I
> is a letter in the range
<TT
CLASS="LITERAL"
>a</TT
>-<TT
CLASS="LITERAL"
>h</TT
> (first through 8-th partition). The <TT
CLASS="LITERAL"
>o</TT
>
value gives the starting offset of the partition (in sectors) and the
<TT
CLASS="LITERAL"
>p</TT
> value gives the size of the partition (also in sectors).
See <TT
CLASS="LITERAL"
>disktab(4)</TT
> for more info. Note that DEC Unix likes to
define overlapping partitions. For the entry above, the partition
layout looks like this (you can verify this by adding up the various
<TT
CLASS="LITERAL"
>o</TT
> and <TT
CLASS="LITERAL"
>p</TT
> values):
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
> a b d e f
|---|-------|-----------|-----------|-----------|
c
|-----------------------------------------------|
g h
|-----------------|-----------------|</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>DEC Unix insists that partition <TT
CLASS="LITERAL"
>a</TT
> starts at offset 0 and that
partition <TT
CLASS="LITERAL"
>c</TT
> spans the entire disk. Other than that, you can
setup the partition table any way you like.</P
><P
>Let's suppose you have DEC Unix using partition <TT
CLASS="LITERAL"
>g</TT
> and want to
install Linux on partition <TT
CLASS="LITERAL"
>h</TT
> with partition <TT
CLASS="LITERAL"
>b</TT
> being a
(largish) swap partition. To get this layout without destroying the
existing DEC Unix partition, you need to set the partition types
explicitly. You can do this by adding a <TT
CLASS="LITERAL"
>t</TT
> field for each
partition. In our case, we add the following line to the above
disktab entry.
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
> :ta=unused:tb=swap:tg=4.2BSD:th=resrvd8:</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>Now why do we mark partition <TT
CLASS="LITERAL"
>h</TT
> as "reservd8" instead of "ext2"?
Well, DEC Unix doesn't know about Linux. It so happens that partition
type "ext2" corresponds to a numeric value of 8, and DEC Unix uses the
string "reservd8" for that value. Thus, in DEC Unix speak, "reservd8"
means "ext2". OK, this was the hard part. Now we just need to
install the updated disktab entry on the disk. Let's assume the disk
has SCSI id 5. In this case, we'd do:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
># disklabel -rw /dev/rrz5c rz26</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>You can verify that everything is all right by reading back the
disklabel with <TT
CLASS="LITERAL"
>disklabel -r /dev/rrz5c</TT
>. At this point, you
may want to reboot DEC Unix and make sure the existing DEC Unix
partition is still alive and well. If that is the case, you can shut
down the machine and start with the Linux installation. Be sure to
skip the disk partitioning step during the install. Since we already
installed a good partition table, you should be able to proceed and
select the 8th partition as the Linux root partition and the 2nd
partition as the swap partition. If the disk is, say, the second SCSI
disk in the machine, then the device name for these partitions would
be <TT
CLASS="LITERAL"
>/dev/sdb8</TT
> and <TT
CLASS="LITERAL"
>/dev/sdb2</TT
>, respectively (note that
Linux uses letters to name the drives and numbers to name the
partitions, which is exactly reversed from what DEC Unix does; the
Linux scheme makes more sense, of course ;-).</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN708"
>6.2. Installing <TT
CLASS="LITERAL"
>aboot</TT
></A
></H2
><P
><I
CLASS="EMPHASIS"
>First big caveat</I
>: with the SRM firmware, you can boot one and
only one operating system per disk. For this reason, it is generally
best to have at least two SCSI disks in a machine that you want to
dual-boot between Linux and DEC Unix. Of course, you could also boot
Linux from a floppy if speed doesn't matter or over the network, if
you have a <TT
CLASS="LITERAL"
>bootp</TT
>-capable server. But in this section we assume
you want to boot Linux from a disk that contains one or more DEC Unix
partitions.</P
><P
><I
CLASS="EMPHASIS"
>Second big caveat</I
>: installing <TT
CLASS="LITERAL"
>aboot</TT
> on a disk shared with
DEC Unix renders the first and third partition unusable (since those
<I
CLASS="EMPHASIS"
>must</I
> have a starting offset of 0). For this reason, we recommend
that you change the size of partition <TT
CLASS="LITERAL"
>a</TT
> to something that is just
big enough to hold <TT
CLASS="LITERAL"
>aboot</TT
> (1MB should be plenty).</P
><P
>Once these two caveats are taken care of, installing <TT
CLASS="LITERAL"
>aboot</TT
> is
almost as easy as usual: since partition <TT
CLASS="LITERAL"
>a</TT
> and <TT
CLASS="LITERAL"
>c</TT
> will
overlap with <TT
CLASS="LITERAL"
>aboot</TT
>, we need to tell <TT
CLASS="LITERAL"
>swriteboot</TT
> that this is
indeed OK. We can do this under Linux with a command line of the
following form (again, assuming we're trying to install <TT
CLASS="LITERAL"
>aboot</TT
> on
the second SCSI disk):
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
># swriteboot -f1 -f3 /dev/sdb bootlx</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>The <TT
CLASS="LITERAL"
>-f1</TT
> means that we want to force writing <TT
CLASS="LITERAL"
>bootlx</TT
> even
though it overlaps with partition 1. The corresponding applies for
partition 3.</P
><P
>This is it. You should now be able to shutdown the system and boot
Linux from the harddisk. In our example, the SRM command line to do
this would be:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>&#62;&#62;&#62; boot dka5 -fi 8/vmlinux.gz -fl root=/dev/sdb8</PRE
></TD
></TR
></TABLE
>&#13;</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="aboot.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x733.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>The aboot Loader</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Installation of Distributions</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>