From owner-freebsd-questions@FreeBSD.ORG Sat Jun 2 22:13:14 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 701E516A41F for ; Sat, 2 Jun 2007 22:13:14 +0000 (UTC) (envelope-from mr.hyro@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.185]) by mx1.freebsd.org (Postfix) with ESMTP id DC29C13C455 for ; Sat, 2 Jun 2007 22:13:13 +0000 (UTC) (envelope-from mr.hyro@gmail.com) Received: by mu-out-0910.google.com with SMTP id w9so983577mue for ; Sat, 02 Jun 2007 15:13:12 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=shxAjw2ucstoH1+qI/PIgTx5UICne8PCprAYf0aAQxptYm4pb5pWCLnEfZ8OzZhNvZ4E/1Xldyti++iyVUzFvWlqJRigug3WXi/csRiIopUXmUKJKIFsjOJrGvFRkk9yHwfosNywmriPtmVoGccBOaTJ23vjM+5z10SiOCsclYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nkQbmohYYMBXm6nGgxVm3doZe30CLYKXvG1a56M9+DZz7KYP0oxCqR1trW1sKySzj6QFyVjgb/gAPDrRn2f68tddupNTKbXp75FeVJrUw8TFO8f5HoPGD4asHhqwxuikTYrlQPqMRyRIR1cA/xIen9bnfNaTgzc0KvhtRt9mpJ4= Received: by 10.82.178.11 with SMTP id a11mr3888729buf.1180822391179; Sat, 02 Jun 2007 15:13:11 -0700 (PDT) Received: by 10.82.191.1 with HTTP; Sat, 2 Jun 2007 15:13:11 -0700 (PDT) Message-ID: <24393ae80706021513x49c1bd8ehd7d0a360f0d89e71@mail.gmail.com> Date: Sat, 2 Jun 2007 18:13:11 -0400 From: "Andrey Shuvikov" To: freebsd-questions@freebsd.org In-Reply-To: <440897.18155.qm@web57405.mail.re1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <440897.18155.qm@web57405.mail.re1.yahoo.com> Subject: Re: GRUB / boot easy problems w / USB stick X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2007 22:13:14 -0000 On 6/2/07, Fred Davidson wrote: > ******************************************************** > I am looking for some help to enable booting from a > USB stick. After weeks of reading, and > attempting I am at a total loss. This all began while > I was trying to follow the many excellent tutorials on > encrypting whole laptop disks with GELI[1]. These > tutorials were great except they didn't really cover > how to make the sticks bootable. Here is some of the > many things I have tried. > > Background: My laptop BIOS allows me to pick the boot > order from 7 devices, I set them as follows: > > (1) USB Key (2) USB HDD (3) USB CDROM (4) USB FDC > (5) IDE CD (6) IDE HDD (7) PCI BEV > > Attempt 1: FreeBSD Boot Manager > > # created a dedicated slice on my 512MB stick with a > #UFS2 filesystem. > > (after fdisk) > bsdlabel -Brw /dev/da0s1 > newfs /dev/da0s1 > > # Copied over boot files to usb filesystem. > > mount /dev/da0s1 /usb > mkdir /usb/boot > cd /boot > cp -Rpv * /usb/boot > > # Placed FreeBSD boot manager on MBR of USB stick. > > boot0cfg -B -s 1 -t -v 182 /dev/da0 > > Problem: When I reboot the laptop keyboard won't > allow me to select a partition with the F keys. > > > Attempt 2: GRUB > > # make install grub from the ports collection. copy > #over the files from > #/usr/local/share/grub/i386-freebsd/* to /boot/grub. > #My understanding was that Grub can read write UFS2 > #because of patches since version 0.94. So on my > first #attempt I made a single UFS2 partition. > > mount /dev/da0s1 /usb > mkdir -p /usb/boot/grub > cd /boot > cp -Rpv * /usb/boot > cd /boot/grub > cp -Rpv * /usb/boot/grub > > > #I invoke the grub shell. There are two devices in my > #device map: > > (hd0) /dev/ad0 > (hd1) /dev/da0 > > # Now if I try to set root in the following ways I'll > #get the following: > > grub> root (hd0,0,a) > > Filesystem type is ufs2, partition type 0xa5 > > grub> root (hd1,0) > > Filesystem type is unknown, partition type 0xa5 > > # now before you say it, I also tried (hd1,0,a) but > #this is even worse in some situations. Basically I > #can't get grub to read or write to the USB stick with > #a UFS2 filesystem. Yet it will read write to the > #UFS2 filesystem of the native disk. Does anyone know > #why? I have tried grub-install which apparently is > #successful, but once I attempt to reboot, it hangs > #with the word, "GRUB" printed. > > Attempt 3: Chainloading GRUB > > #This time I though I had it. I created S1 FAT > #partition and S2 UFS2 partition on the stick. I > # was able to use setup from the grub shell to setup > #the FAT slice as the location for stage2. On the > #ufs2 partition I set up the proper /boot setup above. > #I read on an old post and someone mentioned that > #boot2 does "something stupid," and won't work with a > #chainload scenario. I tried it anyways, and it > didn't #work. I had heard that it might work if you > bounce > #boot0 to the beginning of the slice instead of the > #disk MBR so I did. > > boot0cfg -B -s 2 -t 182 -v /dev/da0s2 > > #seemed to go well. I rebooted, and got as far as > #the F key menu, but again nothing worked, and I > #couldn't boot. Just to add, I also tried the whole > booting FreeBSD from a FAT partition but that just > plain doesn't work [2]. > > Well that's where I am. I can't tell you how much you > will rock my world if you can show me how to fix this. > These are some ideas I have, but don't know enough to > do anything about: > > (1) BIOS issues; from what I understand each computer > manufacturer takes a base bios (phoenix in my case) > and proprietories it up. I'm dreading that maybe my > > BIOS will prevent any of this from working. Doesn't > seem to be documentation anywhere on my manufac's > site. > > (2) Bootblocks; Maybe there's some easy modifications > or config files for boot blocks I don't know about? > Maybe there are some alternatives? > > (3) GRUB patches; I've been downloading ports from > another PC (no network yet)burning to CD, then > making. done it twice now. Is there some wonderful > patch to GRUB that makes it work with FreeBSD I don't > know about? Do any of you have it working? if so , > can I copy how you built exactly? > > Alright, that's all. I'm sorry for the length of this > post, it's my first one, and I have seriously dredged > pretty hard on my own for a solution. Thanks again. > > Fred > > > > > > > > > [1] > > > > > > [2] > > > > > > ____________________________________________________________________________________ > Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. > http://mobile.yahoo.com/go?refer=1GNXIC > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > Some thoughts: 1. bsdlabel -Brw /dev/da0s1 - What is the option "r"? - bsdlabel is supposed to create standard label which probably means creating da0s1a partition (can you call "bsdlabel /dev/da0s1" to see what was created?) So your next command should be "newfs /dev/da0s1a" rather than "newfs /dev/da0s1". And commands after that will need to be adjusted as well. 2. boot0cfg -B -s 1 -t -v 182 /dev/da0 It should be "-v -t 182" rather than "-t -v 182". Not sure if it matters though. Hope this helps. Andrey