help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting grub's view of disk geometry from "grub rescue>" prompt?


From: Pascal Hambourg
Subject: Re: getting grub's view of disk geometry from "grub rescue>" prompt?
Date: Fri, 15 Mar 2019 21:54:27 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

Le 15/03/2019 à 20:44, Nathan Stratton Treadway a écrit :
On Fri, Mar 15, 2019 at 19:43:18 +0100, Pascal Hambourg wrote:
Le 15/03/2019 à 01:53, Nathan Stratton Treadway a écrit :
Question in brief: how can you get Grub, from the "grub recovery>"
prompt, to display its boot-time view of disk drive geometry, etc?

You can run 'ls' to print all detected disks and partitions, then
run 'ls' with each disk or partition as argument to print its size,
sector size, starting position...

Thanks, this sounds like part of what we're looking for... but what's
the exact syntax?

When we tried it, "ls" did give the list of detected partitions:

   grub rescue> ls
   (hd0) (hd0,msdos1)

, but doing ls on a partition only showed the filesystem type:

   grub rescue> ls (hd0,msdos1)
   (hd0,msdos1): Filesystem is ext2

Sorry, the position and size information is shown only when the module "ls" is loaded. I thought that running normal_exit to exit normal mode and go back to rescue mode would be the same as booting straight into rescue mode, but it is not : loaded modules are still loaded.

So you must either boot with another GRUB in normal mode, or include the "ls" module in the core image when installing GRUB with

grub-install --modules=ls /dev/...

Would it be "ls (hd0)" that would show the full partition table
information for the device?

It will show the device size, not the partition table.

As a workaround, you can try to create a small partition for /boot
at the beginning of the card.

Yes, this is our plan... but we're trying to figure out what size the
partitition can safely be.  If the limit is large enough, we might
decide to split the partitions between "root" (medium sized) and "misc"
(the rest of the space), rather than very-tiny /boot and the rest as
the root... or something.

You can try dichotomy. Create a partition starting at 50% of the size.
Mount it and install GRUB using the mount point as boot directory :

grub-install --boot-directory=<mount-point> /dev/xxx

If GRUB boots in normal mode, repeat at 75%. If it boots in rescue mode, repeat at 25%. And so on.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]