From owner-freebsd-stable@FreeBSD.ORG Sat Feb 25 17:19:09 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2557106564A for ; Sat, 25 Feb 2012 17:19:09 +0000 (UTC) (envelope-from bennett@cs.niu.edu) Received: from mp.cs.niu.edu (mp.cs.niu.edu [131.156.145.41]) by mx1.freebsd.org (Postfix) with ESMTP id AC3078FC0C for ; Sat, 25 Feb 2012 17:19:09 +0000 (UTC) Received: from mp.cs.niu.edu (bennett@localhost [127.0.0.1]) by mp.cs.niu.edu (8.14.3/8.14.3) with ESMTP id q1PHHeGC024465; Sat, 25 Feb 2012 11:17:40 -0600 (CST) Date: Sat, 25 Feb 2012 11:17:40 -0600 (CST) From: Scott Bennett Message-Id: <201202251717.q1PHHeXD024464@mp.cs.niu.edu> To: Kevin Oberman Cc: Erich Dollansky , freebsd-stable@freebsd.org Subject: Re: random problem with 8.3 from yesterday X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2012 17:19:10 -0000 On Sat, 25 Feb 2012 08:56:24 -0800 Kevin Oberman wrote: >On Sat, Feb 25, 2012 at 2:27 AM, Scott Bennett wrote: >> =A0 =A0 On Wed, 22 Feb 2012 13:34:36 +0700 Erich Dollansky >> wrote: >> >>>I got a new thumb drive which was FAT formatted. I use this script to cha= >nge this: >>> >>>!/bin/tcsh >>># >>># This script format a thumb drive connected to USB as da0. >>># >>>printf "You have to run this script as 'root' to succeed.\n" >>>printf "Warning this script will delete all your data from /dev/da0. Cont= >inue? > " >>>set Eingabe =3D $< >>>if ("$Eingabe" =3D=3D "y") then >>> =A0 printf "\nDeleting the device " >>> =A0 dd if=3D/dev/zero of=3D/dev/da0 bs=3D1k count=3D1 >>> =A0 printf "\nWriting the BSD label " >>> =A0 bsdlabel -Bw da0 auto >> >> =A0 =A0 Hmmm...so no MBR and no GPT either? =A0Just the bare device? =A0I= > guess >> I haven't tried that, so I don't know what that would do. > >Call me a bit confused, but I thought -B did write an MBR. It always >has seemed to do so for me, at any rate. From man bsdlabel: >"Installing Bootstraps > If the -B option is specified, bootstrap code will be read from the fi= >le > /boot/boot and written to the disk." >Or am I not understanding something? I guess I understand the part that you quoted above as meaning that the bootstrap code would be copied to the bootstrap sectors. However, as I interpret it, the bsdlabel command does not write a MBR, which would include the slice map for the device. Further, Erich's later commands did not specify a slice number. In short, it looks to me as though he may have ended up with the initial boot code where it belonged at the start of the device, but the boot code looks for the slice map, which isn't there, so it should not be possible to boot a kernel because the bootstrap code would not be able to find it. But as far as simply mounting a file system, I really don't know whether it should work to have a BSD label written to a bare device with neither a MBR nor a GPT to find that label. IOW, would the device node to be used in the mount operation have been created? Note to Erich: did you look in /dev and /dev/ufs to see whether all of the device files that you expected to be there were, in fact, present before you attempted the mount? Scott Bennett, Comm. ASMELG, CFIAG ********************************************************************** * Internet: bennett at cs.niu.edu * *--------------------------------------------------------------------* * "A well regulated and disciplined militia, is at all times a good * * objection to the introduction of that bane of all free governments * * -- a standing army." * * -- Gov. John Hancock, New York Journal, 28 January 1790 * **********************************************************************