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

2003-12-16 Thread Dorin H

--- Dan Strick <[EMAIL PROTECTED]> wrote:
> On Mon, 1 Dec 2003, Dorin H <[EMAIL PROTECTED]>
> wrote:

> > 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.
> 

The information is there (boot(8)). Thank you for
reminding me that 10 minutes spent reading the whole
man page saves some hours of hair-pulling struggle.

> 
> 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.
> 

I couldn't present it better. And yes, the problem was
due to order of partitions marked as bootable:

BOOTABLE ad0s1  FreeBSD  (not used)
 ad0s2  Debian swap
 ad0s3  Debian /
BOOTABLE ad0s4  FreeBSD  (the operating system)

Trying to boot ad0s1 failed of course.
At the promp:

>> FreeBSD/i386 BOOT
Default: 0:ad(0,a)/kernel
boot:

I did again the experiment:
1. marked ad0s1 as bootable
2. reboot
3. again the promt (from which the slice info is
missing ! that tricked me)

Supplying this solve the booting problem!
 |
vvv
boot: 0:ad(0,4,a)/kernel 

(Still pending: I have to see how can I make it find
the loader.conf also :)  )

> 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.  

Totally new to FreeBSD boot process, so using Debian
LILO felt "safer" at that time.

> 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.

I will try investigate the problem. Though I remember
reading something like this somewhere... I can't find
the source to mention it here.

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

Yes, the workaround is correct. It was the solution.

Thank you for your explanations,
/Dorin.

PS. It is so nice to be able to compile again the
ports stuff on my machine :)
(ad0s1a = /usr/ports, ad0s1d=/usr/src ;) )


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


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

2003-12-02 Thread Dan Strick
On Mon, 1 Dec 2003, Dorin H <[EMAIL PROTECTED]> 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
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


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

2003-12-01 Thread Dorin H
Sorry for replying again, but I succeed to press
"send" while editing the previous reply :((( (press
tab + space -> send, ooops)
I hope I included all the relevant information in my
previous reply.

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.

Thank you again,

/Dorin.

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.


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


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

2003-12-01 Thread Dorin H

> >   The problem was that the new XP partition, not
  ^^^
Oops, mistype: I was talking about the new FreeBSD
partition.

> 
> The second stage FreeBSD boostrap program, "boot2",
> assumes that the the
> slice being booted is the FreeBSD slice with the
> active partition flag
> set or (if no FreeBSD slice has the active partition
> flag) the first
> FreeBSD slice.  If you have two FreeBSD slices on a
> single disk and your
> MBR (master bootstrap record) program does not
> rewrite the MBR with the
> active flag set for the selected slice before it
> runs boot2, either
> because you have disabled that feature with the
> boot0cfg command or
> because you are not using the FreeBSD boot0 MBR
> program, then boot2
> could very easily try to boot the wrong slice.
> 
> If I understand your email, you must have run afoul
> of the fragile
> assumptions made by boot2.  What program were you
> using for the master
> bootstrap?  Do you know which slice had the active
> partition flag?
> 

I am using the Debian lilo in MBR to select which os I
should boot.
Initially was:
ad0s1 XP   * marked as bootable
ad0s2Swap Debian
Debian /
FreeBSD (swap, /)* marked as bootable

Everything was fine. I needed space for FreeBSD, so
went into /stand/sysinstall and delete XP; recreate a
new FreeBSD slice, press W to save it into MBR, forgot
the pesky "bootable" flag, return to FreeBSD, and
before creating any partition in the new FreeBSD
slice, now first, I rebooted.

In MBR I had:

FreeBSD (no slices)  * marked as bootable
Swap Debian
Debian /
FreeBSD (swap, /)* marked as bootable

In this moment, the FreeBSD doesn't boot anymore. From
fixit/live cd, I reset the bootable flag for first
slice and the system booted finely well.
I was hoping that I can specify in the boot2 prompt
the correct partition, on ad0s4

> Dan Strick
> [EMAIL PROTECTED]


__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


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

2003-11-30 Thread Dan Strick
On Sun, 30 Nov 2003, Dorin H <[EMAIL PROTECTED]> wrote:
>>
> Hi there,
>  Hoping that this will help somebody else:
>  Deleting the XP boot partition that came first on
> disk (the FreeBSD was the last) and changing its type
> to FreeBSD FS render my laptop unbootable.
>  I got the prompt when trying to boot FreeBSD:
>
> >> FreeBSD/i386 BOOT
> Default: 0:ad(0,a)/kernel
> boot:
>
>   The problem was that the new XP partition, not yet
> labeled,  was still marked as bootable, as well as the
> real bootable FreeBSD partition.  Flipping that flag
> off repair the problem!
>
>  QUESTION:
>
>  Where I can find an explanation of the syntax for
> previous prompt (boot2 prompt according to handbook) ?
>   All my attempts to redirect the boot to search in
> the correct partition failed.
>   Thanks a lot,
> /Dorin.
>>

The second stage FreeBSD boostrap program, "boot2", assumes that the the
slice being booted is the FreeBSD slice with the active partition flag
set or (if no FreeBSD slice has the active partition flag) the first
FreeBSD slice.  If you have two FreeBSD slices on a single disk and your
MBR (master bootstrap record) program does not rewrite the MBR with the
active flag set for the selected slice before it runs boot2, either
because you have disabled that feature with the boot0cfg command or
because you are not using the FreeBSD boot0 MBR program, then boot2
could very easily try to boot the wrong slice.

If I understand your email, you must have run afoul of the fragile
assumptions made by boot2.  What program were you using for the master
bootstrap?  Do you know which slice had the active partition flag?

Dan Strick
[EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


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

2003-11-30 Thread Dorin H
Hi there,
 Hoping that this will help somebody else:
 Deleting the XP boot partition that came first on
disk (the FreeBSD was the last) and changing its type
to FreeBSD FS render my laptop unbootable.
 I got the prompt when trying to boot FreeBSD:

>> FreeBSD/i386 BOOT
Default: 0:ad(0,a)/kernel
boot:

  The problem was that the new XP partition, not yet
labeled,  was still marked as bootable, as well as the
real bootable FreeBSD partition.  Flipping that flag
off repair the problem!

 QUESTION:
  
 Where I can find an explanation of the syntax for
previous prompt (boot2 prompt according to handbook) ?
  All my attempts to redirect the boot to search in
the correct partition failed.  
  Thanks a lot,
/Dorin.

PS. Please CC me, I am not subscribed to questions
list. Thank you!

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"