The grub menu displayed as if the system knew which partition contains the bootloader. The root partition mounted by itself. Neither dmesg nor my init/process manager threw any errors. The boot partition was not mounted, neither was swap.

I did manually create an fstab from within the installed system and all is fine, so my question is purely academic. Do modern systems not need an fstab in order to know which devices and partitions to mount where?

  • Static_Rocket@lemmy.world
    link
    fedilink
    English
    arrow-up
    24
    ·
    5 days ago

    If the initramfs is using systemd, it’s actually able to look up the root (by label) and ESP partitions (by guid) automatically. GRUB can also detect the ESP and enumerate UKI images. There’s still some assumptions being made, but it’s cleaner than ever.

  • hades@feddit.uk
    link
    fedilink
    arrow-up
    8
    ·
    5 days ago

    To be clear, grub itself doesn’t mount your root partition. Grub provides the root partition device path or id to the kernel via kernel command line. Then kernel mounts the root partition early in its boot sequence with a limited set of options (typically read only).

    Logically, the root partition should be mountable without fstab because otherwise it would be a chicken and egg problem :)

    Usually once the userspace starts, an init script will remount the root partition with its normal options from fstab.

    (It’s a bit more complicated if initramfs is involved, but the principle is the same).

    • printf("%s", name);@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      3
      ·
      5 days ago

      Thanks! I guess I need to read up on the boot process. 😅

      Logically, the root partition should be mountable without fstab because otherwise it would be a chicken and egg problem :) Don’t I have egg (or chicken???) on my face… 🤣

  • Courant d'air 🍃@jlai.lu
    link
    fedilink
    arrow-up
    8
    ·
    5 days ago

    The root partition ID is in the grub configuration, it’s mounted when the system boots. Then fstab is read and the other partitions are mounted.

    fstab is needed for root mount options and other partitions, but as you saw with your system if the only partitions other than root are not needed to boot your system will boot fine (I don’t know which options grub uses when mounting root though)

  • deadbeef79000@lemmy.nz
    link
    fedilink
    arrow-up
    6
    ·
    5 days ago

    Grub typically stores the uuid of the root filesystem in the kernel command line arguments (I can’t quite remember if that’s the right name it not).

    Have a look at the grub configuration when in the grub menu and you should see it there.

  • Mactan@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    5 days ago

    highly recommend setting up both grub and a second bootloader, it’s ok to have multiple! really handy when shtf

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      5 days ago

      Me doesn’t follow anything you suggested. :D Never had a second bootloader in almost 20 years and never didn’t encounter an issue where it would solve the problem. Although I just distro hopped once, or twice if you count same family of distro.

      Recently (years ago) switched from grub to systemd-boot (note, it is badly named, as it is not a systemd component and just a different project taken over and renamed from gummiboot, so technically it should be usable without systemd), as it is much simpler and less prone to issues than grub (and because it is the default recommendation by EndeavourOS too). I have only one operating system installed and from day to day work, I never noticed a difference in the operation.