Subject: dd ext2 partition kernel panic
To: None <port-cobalt@netbsd.org>
From: Michael Williams <mw@softcentric.com>
List: port-cobalt
Date: 11/09/2000 12:19:22
This is a multi-part message in MIME format.

------=_NextPart_000_0011_01C04A47.4AAF26A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

While installing NetBSD on a Qube 2, I netbooted, then used fdisk to =
create the required ext2 boot partition on a virgin drive. (I also =
created an ffs partition as well.)

Because I don't have physical access to a Linux box, I thought that I =
would 'dd' the newly-created ext2 partition to a file, send that file to =
a Linux machine - use 'mkfs' there - and then send it back to the Qube =
and 'dd' the file back onto the ext2 boot partition.

However, upon attempting the initial 'dd' of the empty ext2 partition, =
the kernel panics and drops into the debugger.

As a workaround, I did a 'dd' from /dev/zero instead - but with a =
smaller size than that of the target partition - in order to get up and =
running...  however, NetBSD won't mount the ext2 partition without =
noticing the descrepency.

Obviously, this is not a showstopper, because there's only =
'/boot/vmlinux.gz' there anyway, and the Qube boots up fine from the =
wrong-sized image, but I'd still like to know why my original plan =
didn't work (and why the kernel panic).

I suspect there are some size/boundary constraints on ext2 partitions of =
which I am unaware.

Here's the output from fdisk and disklabel:


# fdisk
NetBSD disklabel disk geometry:
cylinders: 6253 heads: 16 sectors/track: 63 (1008 sectors/cylinder)

BIOS disk geometry:
cylinders: 6253 heads: 16 sectors/track: 63 (1008 sectors/cylinder)

Partition table:
0: sysid 131 (Linux native)
    start 63, size 10017 (4 MB), flag 0x0
        beg: cylinder    0, head   1, sector  1
        end: cylinder    9, head  15, sector 63
1: sysid 169 (NetBSD)
    start 10080, size 6048000 (2953 MB), flag 0x0
        beg: cylinder   10, head   0, sector  1
        end: cylinder  889, head  15, sector 63
2: <UNUSED>
3: <UNUSED>


# disklabel wd0
# /dev/rwd0d:
type: ESDI
disk: ST33235A
label: system
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 6253
total sectors: 6303024
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#        size   offset     fstype   [fsize bsize   cpg]
  a:  5544000    10080     4.2BSD     1024  8192    16   # (Cyl.   10 - =
5509)
  b:   504000  5554080       swap                        # (Cyl. 5510 - =
6009)
  c:  6048000    10080     unused        0     0         # (Cyl.   10 - =
6009)
  d:  6303024        0     unused        0     0         # (Cyl.    0 - =
6252)
  e:    10017       63 Linux Ext2        0     0         # (Cyl.    0*- =
9)


Here's the command that failed (and caused the kernel panic):

# dd if=3D/dev/wd0e of=3Dwd0e.img  (also tried bs=3D1k and bs=3D512 with =
same bad result)

The kernel error is generated within getblock() [at block 16386]


Here are the commands that worked and allowed me to get up and running:

# dd if=3D/dev/zero of=3Dwd0e.img bs=3D1k count=3D4000
# mkfs -t ext2 wd0e.img (run on linux box)
# dd if=3Dwd0e.img of=3D/dev/wd0e


Of course, any advice would be very much appreciated...

As a side note, I should mention that NetBSD 1.5 ALPHA 2 has been =
rock-solid here.  It is _such_ a pleasure after wrestling with Linux and =
the Cobalt web interface.  Special thanks to Soren and everyone else who =
has contributed to this effort.


Mike Williams


