Date: Fri, 17 Jan 2003 14:28:03 -0800 From: Cliff Skolnick <cliff@steam.com> To: Dirk-Willem van Gulik <dirkx@webweaving.org> Cc: soekris-tech@lists.soekris.com, freebsd-hackers@FreeBSD.ORG Subject: Re: FreeBSD 5-Current/RC en boot0cfg Message-ID: <F1144BFA-2A6A-11D7-A9B4-000393863EA2@steam.com> In-Reply-To: <20030117204341.E93563-100000@foem.leiden.webweaving.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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: <Hitachi CVM1.1.1/Rev 1.01> 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: > <fstype>:<device> Mount <device> using filesystem <fstype> > eg. ufs:da0s1a > ? List valid disk boot devices > <empty line> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F1144BFA-2A6A-11D7-A9B4-000393863EA2>