Score:2

How to interpret this ubuntu server 20.04's default installtion's lsblk output

gg flag

After a mostly default installtion of "legacy" ubuntu 20.04 server iso (the none-live version) on an old laptop that uses BIOS boot method, lsblk shows the following result:

NAME              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                 8:0    0 238.5G  0 disk
├─sda1              8:1    0   512M  0 part /boot/efi 
├─sda2              8:2    0     1K  0 part 
└─sda5              8:5    0   238G  0 part
  ├─vgtest-root   253:0    0   237G  0 lvm  /
  └─vgtest-swap_1 253:1    0   980M  0 lvm  [SWAP]
sr0                11:0    1  1024M  0 rom

2 questions, please correct wrong assumptions in my thought process in those questions as well.

  1. the /boot/efi partition "sounds" wrong to me in a BIOS booted system. My understanding is that, /boot/efi is a folder on a hdd that UEFI firmware can automatically find, read, execute. A BIOS booted system shouldn't need it. df shows that the /sda1 partition is empty and there is no content in /boot/efi either. Why is the /boot/efi there? did I do something while installing the system? I vaguely remember getting prompted about "where would you like to install grub/boot" (couldn't remember the exact wording) at the end of the installation , I am hoping that's refering to the /boot/grub installed under the /.

  2. The 1K partion that is /sda2. have no idea what that is. I don't believe that's the "grub's 1.5th stage, immediately after the 0th LBA", as 1KB is not enough to contain grub 1.5th stage.

Score:1
jp flag
  1. You are right about /boot/efi. The bootloader for UEFI mode resides there, but if you boot in BIOS mode (alias CSM alias legacy mode), you do not need it. I think that the installer creates it anyway. This is a new 'feature' of 20.04.x LTS, we did not see it in previous versions (at least not previous LTS versions) installed in BIOS mode.

    In order to be sure about the boot mode, you can run

    test -d /sys/firmware/efi && echo efi || echo bios
    
  2. The 1K partition is an extended partition, a workaround used in MSDOS partition tables in order to work around the limit of 4 [primary] partitions. You can have several logical partitions inside the extended partition. The size reported here is only the size of the address. Partition #5 is a logical partition inside the extended partition, and inside it there is an LVM structure with the root file system and swap.

eliu avatar
gg flag
Thank you, I believe my questions are answered, my computer doesn't have `/sys/firmware/efi`. however I could use a brief breakdown of the command `test -d`, in particular the `&&` and `||`
sudodus avatar
jp flag
`test -d` tests if the following string is a name of a directory. `&&` is logical `and`. `||` is logical `or`. Bash is 'lazy'. So if `/sys/firmware/efi` exists, it 'must' run also `echo efi`. Otherwise, it 'must' test `echo bios`. You get the same result with the following command line, which is easier to understand, but longer to type ;-) `if test -d /sys/firmware/efi; then echo efi; else echo bios; fi`. -- `/sys/firmware/efi` is created at boot if UEFI mode, and it does not survive at shutdown/reboot so it is a good criterion for this test
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.