Re: Problems with grub2/initramfs-tools in chroot
On 22/11/14 09:43, Ross Boylan wrote:
> On Thu, Nov 20, 2014 at 9:11 PM, Scott Ferguson
> <firstname.lastname@example.org> wrote:
>> On 21/11/14 15:13, Ross Boylan wrote:
>>> Over the last week I've repeatedly found my machine unbootable,
>>> in the sense I couldn't get to a working system without
>>> intervention. Sometimes I couldn't even get the grub2 menu.
> I don't understand what you mean by tick.
That I had the same symptom. (as Lisi has noted).
>>> Could changing the boot order in the BIOS change the drive
>>> mappings and screw up grub that way?
> Whichever drive I booted off of sda and sdb always referred to the
> same physical devices. And that was even though I booted into
> different operating system instances.
> But I guess the fact that linux can keep the names safe (via udev
> remembering serial numbers I suspect) doesn't really speak to the
> drive mappings that grub sees in its early operation.
>> I've had a 'similar' problem, in my case it was solved with:-
>> grub-install /dev/$Whatever
> I either executed that explicitly or, I assume, the grub package
> installation machinery did it for me. But I still had trouble.
If you executed that explicitly, see my comment about double-checking
device names and BIOS boot order. If you didn't explicitly tell
grub-install where to install - it'll likely just put it back in the
same place (and not solve the problem?).
> grub needs to know where it should jump to.
> I don't know how it can figure that out from inside a chroot.
The same way it "figures it out" when not in a chroot?
> For example, say /boot inside the chroot is mounted from sdb2. To the
> chroot, it's just part of the filesystem. How is grub-install to
> figure out that, when it loads from the start of the disk, it should
> look for the grub directory (not /boot/grub) of the appropriate
That depends on what you mounted in your chroot. locate/mlocate/find
devicemap 'might' be instructive.
> The only possibility I can think of would be that it looks in
Perhaps (or mtab)? I haven't done more than glance at info grub-setup
so I can't say I know how device map is created (only that I know how I
resolved a similar problem).
>> If the problem is GRUB, and you are actually booting from sdb (due
>> to the BIOS settings making it the boot device.
Did you try the following?
>> Note: double check device names (you can use the GRUB device name)
>> with the mount command and use SMART to determine which device it
>> the one set to boot from in the BIOS.
>> Hope that helps.
>> Kind regards
> Thanks for your response. Ross .