From owner-freebsd-hackers Fri Jan 17 14:28:17 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D5B1937B401 for ; Fri, 17 Jan 2003 14:28:12 -0800 (PST) Received: from lazlo.steam.com (lazlo.steam.com [63.109.7.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 42DD643F65 for ; Fri, 17 Jan 2003 14:28:12 -0800 (PST) (envelope-from cliff@steam.com) Received: from steam.com (root@lazlo.sc.steam.com [192.168.32.2]) by lazlo.steam.com (8.12.6/8.12.6) with ESMTP id h0HMS3C0024615; Fri, 17 Jan 2003 14:28:03 -0800 (PST) (envelope-from cliff@steam.com) Date: Fri, 17 Jan 2003 14:28:03 -0800 Subject: Re: FreeBSD 5-Current/RC en boot0cfg Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) Cc: soekris-tech@lists.soekris.com, freebsd-hackers@FreeBSD.ORG To: Dirk-Willem van Gulik From: Cliff Skolnick In-Reply-To: <20030117204341.E93563-100000@foem.leiden.webweaving.org> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.551) Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Here's the stuff I've been using. The dd in there that zeros stuff seems to help a bit, but still certain cards don't work the first try 100% of the time. Sandisk seems to work 100% of the time for me anyways. Don't forget to set disk to the right disk :) This stuff gets followed by a newfs and tunefs. #!/bin/sh -x disk=ad8 disklabel -W ${disk} dd if=/dev/zero of=/dev/${disk} bs=1k count=10 fdisk -BI ${disk} disklabel -w -B ${disk}s1 auto disklabel ${disk}s1 >/tmp/label.$$ disklabel ${disk}s1 | egrep unused | sed "s/c:/a:/" | sed "s/unused/4.2BSD/" >>/tmp/label.$$ disklabel -R -B ${disk}s1 /tmp/label.$$ rm -f /tmp/label.$$ boot0cfg ${disk} On Friday, Jan 17, 2003, at 12:09 US/Pacific, Dirk-Willem van Gulik wrote: > > In short: A working procedure for making an ATA disk bootable does not > work reliably with CF cards/with a Soekris. > > On FreeBSD with a normal IDE/ATA hard disk the following sequence: > > fdisk -BI ad0 > disklabel -w -B ad0s1 auto > disklabel -e ad0s1 > ... newfs what is needed > boot0cfg -v -B ad0 > > will reliably turn an IDE disk into something bootable (followed after > a > make install-world DESTDIR=..) > > Is this the correct sequence ? > > And though I can boot from CF cards; things are bit hit&miss; and it is > not clear to me exactly what the right procedure is. > > The issue is that I seemingly get random results. And simply re-running > the script or rebooting changes behavour. > > Issues seen are: > > -> Flashcards simply do not want to be 'seen' anymore with > /stand/sysinstall; it will bail out wit no disk detected. > > -> The flashcard show *different results* on successive run > with disklabel after an init iwth > fdisk -BI ad0: > > c: 249824 0 unused 0 0 # (Cyl. 0 - > 247*) > or > c: 249824 0 unsued 1024 8192 16 # (Cyl. 0 - > 247*) > > quite random; with the same card and may change with a reboot. > > Then after a disklabel edit once sees either one of the following > three: > > a: 249824 0 4.2BSD 0 0 # (Cyl. 0 - > 247*) > c: 249824 0 unused 0 0 # (Cyl. 0 - > 247*) > or > a: 249824 0 4.2BSD 1024 8192 16 # (Cyl. 0 - > 247*) > c: 249824 0 unsued 0 0 16 # (Cyl. 0 - > 247*) > or > a: 249824 0 4.2BSD 1024 8192 16 # (Cyl. 0 - > 247*) > c: 249824 0 unsued 1024 8192 16 # (Cyl. 0 - > 247*) > > Again; mixed across cycles and boots. Is there anything in the > new GEOM or BIOS which can be remembered across reboots, including > power cycles. > > Right now the following commands : > > boot soekris diskless > with GENERIC kernel using usual /var and /tmp on mfs. > > setenv TERM vt100 > fdisk -BI ad0 > disklabel -w -B ad0s1 auto > disklabel -e ad0s1 > -> add 'a: 4.2BSD line' > -> remove fsize/bsize > a: 249824 0 4.2BSD > a: 249824 0 untitled > disklabel ad0s1 will output 8 out of 11 times: > a: 249824 0 4.2BSD 1024 8192 16 # (Cyl. 0 - 247*) > c: 249824 0 unsued 0 0 16 # (Cyl. 0 - 247*) > boot0cfg -v -B ad0 > > 9-10 cases will give > > GEOM: new disk ad0 > ar: FreeBSD check1 failed > ad0: ATA-0 disk at ata0-master > ad0: 122MB (250368 sectors), 978 C, 8 H, 32 S, 512 B > ad0: 1 secs/int, 1 depth queue, BIOSPIO > ad0: piomode=1 dmamode=-1 udmamode=-1 cblid=0 > GEOM: Configure ad0s1, start 16384 length 127909888 end 127926271 > GEOM: Add ad0s1 hot[0] start 512 length 276 end 787 > GEOM: Configure ad0s1a, start 0 length 127909888 end 127909887 > GEOM: Configure ad0s1c, start 0 length 127909888 end 127909887 > > Manual root filesystem specification: > : Mount using filesystem > eg. ufs:da0s1a > ? List valid disk boot devices > Abort manual input > > mountroot> ufs:ad0s1a > panic: Root mount failed, startup aborted. > Debugger("panic") > Stopped at Debugger+0x54: xchgl %ebx,in_Debugger.0 > > and sometimes: > > mountroot> ufs:ad0s1a > Mounting root from ufs:ad0s1a > start_init: trying /sbin/init > ..hang... > > and then again, 1 in 50 times it will boot just fine. What am I doing > wrong. How can I make this more reliable ? > > Dw > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message