CompactFlash / new GEOM / boot fails on certain brand / Soekris

Dirk-Willem van Gulik dirkx at webweaving.org
Sat May 3 03:42:23 PDT 2003


Not sure if I am chasing a FreeBSD problem or a deficiency in certain ATA
flash cards which lack, say sector 0, or something.

On 5.0 release - on a soekris.com 4521.

Several essentially identical flash disks brands:

1.	SAMSUNG CF/ATA                          126 Mbyte 	fails
2. 	Hitachi CVM1.1.1                        125 Mbyte	boots
3.	SunDisk					126 Mbyte	boots
4.	PANASONIC/CF				125 Mbyte	boots

with identical content/scripted-preparation method.

All of them boot; except the ones of the SAMSUNG type which the other
gives a 'read error' in the bios on boot:

	comBIOS ver. 1.10  20020603  Copyright (C) 2000-2002 Soekris Engineering.
	Soekris Engineering net4501               CPU 80486 134 Mhz
	0064 Mbyte Memory
	Primary   Master SAMSUNG CF/ATA                          126 Mbyte
	PXE-M00: BootManage UNDI, PXE-2.0 (build 082)
	 1 Seconds to automatic boot.   Press Ctrl-P for entering Monitor.
	Read error

	( or alternatively, at some boots, it will go into PXE boot
	immediately not even  seeing the disk)

The other disk launch into the boot loader fine.

The main issue that the failing type of disk is commonly found in shops in
the Netherlands; and not readily distinguishable from other types/brands.
I.e. the label on the outside says nothing :-(

*All* disks will allow a dd if=/dev/at0 from beginning to end and return
the right data. Suggesting that sector 0.. end is reliably read/writable.
Or is there certain data which gets written to the disk which is NOT
visible that way?

Any suggestions what could cause this ?

->	is this a HW issue / ATA compatibility issue; i.e.
	are some Compact Flash disks fundamentally unbootable
	because the lack something ?

->	is this a BIOS issue ?

->	is this related to the new GEOM work ?

It is very reproducable. Below is the (scripted) process which is used to
create the disk; which as said, functions for virtually all disks except a
few. dd-ing or other operations give -no- soft/hard read or write errors.

	http://wleiden.webweaving.org:8080/svn/node-config/master/install-time/make-cf.sh

or the key lines from the above script:

	dd if=/dev/zero of=/dev/ad0
	fdisk -BI ad0
	disklabel -w -B ad0s1 auto
	disklabel ad0s1 |   egrep unused |  sed "s/c:/a:/" |  sed "s/unused.*/4.2BSD/" > f
	disklabel -R -B ad0s1 f
	boot0cfg -v -B ad0
	newfs /dev/ad0s1a
	tar files

Below are the values extracted from the disk. Apart from cylinder counts
they are identical to other flash disks which function (and which where
created with the same process).

Any thougds ?

Dw


dubbeldrank# fdisk -v ad0
******* Working on device /dev/ad0 *******
parameters extracted from in-core disklabel are:
cylinders=496 heads=16 sectors/track=32 (512 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=496 heads=16 sectors/track=32 (512 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 32, size 253920 (123 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 495/ head 15/ sector 32
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>

dubbeldrank# disklabel -r ad0
disklabel: bad pack magic number (label is damaged, or pack is unlabeled)

dubbeldrank# disklabel -r ad0s1
# /dev/ad0s1c:
type: unknown
disk: amnesiac
label:
flags:
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 16
sectors/cylinder: 512
cylinders: 495
sectors/unit: 253920
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # milliseconds
track-to-track seek: 0  # milliseconds
drivedata: 0

8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   253920       32    4.2BSD     1024  8192 31744   # (Cyl.    0*-
495*)
  c:   253920       32    unused        0     0         # (Cyl.    0*-
495*)
partition a: partition extends past end of unit
partition c: partition extends past end of unit
Warning, partition c doesn't start at 0!
Warning, An incorrect partition c may cause problems for standard system
utilities


dubbeldrank# boot0cfg -v ad0
#   flag     start chs   type       end chs       offset         size
1   0x80      0:  1: 1   0xa5    495: 15:32           32       253920

version=1.0  drive=0x80  mask=0xf  ticks=182
options=nopacket,update,nosetdrv

dubbeldrank# mount /dev/ad0s1a /mnt
dubbeldrank# ls /mnt
.cshrc          bin             dev             proc            tmp




More information about the freebsd-hackers mailing list