Re: Solved [Re: delete first partition XP and reformat as ufs -> kernel not found]

From: Dan Strick (strick_at_covad.net)
Date: 12/02/03

  • Next message: Jean-Baptiste Quenot: "Re: Is non-breaking space a space?"
    Date: Tue, 2 Dec 2003 00:14:15 -0800 (PST)
    To: bj93542@yahoo.com
    
    

    On Mon, 1 Dec 2003, Dorin H <bj93542@yahoo.com> wrote:
    >>
    > To finish, I was wondering if I can specify in boot2
    > prompt which is the correct slice&partition to use for
    > booting.
    >
    > If my assumptions are correct, in expression
    >
    > 0:ad(0,a)/kernel
    > ^ ^ ^ ^ ^
    > | | | | |
    > | | | | - the path inside the partition
    > | | | |
    > | | | - partition in slice
    > | | |
    > | | - ??? is this the slice #, drive # ???
    > | - refers to driver
    > - refers to the disk unit
    >
    > If no RTFM is available, point me to the source files.
    > I am not familiar with the FreeBSD kernel sources, but
    > I'll have no problem reading some code.
    >>

    This may not be exactly correct. See the section 8 man page for boot.
    (i.e. Do "man boot".) The source is in /usr/src/sys/boot/i386.

    >>
    > PS2. Does anybody has a clue why the FreeBSD
    > associates the slice # 2 (i.e. ad0s2) for the PT entry
    > 4?
    > Initially, I had
    > MBR PT:
    > ad0s1 XP
    > - not used, reserved space
    > - not used, reserved space
    > ad0s2 FreeBSD (swap, /)
    >
    > I have installed Debian swap and / in entries 2 and 3,
    > and the FreeBSD associated the (correct) numbers:
    >
    > ad0s1 XP
    > ad0s2 Debian swap
    > ad0s3 Debian /
    > ad0s4 FreeBSD (swap, /)
    > ^^
    >
    > This made the FreeBSD boot process to fail until I
    > "fixit" the /etc/fstab to mount the correct root
    > partition. At that time, I was also unable to specify
    > in boot2 prompt (?) where my / is.
    >
    > My opinion is that if the PT entry # corresponding to
    > the PT entry were used in the first place, this
    > problem will be avoid. Probably this reflects a
    > superficial view, but for a simple HDD configuration
    > this make sense to me. Thanks again for any
    > opinions/suggestions.
    >>

    If I understand this and your previous emails on this subject,
    you began with this MBR partition/slice table arrangement:

            ad0s1 XP
            ad0s2 FreeBSD

    and everything worked fine.
    Then you changed the MBR partitions to:

            ad0s1 XP
            ad0s2 Debian swap
            ad0s3 Debian /
            ad0s4 FreeBSD

    and FreeBSD would not boot correctly because the file /etc/fstab,
    created during the initial FreeBSD installation process, still had
    "/dev/ad0s2" where it now needed to have "/dev/ad0s4" because you
    renumbered its MBR partition. Then you fixed that and everything
    seemed to work fine until you decided to reuse the XP partition
    for more FreeBSD disk space. So you changed your MBR partition
    table to:

            ad0s1 FreeBSD (addtitional file system space)
            ad0s2 Debian swap
            ad0s3 Debian /
            ad0s4 FreeBSD (the operating system)

    and FreeBSD would no longer boot. This might be due to boot1
    confusion. Each partition in the MBR has a flag byte and a type
    byte. The 0x80 bit in the flag byte marks the partition as "active".
    Normally at most one partition has the active bit set.
    A non-interactive MBR bootstrap program typically boots whichever
    partition has the active bit set.

    The FreeBSD boot1 program, the program loaded by the MBR bootstrap,
    is not hardwired with the number of the MBR partition in which it was
    installed (perhaps it ought to be). Instead it uses the first MBR
    partition of FreeBSD type with the active bit set. If no FreeBSD MBR
    partition has the active bit set, the boot1 program chooses the first
    FreeBSD MBR partition. This normally works correctly even if you have
    more than one bootable FreeBSD MBR partition because the FreeBSD boot0
    MBR program normally rewrites the MBR record with the appropriate
    active bit set before it invokes the FreeBSD boot1 program.

    You say that you are using Debian lilo for your MBR bootstrap program
    rather than the FreeBSD boot0 program. I don't know much about lilo,
    but I am guessing that it does not set the active partition in the MBR
    partition table before it boots a partition. Then the boot1 program
    tries to load the boot2 program from ad0s1 instead of ad0s4.

    Workaround: you can make ad0s4 the only active FreeBSD partition with
    the fdisk program. If nothing else changes that, boot1 will correctly
    boot ad0s4.

    Dan Strick
    strick@covad.net
    _______________________________________________
    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"


  • Next message: Jean-Baptiste Quenot: "Re: Is non-breaking space a space?"

    Relevant Pages

    • Re: OT File recovery Software
      ... > I guess some of you never used the fix MBR command? ... > The Master Boot Record will be created when you create the first ... > partition on the hard disk. ... > first sector on the disk. ...
      (alt.med.fibromyalgia)
    • Re: dual boot; Linux, FreeBSD
      ... If I want to set up a dual boot of either Linux or FreeBSD, ... All of those you name will work as an MBR. ... bootable slice on each drive, but could make up to 4. ...
      (freebsd-questions)
    • Re: Mbr messed up?
      ... can't boot up at all after coming out of hibernation. ... Looked at the MBR sector which seems to be ok ... The bootstrap program is in the first 460 ... > program reads the partition table to find out which partition is marked ...
      (microsoft.public.windowsxp.help_and_support)
    • RE: Portcullis Security Advisory 05-011 ACPI 1.6 BIOS
      ... Fdisk /MBR only replaces the boot code within the sector, ... change in any way the Partition Information Block. ... Portcullis Security Advisory 05-011 ACPI 1.6 BIOS ... zeroing out the MBR). ...
      (Bugtraq)
    • Re: Hosed my MBR?
      ... motherboard with two on-board SATA RAID controllers, an Intel MatrixRAID ... The PDC20378 runs two drives in a RAID0 configuration booting FreeBSD ... The problem is, now, when I attempt to boot off the Intel controller, I ... I would think that when I choose to leave the MBR ...
      (freebsd-questions)