Re: [PATCH] Improve documentation of BIOS installation

2011-04-12 Thread Colin Watson
On Thu, Mar 31, 2011 at 09:38:37AM +0100, Barry Jackson wrote:
 I was being a bit dim - or maybe it was late.
 I had not grasped the concept of the 'normal' command which was not
 included in the list of available commands.

Good point.  I've added brief documentation for this now.

  http://www.gnu.org/software/grub/manual/grub.html#normal

-- 
Colin Watson   [cjwat...@ubuntu.com]

___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Improve documentation of BIOS installation

2011-03-31 Thread Barry Jackson

On 30/03/11 20:52, Colin Watson wrote:

On Wed, Mar 30, 2011 at 08:00:46PM +0100, Barry Jackson wrote:

On 29/03/11 13:40, Colin Watson wrote:

With http://grub.enbug.org/BIOS_Boot_Partition being down at the moment,
I went to look at what corresponding documentation there was in the
manual.


One question that I cannot find an answer for in the manual here :-
18.1 GRUB only offers a rescue shell
It explains that the only available commands are ls, set, unset and insmod.
So what use is it?
Assuming that a module is missing or a variable is incorrect, and
these are corrected with insmod and set - what next?
I can see no way to boot after correcting things without a 'boot'
command available. If you can't boot, why bother with set or insmod.
I just don't get it!


The manual even answers this question directly with an example:

   
http://www.gnu.org/software/grub/manual/grub.html#GRUB-only-offers-a-rescue-shell

See the example after then you can correct this and enter normal mode
manually.

(Once you are in normal mode with a correct prefix, then commands will
be autoloaded, although you could insmod them manually if you really
wanted.  But this should be self-explanatory once you do it, as entering
normal mode will give you a GRUB menu.)

I've extended the text you refer to
(http://www.gnu.org/software/grub/manual/grub.html#Commands) to link to
this troubleshooting section.  It'll be there the next time we push to
the website.

Regards,



Thanks Colin,
I was being a bit dim - or maybe it was late.
I had not grasped the concept of the 'normal' command which was not 
included in the list of available commands.


It's much clearer now.

Maybe next time I'm hit with a rescue shell I may just be able to boot 
from it ;-)


Barry

___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Improve documentation of BIOS installation

2011-03-30 Thread Pádraig Brady
On 29/03/11 16:12, Colin Watson wrote:
 On Tue, Mar 29, 2011 at 02:11:45PM +0100, Pádraig Brady wrote:
 On 29/03/11 13:40, Colin Watson wrote:
 +(called by
 +various names, such as the boot track, MBR gap, or embedding area, 
 and
 +which is usually at least 31 KiB),

 Maybe mention the original name/reason; DOS compatibility region
 
 Vladimir's reaction was that a casual reader might think Huh?  What
 does this have to do with compatibility.  Do you have a reference for
 this being the original name?

No. I was basing this on terminology used in fdisk docs,
and on the original reason for the presence of this gap.
The compatibility refers to DOS being compatible with the disk layout,
as detailed at the link below.

 I'll link to this node from http://www.pixelbeat.org/docs/disk/
 when it appears on line.
 
   http://www.gnu.org/software/grub/manual/grub.html#BIOS-installation
 
 You might like to link to (or contribute to!)
 http://www.gnu.org/software/grub/manual/grub.html#Images as well, in the
 context of your document.

I'll add both links.

cheers!
Pádraig.

___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Improve documentation of BIOS installation

2011-03-30 Thread Barry Jackson

On 29/03/11 13:40, Colin Watson wrote:

With http://grub.enbug.org/BIOS_Boot_Partition being down at the moment,
I went to look at what corresponding documentation there was in the
manual.


One question that I cannot find an answer for in the manual here :-
18.1 GRUB only offers a rescue shell
It explains that the only available commands are ls, set, unset and insmod.
So what use is it?
Assuming that a module is missing or a variable is incorrect, and these 
are corrected with insmod and set - what next?
I can see no way to boot after correcting things without a 'boot' 
command available. If you can't boot, why bother with set or insmod.

