Re: Boot Loader Issue

2013-06-24 Thread Warren Block

On Sun, 23 Jun 2013, Doug Hardie wrote:



On 23 June 2013, at 20:39, Warren Block wbl...@wonkity.com wrote:


On Sun, 23 Jun 2013, Doug Hardie wrote:


I had to convert a system from GPT to MBR.  All went fine till I tried to 
reboot the system.  It gets to mountroot and dies trying to mount from 
ufs:/dev/ada0p2.  That won't work.


The loader should be getting that information from /etc/fstab.  Have the 
entries there been changed?


That was the problem.  The system used GPT before and I can't believe I forgot 
to update fstab.  That was a really dumb mistake.


Not really, the only reason it occurred to me was because I've forgotten 
to do it many, many times.


As Polytropon points out, labels can help avoid the problem.  In this 
case, it would have had to be a UFS label on the filesystem:


http://www.wonkity.com/~wblock/docs/html/labels.html
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Boot Loader Issue

2013-06-23 Thread Doug Hardie
I had to convert a system from GPT to MBR.  All went fine till I tried to 
reboot the system.  It gets to mountroot and dies trying to mount from 
ufs:/dev/ada0p2.  That won't work.  If I enter ufs:/dev/ada0s1a then the system 
boots fine and runs.  I need to alter mountroot so it tries the right 
partition/slice.  How do I do that?  I couldn't find anything in the handbook 
on that.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Boot Loader Issue

2013-06-23 Thread Polytropon
On Sun, 23 Jun 2013 15:47:53 -0700, Doug Hardie wrote:
 I need to alter mountroot so it tries the right partition/slice. 
 How do I do that?  I couldn't find anything in the handbook on that.

You need to install the GPT boot code, e. g.

# gpart add -t freebsd-boot -l gpboot -b 40 -s 512K ad0
# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ad0

See http://www.wonkity.com/~wblock/docs/html/disksetup.html for
details.

-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Boot Loader Issue

2013-06-23 Thread Michael Sierchio
On Sun, Jun 23, 2013 at 4:12 PM, Polytropon free...@edvax.de wrote:
 On Sun, 23 Jun 2013 15:47:53 -0700, Doug Hardie wrote:
 I need to alter mountroot so it tries the right partition/slice.
 How do I do that?  I couldn't find anything in the handbook on that.

 You need to install the GPT boot code, e. g.

 # gpart add -t freebsd-boot -l gpboot -b 40 -s 512K ad0

Why the offset?  Why 512k?

 # gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ad0

I think it's simpler to make an entry in /boot/loader.conf:

vfs.root.mountfrom=ufs:/dev/ada0s1a
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Boot Loader Issue

2013-06-23 Thread Warren Block

On Sun, 23 Jun 2013, Doug Hardie wrote:

I had to convert a system from GPT to MBR.  All went fine till I tried 
to reboot the system.  It gets to mountroot and dies trying to mount 
from ufs:/dev/ada0p2.  That won't work.


The loader should be getting that information from /etc/fstab.  Have the 
entries there been changed?


If I enter ufs:/dev/ada0s1a then the system boots fine and runs.  I 
need to alter mountroot so it tries the right partition/slice.  How do 
I do that?  I couldn't find anything in the handbook on that.


http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot-blocks.html 
has some information.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Boot Loader Issue

2013-06-23 Thread Warren Block

On Mon, 24 Jun 2013, Polytropon wrote:


On Sun, 23 Jun 2013 15:47:53 -0700, Doug Hardie wrote:

I need to alter mountroot so it tries the right partition/slice.
How do I do that?  I couldn't find anything in the handbook on that.


You need to install the GPT boot code, e. g.

# gpart add -t freebsd-boot -l gpboot -b 40 -s 512K ad0
# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ad0

See http://www.wonkity.com/~wblock/docs/html/disksetup.html for
details.


That is GPT bootcode, but he was switching to MBR.  That is documented 
in the second half of the link.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Boot Loader Issue

2013-06-23 Thread Warren Block

On Sun, 23 Jun 2013, Michael Sierchio wrote:


On Sun, Jun 23, 2013 at 4:12 PM, Polytropon free...@edvax.de wrote:

On Sun, 23 Jun 2013 15:47:53 -0700, Doug Hardie wrote:

I need to alter mountroot so it tries the right partition/slice.
How do I do that?  I couldn't find anything in the handbook on that.


You need to install the GPT boot code, e. g.

# gpart add -t freebsd-boot -l gpboot -b 40 -s 512K ad0


Why the offset?  Why 512k?


Block 40 is the first 4K-aligned block after the 32 blocks occupied by 
the GPT.  It won't hurt anything if the drive is not a 4K Advanced 
Format drive, won't really make a big difference if it is since 
bootcode is not really disk I/O-limited.  Just good practice to keep 
everything aligned.


512K is the largest size of bootcode that will work.  The loader loads 
the whole partition regardless of how large the bootcode is, and will 
fail with larger sizes.  It's no loss of space because the first UFS 
partition will start at 1M.  Why 1M?  Because it's an unofficial 
standard, and aligned with 4K, 8K, 128K, and so on.


This article talks about it a bit more:
http://www.wonkity.com/~wblock/docs/html/ssd.html


# gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ad0


I think it's simpler to make an entry in /boot/loader.conf:

vfs.root.mountfrom=ufs:/dev/ada0s1a


These are different things.  The command is for a GPT disk, and the boot 
device being set is for MBR.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Boot Loader Issue

2013-06-23 Thread Doug Hardie

On 23 June 2013, at 20:39, Warren Block wbl...@wonkity.com wrote:

 On Sun, 23 Jun 2013, Doug Hardie wrote:
 
 I had to convert a system from GPT to MBR.  All went fine till I tried to 
 reboot the system.  It gets to mountroot and dies trying to mount from 
 ufs:/dev/ada0p2.  That won't work.
 
 The loader should be getting that information from /etc/fstab.  Have the 
 entries there been changed?

That was the problem.  The system used GPT before and I can't believe I forgot 
to update fstab.  That was a really dumb mistake.  Thanks very much.

 
 If I enter ufs:/dev/ada0s1a then the system boots fine and runs.  I need to 
 alter mountroot so it tries the right partition/slice.  How do I do that?  I 
 couldn't find anything in the handbook on that.
 
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/boot-blocks.html 
 has some information.
 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Boot Loader Issue

2013-06-23 Thread Polytropon
On Sun, 23 Jun 2013 21:35:20 -0700, Doug Hardie wrote:
 
 On 23 June 2013, at 20:39, Warren Block wbl...@wonkity.com wrote:
  The loader should be getting that information from /etc/fstab.  Have the 
  entries there been changed?
 
 That was the problem.  The system used GPT before and I can't
 believe I forgot to update fstab.  That was a really dumb
 mistake.  Thanks very much.

If you can use labels instead of device names, this problem
can be avoided. :-)





-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org