Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Apr 1997 19:18:58 -0500 (CDT)
From:      Jim Bryant <jbryant@argus>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: optical drives
Message-ID:  <199704180019.TAA16768@argus>
In-Reply-To: <199704171722.DAA06579@godzilla.zeta.org.au> from "Bruce Evans" at Apr 18, 97 03:22:08 am

next in thread | previous in thread | raw e-mail | index | archive | help
In reply:
> [This should be discussed in a technical mailing list, not -hackers.]
> 
> >od_open() calls dsopen() calls dsinit() which calls check_part().
> >
> >eventhough dsinit() has a label with the correct geometery, it is
> >looking to verify the geometry by checking the DOS partitions,
> >but optial drives don't have partitions (?) and we get 0 for the value
> >of the sector per cylinder. check_part() does not check to see if the
> >secpercyl is zero before doing an integer divide. This zero value
> >for secpercyl causes the panic.
> 
> You are probably supposed to write a partition table.  Otherwise, garbage
> may be interpreted as a good partition table with wrong offsets and
> and data at wrong offsets may be written to.  A panic is better.  It
> takes special garbage to produce the divide by zero error:
> 
> - there must be a boot signature 0x55, 0xaa at the end of the MBR
> - all of the bits in the places that are interpreted as ending sector
>   numbers must be 0 (this gives max_nsectors == 0 and secpercyl == 0)
> - some of the bits in the places that are interpreted as starting
>   sector, head or cylinder numbers must be nonzero (otherwise,
>   check_part() is not called).  This is unusual when the previous 2
>   conditions are met, so the panic is unusual.
> 
> Fix: treat the max_nsectors == 0 case as an error.
> 
> >The optical drive did not work with the DOS fdisk. I do not know if this
> >means optical media act like diskettes and do not have DOS partitions or
> >fdisk is brain dead.
> 
> A partition is just data.  Even vn disks can have partitions in FreeBSD.

under dog, use the adaptec afdisk utility [assuming you have adaptec]...

> >Jim Bryant <jbryant@argus> showed that his optical acts like a drive:
> >
> >> (ahc0:1:0): "IBM MTA-3230TC2210!B 0" type 0 removable SCSI 2
> >> sd1(ahc0:1:0): Direct-Access 217MB (446325 512 byte sectors)
> >> sd1(ahc0:1:0): with 17934 cyls, 1 heads, and an average 24 sectors/track
> 
> A very tall drive :-).

well, it jives with the IBM MTA3230 manual [which is harder to find than
chicken lips]...

the easiest way to get a magneto-optical working is to simply jumper
it as a type 0 removable...  the geometry above is what worked after
many experiments...  this just uses the straight scsi driver...  no
od0 is required...  this is how i prep the disks 230M and 128M [128M
disktab entry follows at end]:

------------------------------------------------------------------------
-rwx------   1 root  wheel    335 Jun  6  1996 mkmo230
------------------------------------------------------------------------

#!/bin/tcsh
echo ""
echo -n $0": writing partition table..."
fdisk -i /dev/rsd1c <<EOF >& /dev/null
y
17934
64
32
y
y
165
32
444384
y
0
1
1
216
63
32
y
y
0
0
0
y
0
0
0
0
0
0
y
y
0
0
0
y
0
0
0
0
0
0
y
y
0
0
0
y
0
0
0
0
0
0
y
y
0
y
y
EOF
echo "done."
sleep 2
echo -n $0": writing disk label..."
disklabel -rw /dev/sd1s1 mo230 >& /dev/null
echo "done."
sleep 2
echo -n $0": laying filesystem..."
newfs /dev/sd1s1a >& /dev/null
echo "done."
echo ""

------------------------------------------------------------------------
-rwx------   1 root  wheel    335 Sep 21  1996 mkmo128
------------------------------------------------------------------------

#!/bin/tcsh
echo ""
echo -n $0": writing partition table..."
fdisk -i /dev/rsd1c <<EOF >& /dev/null
y
9994
64
32
y
y
165
32
247776
y
0
1
1
216
63
32
y
y
0
0
0
y
0
0
0
0
0
0
y
y
0
0
0
y
0
0
0
0
0
0
y
y
0
0
0
y
0
0
0
0
0
0
y
y
0
y
y
EOF
echo "done."
sleep 2
echo -n $0": writing disk label..."
disklabel -rw /dev/sd1s1 mo128 >& /dev/null
echo "done."
sleep 2
echo -n $0": laying filesystem..."
newfs /dev/sd1s1a >& /dev/null
echo "done."
echo ""

------------------------------------------------------------------------
-rw-r--r--  1 root  wheel  5613 Sep 21  1996 disktab
------------------------------------------------------------------------

mo230|IBM MTA-3230 with 230 Meg 3.5inch Magneto-Optical:\
        :ty=removeable:dt=SCSI:rm#3600:\
        :se#512:nt#64:ns#32:nc#216:sc#2048:su#444384:\
        :pa#444384:oa#0:ba#4096:fa#0:ta=4.2BSD:\
        :pc#444384:oc#0:

mo128|IBM MTA-3230 with 128 Meg 3.5inch Magneto-Optical:\
        :ty=removeable:dt=SCSI:rm#3600:\
        :se#512:nt#64:ns#32:nc#121:sc#2048:su#247776:\
        :pa#247776:oa#0:ba#4096:fa#0:ta=4.2BSD:\
        :pc#247776:oc#0:

assuming you have a 230M/128M magneto-optical, this [minor tweaking
may be required if you are not using an IBM MTA3230, such as a
Fujitsu] should get you running..

jim
-- 
All opinions expressed are mine, if you   | "I will not be pushed, stamped,
think otherwise, then go jump into turbid | briefed, debriefed, indexed, or
radioactive waters and yell WAHOO !!!     | numbered!" - #1, "The Prisoner"
 jbryant@tfs.net - KC5VDJ 2M, 70cm, KPC-3+ - kc5vdj@wv0t.#neks.ks.usa.noam



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704180019.TAA16768>