I just don't get it!




___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Improve documentation of BIOS installation

2011-03-30 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 30.03.2011 21:00, Barry Jackson wrote:
 On 29/03/11 13:40, Colin Watson wrote:
 With http://grub.enbug.org/BIOS_Boot_Partition being down at the moment,
 I went to look at what corresponding documentation there was in the
 manual.

 One question that I cannot find an answer for in the manual here :-
 18.1 GRUB only offers a rescue shell
 It explains that the only available commands are ls, set, unset and
 insmod.
 So what use is it?
 Assuming that a module is missing or a variable is incorrect, and
 these are corrected with insmod and set - what next?
 I can see no way to boot after correcting things without a 'boot'
 command available. If you can't boot, why bother with set or insmod.
 I just don't get it!
[...]
insmod normal
normal




 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 http://lists.gnu.org/mailman/listinfo/grub-devel



-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Improve documentation of BIOS installation

2011-03-30 Thread Colin Watson
On Wed, Mar 30, 2011 at 08:00:46PM +0100, Barry Jackson wrote:
 On 29/03/11 13:40, Colin Watson wrote:
 With http://grub.enbug.org/BIOS_Boot_Partition being down at the moment,
 I went to look at what corresponding documentation there was in the
 manual.
 
 One question that I cannot find an answer for in the manual here :-
 18.1 GRUB only offers a rescue shell
 It explains that the only available commands are ls, set, unset and insmod.
 So what use is it?
 Assuming that a module is missing or a variable is incorrect, and
 these are corrected with insmod and set - what next?
 I can see no way to boot after correcting things without a 'boot'
 command available. If you can't boot, why bother with set or insmod.
 I just don't get it!

The manual even answers this question directly with an example:

  
http://www.gnu.org/software/grub/manual/grub.html#GRUB-only-offers-a-rescue-shell

See the example after then you can correct this and enter normal mode
manually.

(Once you are in normal mode with a correct prefix, then commands will
be autoloaded, although you could insmod them manually if you really
wanted.  But this should be self-explanatory once you do it, as entering
normal mode will give you a GRUB menu.)

