random problem with 8.3 from yesterday

Scott Bennett bennett at cs.niu.edu
Sat Feb 25 17:19:10 UTC 2012

     On Sat, 25 Feb 2012 08:56:24 -0800 Kevin Oberman <kob6558 at gmail.com>
>On Sat, Feb 25, 2012 at 2:27 AM, Scott Bennett <bennett at cs.niu.edu> wrote:
>> =A0 =A0 On Wed, 22 Feb 2012 13:34:36 +0700 Erich Dollansky
>> <erich at alogreentechnologies.com> wrote:
>>>I got a new thumb drive which was FAT formatted. I use this script to cha=
>nge this:
>>># 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=
>     /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         *

More information about the freebsd-stable mailing list