------=_NextPart_000_0011_01C04A47.4AAF26A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>While&nbsp;installing NetBSD on a Qube =
2, I=20
netbooted, then used fdisk to create the required ext2 boot partition on =
a=20
virgin drive. (I also created an ffs partition as well.)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Because I don't have physical access to =
a Linux=20
box, I thought that I would 'dd' the&nbsp;newly-created ext2 partition =
to a=20
file, send that file to a Linux machine - use 'mkfs' there - and then =
send it=20
back to the Qube and 'dd' the file back onto the ext2 boot=20
partition.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>However, upon attempting the initial =
'dd' of the=20
empty ext2 partition, the kernel panics and drops into the=20
debugger.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>As a workaround, I&nbsp;did a&nbsp;'dd' =
from=20
/dev/zero instead - but with a smaller size than that of the target =
partition -=20
in order to get up and running...&nbsp; however, NetBSD won't mount the =
ext2=20
partition without noticing the descrepency.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Obviously, this is not a showstopper, =
because=20
there's only '/boot/vmlinux.gz' there anyway, and the Qube boots up fine =
from=20
the wrong-sized image, but I'd still like to know why my original plan =
didn't=20
work (and why the kernel panic).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I suspect there are some=20
size/boundary&nbsp;constraints on ext2 partitions of which I am=20
unaware.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Here's the output from fdisk and=20
disklabel:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># fdisk<BR>NetBSD disklabel disk=20
geometry:<BR>cylinders: 6253 heads: 16 sectors/track: 63 (1008=20
sectors/cylinder)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>BIOS disk geometry:<BR>cylinders: 6253 =
heads: 16=20
sectors/track: 63 (1008 sectors/cylinder)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Partition table:<BR>0: sysid 131 (Linux =

native)<BR>&nbsp;&nbsp;&nbsp; start 63, size 10017 (4 MB), flag=20
0x0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; beg:=20
cylinder&nbsp;&nbsp;&nbsp; 0, head&nbsp;&nbsp; 1, sector&nbsp;=20
1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end: =
cylinder&nbsp;&nbsp;&nbsp;=20
9, head&nbsp; 15, sector 63<BR>1: sysid 169 =
(NetBSD)<BR>&nbsp;&nbsp;&nbsp; start=20
10080, size 6048000 (2953 MB), flag=20
0x0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; beg: =
cylinder&nbsp;&nbsp; 10,=20
head&nbsp;&nbsp; 0, sector&nbsp; =
1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
end: cylinder&nbsp; 889, head&nbsp; 15, sector 63<BR>2: =
&lt;UNUSED&gt;<BR>3:=20
&lt;UNUSED&gt;<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</DIV></FONT>
<DIV><FONT face=3DArial size=3D2># disklabel wd0<BR># =
/dev/rwd0d:<BR>type:=20
ESDI<BR>disk: ST33235A<BR>label: system<BR>flags:<BR>bytes/sector:=20
512<BR>sectors/track: 63<BR>tracks/cylinder: 16<BR>sectors/cylinder:=20
1008<BR>cylinders: 6253<BR>total sectors: 6303024<BR>rpm: =
3600<BR>interleave:=20
1<BR>trackskew: 0<BR>cylinderskew: 0<BR>headswitch:=20
0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #=20
microseconds<BR>track-to-track seek: 0&nbsp; # =
microseconds<BR>drivedata:=20
0</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=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;&nbsp; 0 -=20
6252)<BR>&nbsp; e:&nbsp;&nbsp;&nbsp; =
10017&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
63 Linux Ext2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
0&nbsp;&nbsp;&nbsp;&nbsp; =
0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #=20
(Cyl.&nbsp;&nbsp;&nbsp; 0*- 9)<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Here's the command that failed (and =
caused the=20
kernel panic):</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># dd if=3D/dev/wd0e of=3Dwd0e.img&nbsp; =
(also tried=20
bs=3D1k and bs=3D512 with same bad result)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The kernel error is generated within =
getblock() [at=20
block 16386]</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Here are&nbsp;the commands that worked =
and allowed=20
me to get up and running:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># dd if=3D/dev/zero of=3Dwd0e.img =
bs=3D1k=20
count=3D4000</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># mkfs -t ext2 wd0e.img (run on linux=20
box)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2># dd if=3Dwd0e.img =
of=3D/dev/wd0e</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Of course, any advice would be very =
much=20
appreciated...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>As a side note, I should mention that =
NetBSD 1.5=20
ALPHA 2 has been rock-solid here.&nbsp; It is _such_ a pleasure after =
wrestling=20
with Linux and the Cobalt web interface.&nbsp; Special thanks to Soren =
and=20
everyone else who has contributed to this effort.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Mike Williams</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</DIV></FONT></BODY></HTML>

------=_NextPart_000_0011_01C04A47.4AAF26A0--