I've extended the text you refer to
(http://www.gnu.org/software/grub/manual/grub.html#Commands) to link to
this troubleshooting section.  It'll be there the next time we push to
the website.

Regards,

-- 
Colin Watson   [cjwat...@ubuntu.com]

___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


[PATCH] Improve documentation of BIOS installation

2011-03-29 Thread Colin Watson
With http://grub.enbug.org/BIOS_Boot_Partition being down at the moment,
I went to look at what corresponding documentation there was in the
manual.  There actually was some, written variously by Vladimir and me,
but I felt that it could use a bit of reorganisation, and being put into
a form where we could give out a single link that discusses all the BIOS
installation issues in one place rather than being scattered around the
manual.

What do you think of this patch?  It consolidates the existing
documentation into a new BIOS installation section and adds some
cross-references; I also wrote some new text to try to explain things
more clearly.

2011-03-29  Colin Watson  cjwat...@ubuntu.com

* docs/grub.texi (BIOS installation): New section, partly based on
previous text in other sections.
(Installing GRUB using grub-install): Replace BIOS discussion with a
cross-reference.
(Images): Likewise.

=== modified file 'docs/grub.texi'
--- docs/grub.texi  2011-03-09 17:35:16 +
+++ docs/grub.texi  2011-03-29 12:22:33 +
@@ -550,6 +550,7 @@ the @dfn{boot directory}.
 * Installing GRUB using grub-install::
 * Making a GRUB bootable CD-ROM::
 * Device map::
+* BIOS installation::
 @end menu
 
 
@@ -565,13 +566,8 @@ always. Therefore, GRUB provides you wit
 @dfn{device map}, which you must fix if it is wrong. @xref{Device
 map}, for more details.
 
-On BIOS platforms GRUB has to use a so-called embedding zone. On msdos
-partition tables, this is the space between the MBR and the first partition
-(called the MBR gap or the boot track), while on GPT partition tables it
-uses a BIOS Boot Partition (a partition with GUID
-21686148-6449-6e6f-744e656564454649). If you use GRUB on a BIOS system, make
-sure that the embedding zone is at least 31 KiB (512KiB or more
-recommended).
+For information on where GRUB should be installed on PC BIOS platforms,
+@pxref{BIOS installation}.
 
 If you still do want to install GRUB under a UNIX-like OS (such
 as @sc{gnu}), invoke the program @command{grub-install} (@pxref{Invoking
@@ -744,6 +740,70 @@ comments in the file if needed, as the G
 just a comment if the first character is @samp{#}.
 
 
+@node BIOS installation
+@section BIOS installation
+
+@heading MBR
+
+The partition table format traditionally used on PC BIOS platforms is called
+the Master Boot Record (MBR) format; this is the format that allows up to
+four primary partitions and additional logical partitions.  With this
+partition table format, there are two ways to install GRUB: it can be
+embedded in the area between the MBR and the first partition (called by
+various names, such as the boot track, MBR gap, or embedding area, and
+which is usually at least 31 KiB), or the core image can be installed in a
+file system and a list of the blocks that make it up can be stored in the
+first sector of that partition.
+
+Each of these has different problems.  There is no way to reserve space in
+the embedding area with complete safety, and some proprietary software is
+known to use it to make it difficult for users to work around licensing
+restrictions; and systems are sometimes partitioned without leaving enough
+space before the first partition.  On the other hand, installing to a
+filesystem means that GRUB is vulnerable to its blocks being moved around by
+filesystem features such as tail packing, or even by aggressive fsck
+implementations, so this approach is quite fragile; this approach also has
+reliability problems if the @file{/boot} filesystem is not on the disk the
+BIOS boots from, because GRUB must rely on guessing BIOS drive numbers.
+
+The GRUB development team generally recommends embedding GRUB before the
+first partition, unless you have special requirements.  You must ensure that
+the first partition starts at least 31 KiB (63 sectors) from the start of
+the disk; on modern disks, it is often a performance advantage to align
+partitions on larger boundaries anyway, so the first partition might start 1
+MiB from the start of the disk.
+
+@heading GPT
+
+Some newer systems use the GUID Partition Table (GPT) format.  This was
+specified as part of the Extensible Firmware Interface (EFI), but it can
+sometimes also be used on BIOS platforms.  With this format, it is possible
+to reserve a whole partition for GRUB, called the BIOS Boot Partition.  GRUB
+can then be embedded into that partition without the risk of being
+overwritten by other software and without being contained in a filesystem
+which might move its blocks around.
+
+When creating a BIOS Boot Partition on a GPT system, you should make sure
+that it is at least 31 KiB in size.  (GPT-formatted disks are not usually
+particularly small, so we recommend that you make it larger than the bare
+minimum, such as 1 MiB, to allow plenty of room for growth.)  You must also
+make sure that it has the proper partition type.  Using GNU Parted, you can
+set this using a command such as the following:
+

Re: [PATCH] Improve documentation of BIOS installation

2011-03-29 Thread Pádraig Brady
On 29/03/11 13:40, Colin Watson wrote:
 +@node BIOS installation
 +@section BIOS installation

This is a good summary.

 +(called by
 +various names, such as the boot track, MBR gap, or embedding area, and
 +which is usually at least 31 KiB),

Maybe mention the original name/reason; DOS compatibility region

I'll link to this node from http://www.pixelbeat.org/docs/disk/
when it appears on line.

cheers,
Pádraig.

___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Improve documentation of BIOS installation

2011-03-29 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 29.03.2011 15:11, Pádraig Brady wrote:
 On 29/03/11 13:40, Colin Watson wrote:
   
 +@node BIOS installation
 +@section BIOS installation
 
 This is a good summary.

   
 +(called by
 +various names, such as the boot track, MBR gap, or embedding area, and
 +which is usually at least 31 KiB),
 
 Maybe mention the original name/reason; DOS compatibility region

   
I think this name would be misleading since one can think that one needs
it for DOS to load or that DOS would overwrite GRUB if it's installed on
the disk. Since this term is rarely used I'd prefer to omit it.
 I'll link to this node from http://www.pixelbeat.org/docs/disk/
 when it appears on line.

 cheers,
 Pádraig.

 ___
 Grub-devel mailing list
 Grub-devel@gnu.org
 http://lists.gnu.org/mailman/listinfo/grub-devel

   


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko




signature.asc
Description: OpenPGP digital signature
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Improve documentation of BIOS installation

2011-03-29 Thread Colin Watson
On Tue, Mar 29, 2011 at 02:11:45PM +0100, Pádraig Brady wrote:
 On 29/03/11 13:40, Colin Watson wrote:
  +@node BIOS installation
  +@section BIOS installation
 
 This is a good summary.

Thanks.  I've incorporated some feedback from Vladimir and committed
this.

Vladimir and I disagreed a bit over what the traditional partition table
scheme should be called.  Other parts of the GRUB manual describe it as
msdos, which is also the identifier used in GNU Parted's UI; and he
pointed out that MBR is also used to refer to sector 0.  I'm
uncomfortable with the lower case there, and I also don't like
attributing the scheme to a single company and (proprietary) operating
system in a GNU manual.

The GNU Parted manual uses MS-DOS in a number of places where prose is
more suitable than the identifier, although some of the documentation it
should have has moved to the non-existent GNU Storage Guide.

http://en.wikipedia.org/wiki/Master_Boot_Record talks about the MBR
partition table scheme, although I haven't checked to see whether
that's long-lived terminology on Wikipedia.

The GPT specification uses MBR in both senses: it refers to the MBR
disk layout, and also to the MBR which may be located at LBA 0.  I like
this terminology because it's company- and OS-neutral, although it does
require careful phrasing in order to be clear.

Does anyone have preferences here?  I left it as MBR in my commit for
the time being, although there may well be scope for a rephrasing
through the whole manual.

  +(called by
  +various names, such as the boot track, MBR gap, or embedding area, 
  and
  +which is usually at least 31 KiB),
 
 Maybe mention the original name/reason; DOS compatibility region

Vladimir's reaction was that a casual reader might think Huh?  What
does this have to do with compatibility.  Do you have a reference for
this being the original name?

 I'll link to this node from http://www.pixelbeat.org/docs/disk/
 when it appears on line.

  http://www.gnu.org/software/grub/manual/grub.html#BIOS-installation

You might like to link to (or contribute to!)
http://www.gnu.org/software/grub/manual/grub.html#Images as well, in the
context of your document.

Cheers,

-- 
Colin Watson   [cjwat...@ubuntu.com]

___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Improve documentation of BIOS installation

2011-03-29 Thread richardvo...@gmail.com
 -@strong{Caution:} Be very careful which partition you select!  When GRUB
 -finds a BIOS Boot Partition during installation, it will automatically
 -overwrite part of it.  Make sure that the partition does not contain any
 -other data.
+@xref{BIOS installation}, for details on where the core image can be
+installed on PC systems.

I would suggest NOT moving warnings into links introduced as for
details.  Something should be kept here, like:

( ! ) Caution: If your system has a BIOS Boot Partition, GRUB
automatic installation will overwrite it and data could be lost.  Be
sure to read @xref{BIOS installation/GPT}.

And then that section needs to also contain a simple test which users
can do to discover that they have no BIOS Boot Partition to worry
about.

Please also check whether it's more correct to say that GRUB will
automatically overwrite during installation, or GRUB will overwrite
during automatic installation.

___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel