From owner-freebsd-current Sun Aug 1 7:21: 0 1999 Delivered-To: freebsd-current@freebsd.org Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.40.131]) by hub.freebsd.org (Postfix) with ESMTP id 6517114CAC for ; Sun, 1 Aug 1999 07:20:56 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.9.3/8.9.2) with ESMTP id QAA19810 for ; Sun, 1 Aug 1999 16:19:53 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: current@freebsd.org Subject: junior-hacker task: "prepdisk" From: Poul-Henning Kamp Date: Sun, 01 Aug 1999 16:19:52 +0200 Message-ID: <19808.933517192@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG It seems that our new boot blocks doesn't like the taste of disks prepared according to the meagre information we have in the handbook. The following script seems to DTRT for me, and should really be either integrated into a "fdisk -A" flag or maybe as a stand alone script. Either way: manpage & handbook needs updated too. It will not make it to the top of my todo list in this geological period, so if somebody wants to pick up here I think a lot of people will come to appreciate it... Poul-Henning #!/bin/sh dev=fla0 grep "$dev.*sectors" /var/run/dmesg | tr -d '(:)' | awk ' { v = $3 c = $5 h = $7 s = $9 ss = c * h * s - s print "#",$0 > "_" print "g c"c" h"h" s"s > "_" print "p 1 165",s,ss > "_" print "a 1" > "_" print "#",$0 > "__" print "type: ESDI" > "__" print "disk:", $1 > "__" print "label:" > "__" print "flags:" > "__" print "bytes/sector: 512" > "__" print "sectors/track:", s > "__" print "tracks/cylinder:", h > "__" print "sectors/cylinder:", s * h > "__" print "cylinders:", c > "__" print "sectors/unit:", ss > "__" print "rpm: 3600" > "__" print "interleave: 1" > "__" print "trackskew: 0" > "__" print "cylinderskew: 0" > "__" print "headswitch: 0 # milliseconds" > "__" print "track-to-track seek: 0 # milliseconds" > "__" print "drivedata: 0 " > "__" print "8 partitions:" > "__" print "# size offset fstype [fsize bsize bps/cpg]" > "__" print "a:",ss,"0 4.2BSD 512 4096 " > "__" print "c:",ss,"0 unused 0 0" > "__" } ' fdisk -f _ -i -v $dev disklabel -BrR ${dev} __ newfs /dev/r${dev}a -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." FreeBSD -- It will take a long time before progress goes too far! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message