Category: Notes

  • Oh no! Linux has nuked Windows!

    Oh no! Linux has nuked Windows!

    Just joking. Linux is very respectful and wouldn’t do anything like that.

    What has actually happened is that the default selection in GRUB is Fedora and so, if I’m not quick enough at fiddling with the arrow keys, Fedora gets booted instead of Windows (which I’d like to be my default).

    Was I lucky enough to still have Windows?

    It’s been a long time since I made a Fedora installation on a PC with two drives, and I was expecting Anaconda to ask me where the bootloader should have been installed.

    Guess? Well, it didn’t.

    I still am not sure if I’ve been lucky, or if Anaconda was mindful enough to install the bootloader on the drive with Fedora, leaving the Windows drive untouched.

    I would have appreciated some kind of notification, or warning, or a chance to change and make the final decision.
    Also, I would have appreciated the possibility to choose the default entry in the menu.

    Guess it will be a feature request for some future release.

    What do I do now?

    Apart from what I would have liked and never was, I want to change the default to Windows, so I can just push the button in the morning and leave for a nourishing breakfast, and then find Windows ready for me to work on it for a handful of extremely pleasant productive hours (sarcasm intended).

    A thing I wish there was in Fedora is a GUI for messing around with the bootloader. At least for tampering with the most frequent changes like the timeout, the default entry, and the kernel arguments.

    But, no! You have to do it the command-line way.

    My system uses UEFI, so if one wants to replicate this, just make sure one is also on UEFI. This is not a tutorial, but it’s just a reminder for my future self of what I did.

    So, that’s what I did!

    Given I’m a reckless person who does not want to be sudo-ing all the time in one single session, I typed:

    $ sudo -i

    Unsafe? Sue me, sudoers!

    Then, I checked what entries and what indexes there were on my systems:

    # grubby --info=ALL
    index=0
    ...
    title="Fedora Linux (6.18.5-200.fc43.x86_64) 43"
    ...
    index=1
    ...
    title="Fedora Linux (6.18.4-200.fc43.x86_64) 43"
    ...
    index=2
    ...
    title="Fedora Linux (6.18.3-200.fc43.x86_64) 43"
    ...
    index=3
    ...
    title="Fedora Linux Rescue"

    Where’s my Windows chainloader (I don’t know what it is, I just know the name and I’m bragging) entry?
    Turns out that grubby — which is the official method in Fedora for tampering with the bootloader — does not manage Windows: os-prober does (what even is os-prober?).

    So, a set of grub2 command is required.

    First thing, I need to know the exact name of the menu entry:

    # grep -E "submenu|^\s*menuentry" /boot/grub2/grub.cfg
      menuentry_id_option="--id"
      menuentry_id_option=""
      menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-8830-5645' {
      menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {

    The text I need is the bold one: ‘Windows Boot Manager (on /dev/nvme0n1p1)’.
    Again, if one is trying to do the same, note that the device name will almost certainly be different.

    Then, I need to change the default entry:

    # grub2-set-default 'Windows Boot Manager (on /dev/nvme0n1p1)'

    Check that everything has gone smoothly:

    # grub2-editenv list
    saved_entry=Windows Boot Manager (on /dev/nvme0n1p1)
    menu_auto_hide=1
    boot_success=0
    boot_indeterminate=2

    One reboot later…

    After a proper Windows boot and once checked that everything was fine, it’s time to make the change permanent!

    Yeah, that was not permanent.
    With the

    GRUB_DEFAULT=saved

    set in /etc/default/grub.cfg, the boot item defaults back to the latest Linux kernel after every installation of a new kernel (and in Fedora it happens frequently!).

    So I edited the /etc/default/grub.cfg and changed

    GRUB_DEFAULT='Windows Boot Manager (on /dev/nvme0n1p1)'

    I also made sure there was no line

    GRUB_SAVEDEFAULT=true

    If it’s there, either delete the line or set it to

    GRUB_SAVEDEFAULT=false

    This should ensure that no new Linux kernel is set as the default menu entry in the future.

    As the final step, I had the configuration file regenerated to have the new settings baked in (yes! this sentence sounds mysterious to you as it is to me).

    # grub2-mkconfig -o /boot/grub2/grub.cfg 
    Generating grub configuration file ...
    Found Windows Boot Manager on /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
    Adding boot menu entry for UEFI Firmware Settings ...
    done

    A couple of reboots later…

    Everything seems fine, and Windows is back on top of Linux — right where it belongs.
    Ok, sorry! I might have gone too far with this last sentence.

  • Marginalia

    Marginalia

    I stumbled on a very interesting YouTube video: How to Read so that you *Retain* Information by Jeffrey Kaplan, where he talks about marginalia.

    What the hell are marginalia though?

    There’s actually something interesting not so much in what they are, but rather in where the name comes from.

    They are, in fact, just scribbles — well, hand-written notes — at the margins of a page.

    It’s trivial to understand that the word marginalia comes from margin. But why did margin come to be marginalia and not just something like margin scribbles?
    I think the mechanism is quite curious: ancient Romans could recast a name like margo, marginis — which obviously translates to margin — into an adjective by appending the suffix -alis — which means related to.

    By the way, in Latin nouns are identified by the nominative and the genitive, while adjectives are identified by the masculine, feminine and neuter nominative. So we have

    • from natio (nation), nationis (of the nation), nationalis, nationalis, nationale (national), and
    • from margo (margin), marginis (of the margin), marginalis, marginalis, marginale (marginal).

    Yeah. That’s not curious at all. That’s just how it works.
    The nice stuff is yet to come.

    Ancient Romans could turn adjectives back to nouns. So things that have a certain property could be referred to with just one word. So, instead of saying the whole phrase things that sit at the margin, they just used one single word.
    That word was the neuter plural nominative which was made by adding the desinence -ia to the root marginal-.

    So, today we have:

    • memorabilia — things to be remembered — or remains,
    • or the Italian mirabilia — things that are worth seeing — or wonders,
    • and, of course, marginalia — fluff that is scribbled at the margin of a page.

    Amazing.

    What about marginalia again?

    Oh, right!

    Jeffrey Kaplan, with his captivating gestures, says that if you use notes at the margins of the page in a certain way, comprehension and retention are highly improved.

    That certain way is wonderfully shown in a scribble:

    So, you start summarizing the first paragraph with one single sentence, and again the second paragraph with another single sentence.
    Then, from the third paragraph on, you summarize what’s in all the paragraphs before the last one with just one sentence, and add another sentence for only the last paragraph.

    It’s clear that, by doing things this way, there’s a fair amount of abstraction, a nice effort in synthesis, and a lot of repetition. And — as everyone knows — repetition is the key.

    What is a paragraph even?

    Well, if you have doubts about how to identify a paragraph, you’re not alone — I had those too.

    I guess a rule of thumb is always valid.

    When an author writes things down, he’ll have things to say that are strictly connected. Maybe he will use a couple of longer sentences, or maybe twelve — or so — shorter sentences.
    But, at some point, he’ll have to introduce a new concept and set it apart from the previous one — though in the same chapter.

    So there will probably be some lines that are a bit more spaced apart than the other ones. Well, that’s the limit of a paragraph.

    Does it work?

    I don’t know.
    I always hated margin notes: they were of little use to me, because I found mine too short or too generic, and I like longer summaries and schemes better. But I am captivated by this variation. So, I’m certainly gonna try.