how to tell where it booted from

Rick Stevens ricks at alldigital.com
Wed Feb 17 18:03:04 UTC 2016


On 02/16/2016 09:19 PM, Mike Wright wrote:
> On 02/16/2016 08:15 AM, Chris Murphy wrote:
>> At the GRUB menu, type
>>
>> pager=1
>> set
>>
>> Look for variable 'prefix=' this will be drive, partition, and path, to
>> the GRUB directory where its cfg and modules are found.
>
> All right Chris!
>
> While at the boot prompt I have no access to anything and had forgotten
> the "pager=1" bit so after getting into grub> it was hit or miss with
> huge text overflowing the screen. By habit I typed ls and don't know if
> what it did was what I expected but near the bottom of the screen was
> the prefix= line.  Ahhh, serendipity.
>
> I copied, with pencil and paper, the 102 character string, cursing the
> entire time the genius behind this madness, and rebooted.
>
> A portion of that string, reformatted without slashes and hyphens, was
> located in one of /dev/disk/by-id's 107 entries and which turned out to
> be a sym-link to dm-16.  dm-16 was claimed by a sym-link in /dev/mapper.
>
> (Editors comment: this crap could only have been created by somebody
> with a cast of thousands and an unlimited budget and would have gotten
> an "F" at the Oscars.)
>
> And there was a recognizable quatrain of stanzas minus any commenting
> other than the title.  After editing and changing the module lines to
> refer to the current kernel (when booting Xen kernels and initrds are
> modules) I rebooted and... WTF? the original unmodified boot page.
>
> So apparently grub.cfg is ?compiled? into some other secret location
> know only to the bootloader.  I have the sinking feeling I have to run
> some grub2 magic spell to get the modified boot file into wherever it
> goes but am loathe to try anything.  The reason I have a stripped down
> grub.cfg is because the last one generated for me was pushing 200K and
> the boot lines in each stanza had, so help me, nineteen swap files
> included in each one.
>
> Now the question:
>
> Is there a command that will take my simplified grub.cfg and install it
> without modifying it in any way and leave me with a bootable system?
> (please please please say yes).

I've never used it, but I suspect grub-menulst2cfg may do what you
want. It claims to "Convert a configuration file from GRUB 0.xx to GRUB
2.xx format". If you're going to continue to tinker in this way, you
really have to read up on grub2:

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

I agree it's convoluted and confusing and I'm not a fan (just like I'm
not a fan of systemd or journald), but that's what you're stuck with.

Most of the config info you may need to change is in /etc/default/grub.
The scripts that generate the menu entries are in /etc/grub.d
(particularly 10_linux and possibly 40_custom). The final config created
by grub2-mkconfig generally ends up in /boot/grub2/grub.cfg.

Dunno if that helps, but...
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks at alldigital.com -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-   I haven't lost my mind.  It's backed up on tape somewhere, but   -
-                       probably not recoverable.                    -
----------------------------------------------------------------------


More information about the users mailing list