How Does Linux Boot Process Work?

Поділитися
Вставка
  • Опубліковано 26 гру 2024

КОМЕНТАРІ • 360

  • @Dom-zy1qy
    @Dom-zy1qy 3 місяці тому +59

    People clicking on a sub 5 minute video and expecting an intricate explanation of all functions of the boot loader. This was a great high level overview..

    • @JimmyJohn-r1y
      @JimmyJohn-r1y 2 місяці тому

      💯

    • @mr.raider744
      @mr.raider744 25 днів тому

      still looking i guess XD

    • @sciencedaemon
      @sciencedaemon 8 годин тому

      Wrong. The first two minutes had nothing to do with linux. It's even worse than expected.

  • @DK-ox7ze
    @DK-ox7ze Рік тому +649

    This is a good summary, but it seems like there's a lot going on behind the scenes in all of these process, especially systemD. Would be nice to cover that in a future video :)

    • @nid274
      @nid274 Рік тому +63

      That would require a 1000 page book,...may be 10000 pages!

    • @kurtmueller2089
      @kurtmueller2089 Рік тому

      systemD is a disgrace and as UNIX-like as it gets.
      Its functioning should never be covered nor should its name even be uttered more than strictly necessary

    • @nishantdalvi9470
      @nishantdalvi9470 Рік тому

      ​@@nid274hey bro in which domain you are studying right now?

    • @dayanandhn
      @dayanandhn Рік тому

      @@nid274try reading Abraham Silberschatz OS concepts book

    • @yaroslavpanych2067
      @yaroslavpanych2067 Рік тому +14

      Yeah, pretty much "what does Kernel at boot" and "what does process with pid=1 at boot before enters configured runlevel" should have been content of the video, not detecting devices, running EFI, and rest of irrelevant shit.

  • @trueriver1950
    @trueriver1950 11 місяців тому +26

    As has already been said, there is a lot going on in each of these steps.
    My major criticism is that step 5 simplifies away the usual mechanism of running some code from an initial ramdisk: this is done so that the kernel does not have to contain all the device drivers needed to load whatever modules it needs before the final root partition becomes readable.
    That also means that an earlier step needed to load the initial ram disk into memory and tell the kernel where to find it. Grub (or some other boot program like Lilo) will have done this already, so the Grub step should mention that it loads a filesystem containing drivers as well as libraries into ram before passing control to the kernel.
    And then, in my opinion, you need an extra step between 4 and 5 for the initial ram stage, that is used to get the system able to actually read the code it needs off the disks. While it does that the kernel only needs to know how to read the initial ramdisk.
    More detail follows...
    There are two exceptions to what i just said
    1. If you compile your own kernel you can arrange that the kernel has all the drivers it needs built in (Gentoo users might do this, knowing in advance exactly what filesystem and hardware will hold the operating system)
    2. Puppy (and most Live Disk systems) boot into the ramdisk and never leave it.
    For different reasons, both these exceptions slow down system loading (because either the kernel or the ramdisk is huge) but often speeds up running once the boot is complete because the kernel has what it needs in memory at all times, one way or another.

  • @nelumertyk6
    @nelumertyk6 11 місяців тому +12

    Bravo si multumesc.E simplu,frumos pe intelesul tuturor...fara explicatii savante.CHIAR UN TUTORIAL...GENIAL DE SIMPLU!!!La mai multe inainte !!!

  • @ethanmye-rs
    @ethanmye-rs Рік тому +171

    Good overview, but missing a discussion of ACPI, initramfs/initrd.

    • @thecataclysm
      @thecataclysm Рік тому +47

      agreed, initramfs is a crucial part to be included in a boot process video IMHO

    • @p0358
      @p0358 10 місяців тому +2

      @@thecataclysmexactly, especially that the title mentions Linux specifically

    • @death_parade
      @death_parade 8 місяців тому

      All I know about ACPI is that it got FUBARd in my laptop and now the lspci doesn't even show my wireless lan card. Don't know what started it, but I guess it was some power cycling malfunction because it started after I woke the PC up from sleep. I've done fresh linux install and it doesn't work. So most likely will need to flash BIOS :(

  • @danholli123
    @danholli123 Рік тому +72

    There's a bit of a misconception about BIOS. MBR is limited to 2TB, but a BIOS doesn't need to be restricted to MBR, it could've moved to a different (likely proprietary) format... it's just that GPT and EFI were more flexible and the groundwork was already completed

    • @sfalpha
      @sfalpha Годину тому

      it can use any partition format not just MBR. But the boot code need to reside in first 2TB because it will use BIOS provided disk services to access which only support 32bit LBA addressing.
      To be able to access disk beyond 2TB, the boot code need to probe and load appropriate disk drivers to be able to access disk controller directly so it can use 48bit LBA, for example GRUB that when in stage 2 it can communicate directly with ATA controllers to boot kernel beyond 2TB (if you know how to).

  • @ggattsr
    @ggattsr 6 місяців тому +4

    One of the best boot process summary's on UA-cam. Thanks for all the work and graphics.

  • @Codigger-br2rt
    @Codigger-br2rt 9 місяців тому +4

    When Linux chooses to support initramfs boot, and selects the rootfs path to be packaged in the initramfs source file, it will try to boot in initramfs mode. In this way, the rootfs will be compressed and packaged in the same image file as the Linux kernel. Then uboot will load the whole image file into memory when the system is loaded. In this way, the rootfs cannot be modified in flash, and will be lost when the power is lost.

    • @jali-cj5zq
      @jali-cj5zq 9 місяців тому

      Thanks this is really informative

    • @Codigger-br2rt
      @Codigger-br2rt 9 місяців тому

      @@jali-cj5zq
      Thanks for reading my comments!! I hope everyone’s got vim on their resolutions for 2024

  • @maitreerimthong
    @maitreerimthong 10 місяців тому +7

    Great visualization of the entire boot process, Thank you.

  • @eliottmax8454
    @eliottmax8454 Рік тому +20

    I was expecting that you would really be talking about the kernal boot process and not everything around. But in the end, I never saw an exhaustive explanation about the boot process in the first place so I am that to know that I did not miss out anything.

  • @shaheena_kazi
    @shaheena_kazi 24 дні тому

    Wow… such an awesome video for some one who is aware about the boot process but just wants to brush up on their memory… lovely thanks ☺️

  • @piratestreasure2009
    @piratestreasure2009 10 місяців тому +3

    It is possible to use gpt partitions without needing UEFI. Even old motherboards with intel 775 socket will boot using gpt partitions without UEFI:
    "Yes, it is possible to use GPT (GUID Partition Table) partitions without UEFI (Unified Extensible Firmware Interface). GPT is a partitioning scheme for formatting and partitioning hard drives, and it's independent of the firmware interface being used (UEFI or BIOS).
    However, the ability to boot from a GPT-partitioned disk depends on the firmware of your system. Most modern systems use UEFI firmware to boot, and UEFI is compatible with both GPT and the older MBR (Master Boot Record) partitioning scheme.
    If your system uses the older BIOS (Basic Input/Output System) firmware instead of UEFI, it may have limitations when it comes to booting from GPT disks. Some BIOS systems can boot from GPT disks using a compatibility support module (CSM), while others may not support GPT booting at all.
    So, in summary, while you can use GPT partitions without UEFI, the ability to boot from a GPT disk depends on the firmware capabilities of your system."

  • @reasoningCode
    @reasoningCode 10 місяців тому +1

    KUDOS! I've never seen such nicer explanation for this.

  • @jay.maverickat50
    @jay.maverickat50 2 місяці тому +1

    I think no matter the type of bios, the bios is written in the EEPROM located in the motherboard. It is not attached to any disk. So even if the boot failure or no OS is installed you can still access bios.

  • @Zolodar
    @Zolodar 8 місяців тому

    This is incredibly well explained and illustrated! Thank you so much!

  • @alinmgheorghe
    @alinmgheorghe 11 місяців тому

    This is my favourite new channel.

  • @_soundwave_
    @_soundwave_ 11 місяців тому

    One of the best channels in last few years

  • @AlbertXuY
    @AlbertXuY Рік тому +20

    Missing initrd or initramfs part?

    • @MrPepyaker
      @MrPepyaker 11 місяців тому +1

      Right, this part is missing

    • @piratestreasure2009
      @piratestreasure2009 10 місяців тому

      also it is possible to use GPT without using UEFI boot ... so this is kind of useless, at least for me.

  • @alicantropo5749
    @alicantropo5749 2 місяці тому

    This was exactly the kind of explanation I was looking for! Wonderfull job, man. Subscribed

  • @qoopdata
    @qoopdata Рік тому +8

    That’s beautiful and enormous work! Great thanks.

  • @Cant_think_of_any
    @Cant_think_of_any 2 місяці тому

    Your explanation is amazing, sir!

  • @THE16THPHANTOM
    @THE16THPHANTOM 4 місяці тому

    short and sweet. little bit of history of why but not too much is perfect.

  • @dcn4lyf
    @dcn4lyf Рік тому +1

    Best Summary of the Boot process

  • @xuedi
    @xuedi 11 місяців тому +1

    Very lovely & professional made

  • @pandacongolais
    @pandacongolais Рік тому +11

    Nice and simple !
    But you're missing the loading of initrd. I admit I can't remember from the top of my head when exactly it occurs. Would be a nice addition to your explanation.

    • @trueriver1950
      @trueriver1950 11 місяців тому

      In the classic Grub or Lilo bootloader, the initrd or initram (NB they are different!) is loaded after the kernel but before control is passed.
      There are also the kernel parameters (append details in some boot loaders) that the boot loader has to make available to the kernel. These can be flags or switches to the kernel, to systemd, or to other programs run later on.

  • @avimehenwal
    @avimehenwal Рік тому +5

    Have never such a visually stunning explanation of a boot process. Amazing video
    Thankyou so so much for sharing. Piece of art with tons of knowledge

  • @hammerheadcorvette4
    @hammerheadcorvette4 10 місяців тому

    systemd-boot is great. No fuss just straight to the point !

  • @coderdojoAN
    @coderdojoAN Рік тому +1

    Great summary and visualization of the entire boot process. Very well done mate!!!!

  • @MartinCharles
    @MartinCharles 10 місяців тому

    The information density here is very high

  • @gnuPirate
    @gnuPirate 8 місяців тому

    This channel is absolutely brilliant. I am blown away! 0__0 wow

  • @yeshayavarghese350
    @yeshayavarghese350 9 місяців тому

    Nicely done! Good visual aids too

  • @marioduarte7658
    @marioduarte7658 Рік тому

    Wow, I just loved it - I am recomending to my felow IT guys who ignore those initial steps.
    Regards from Brazil and keep posting!

  • @nicholasmaniccia1005
    @nicholasmaniccia1005 Рік тому +23

    Great content, always helpful and always impressive. Thank you very much for taking the time to make these.

  • @GinaMoriarty
    @GinaMoriarty 2 місяці тому

    This video really simplified things!

  • @FerdausAlAmin
    @FerdausAlAmin 9 місяців тому

    Great video.. I could not have done this better like you
    Though I am a Linux user for the last 15 years..
    Thank you

  • @twoyastara-t3t
    @twoyastara-t3t Рік тому +1

    I was looking for something like this. This is great thank you!

  • @Nightowl_IT
    @Nightowl_IT 7 місяців тому

    More detail please.
    A series would be good describing each and every nook and cranny.

  • @cybersean3000
    @cybersean3000 Місяць тому

    In the early days of Linux, IDE hard drive support had to be manually compiled into the kernel. Kernel modules are loaded from a drive, but without drive support, the kernel could not load modules from a device it could not read. So, IDE support had to be compiled into the kernel, then once the kernel could use the drive, it could load other modules.
    This was a huge big deal, because compiling a kernel with a 386SX processor and 4 mb of ram would take days.

  • @prabinlamsal74
    @prabinlamsal74 Рік тому

    I sept yesterday learning all this by myself and today, youtube recommended me this. If I had found this video, maybe I would have learned all that in 5 minutes.

  • @RajinderYadav
    @RajinderYadav 11 місяців тому

    I was like he is going to miss systemd 😂, nope nailed it. This is well covered, love the illustration.

  • @kimaegaii
    @kimaegaii 5 місяців тому

    Absolutely amazing explanation. Thank you.

  • @ivanryabtsev
    @ivanryabtsev Місяць тому

    Thank you!
    Great animation!

  • @mehd-q1w
    @mehd-q1w 16 днів тому

    Great video, well reformulated .
    can you also please make a video about LVM

  • @Crusaderon
    @Crusaderon 10 місяців тому

    Great descriptions... 😊

  • @SaravananViswanathan-t2i
    @SaravananViswanathan-t2i 7 місяців тому

    very very nice. excellent animation. forcing us to view compulsorily immediately though we have plenty of pending works. it is like movie attracts us. go ahead.

  • @brettgmonroe
    @brettgmonroe Рік тому +5

    I would have appreciated more time being given to the transition between the boot loader and systemd (the kernel initialization).

    • @OtterSwims
      @OtterSwims Рік тому

      Same, i wonder what the name of the first process that runs within the kernel is. Is there some sort of entry point within the kernel like a main function or something that eventually calls systemd?

  • @brolinofvandar
    @brolinofvandar 8 місяців тому

    This seems more like a brief description of how *any* OS boots on a PC, just using the linux names for the later steps where it'll differ. Up to the boot loader step, there's not even an OS involved. And Windows uses a boot loader as well, it's just not called that and tends to be hidden from view for most people. Still, the same process. Code the hardwired system can find that loads the actual operating system. And whatever OS it is, the first step will usually be getting the kernel of the system going, drivers, etc. Same basic flow for any OS. Aside from the names used in those last steps, nothing here specific to linux.
    An actual OS specific discussion of the boot process would start with the kernel loading. It's from that point that OS's diverge. The boot loader itself can be setup to point to different kernels and/or different OSs itself, which is how a dual boot works.

  • @pogchamper228
    @pogchamper228 11 місяців тому +1

    No way. I just guessed it right. I told exact same on my interview 😂.

  • @nalipapaiah8384
    @nalipapaiah8384 9 місяців тому

    I was looking something like this and kind of explanation thanks man😊

  • @bmiller949
    @bmiller949 10 місяців тому

    Great overview. I think is good background info for any OS.

  • @baronhelmut2701
    @baronhelmut2701 Рік тому +10

    Very nicely explained and beautifully visualized presentation. I have to ask tho, would you like to make that same presentation again but for a Secured and TPM measured bootgraph ? If so, please do it, people and especially the linux community would need this in order to understand why the TPM makes booting so much more secure. I would even offer my help understanding a measured boot process (which I am pretty sure you would have no trouble understanding on your own).

  • @LinuxLoader1287
    @LinuxLoader1287 11 місяців тому

    Nice video good explanation and presentation 👍

  • @hlubradio2318
    @hlubradio2318 5 місяців тому

    Very nice as always

  • @Kevin_Long
    @Kevin_Long 11 місяців тому

    This was excellent, well done.

  • @chyldstudios
    @chyldstudios 10 місяців тому +1

    Well done!

  • @qlx-i
    @qlx-i 11 місяців тому +1

    Although a thing to point out is that you don't need a boot loader now, you can just expose the kernel to UEFI and write flags directly into boot record.

    • @trueriver1950
      @trueriver1950 11 місяців тому

      Can you please post a link to a "how to" on skipping the "grub" phase of booting?
      And if you do that do you have to avoid using an initial ramdisk in the usual Linux way? I can't see how the boot flags alone can properly load the ramdisk (which might of course be my ignorance, hence my question)

    • @dmitripogosian5084
      @dmitripogosian5084 4 місяці тому

      @@trueriver1950 Search for 'EFI stub kernel' if the link below does not work

  • @GranZhadu
    @GranZhadu 11 місяців тому

    Excellent presentation. Thank you for posting it.

  • @sadeksadaoui8371
    @sadeksadaoui8371 10 місяців тому

    Awsome, great job. thanks a lot for your time. excellent explanation!

  • @Sabulany
    @Sabulany 10 місяців тому

    this is awesome, the same core idea when develop embedded firmware as well

  • @ckk2136
    @ckk2136 Місяць тому

    Thank you very much for this video. Got stuck for 2 days because of GPT's false information

  • @jijuntang509
    @jijuntang509 Рік тому

    Thanks, it's a very good summary video with a good global presentation

  • @naren.np4u
    @naren.np4u 5 місяців тому

    thank you, like it and share it with my students.

  • @kumar2457-r2j
    @kumar2457-r2j 10 місяців тому

    Excellent demo

  • @ab3lsec
    @ab3lsec Рік тому +4

    Hey, can you do the same for Windows?

  • @davidruedeman9990
    @davidruedeman9990 Рік тому +4

    Where is initrd or initramfs? It is present in most if not all Linux system? Seems like you missed something.

    • @dmitripogosian5084
      @dmitripogosian5084 4 місяці тому

      Not all, I do not use one for instance. But by default it is indeed used widely. Neither is boot loader mandatory, UEFI can load properly configured kernel directly (if you do not need all the extra flexibility of boot loader)

  • @jorgevalbuena8836
    @jorgevalbuena8836 Місяць тому

    Gracias , no entiendo mucho de computación , pero me pareció genial , la explicación animada, entiendo que debe ser un experto en ciencias de la computacion

  • @hasansalim1868
    @hasansalim1868 Рік тому

    Nice explanation and great graphics.

  • @connecttolanconnlan-2991
    @connecttolanconnlan-2991 9 місяців тому

    Great job! It looks clean, straightforward, and easy to understand. Could you tell me what software you used to create this video? I'm interested in making my own technical videos in the same manner.

  • @ok-alarm
    @ok-alarm 11 місяців тому +1

    how do do you do these animations? its nice and clean!

  • @animeshsarkar295
    @animeshsarkar295 Рік тому +1

    Sir, thank you for such creative tutorials please make one on Spark

  • @RolandEni
    @RolandEni 3 місяці тому

    wonderful video, thanks

  • @gameboyguggu
    @gameboyguggu 6 місяців тому

    Really good video, thank you sir

  • @mth469
    @mth469 8 місяців тому

    Thank you sir.
    Nice diagrams too.

  • @cristobalortizortiz
    @cristobalortizortiz Рік тому

    nice explanation best so far :)

  • @CardanoCastellano
    @CardanoCastellano Місяць тому

    this was great, thanks

  • @tekforge
    @tekforge 8 місяців тому

    I love your presentations! Which tool do you use to create or generate them with such a beautiful animation?

  • @steve6375
    @steve6375 Рік тому +1

    Doesn't grub also load an initrd image as well as the kernel? Where does squashfs fit in?

  • @Stylux-z1p
    @Stylux-z1p 5 місяців тому

    great explanation .

  • @Comanchero_
    @Comanchero_ 4 місяці тому

    It's a great broadcast. I wonder what programme you use to make such videos, the animations are very nice.

  • @dmi3mis
    @dmi3mis 7 місяців тому

    2:19 What is Aid boot v0 ? Is it a some project?

  • @HN-oq3gf
    @HN-oq3gf 11 місяців тому

    thanks for the explanation! this helps!

  • @frunomaol5069
    @frunomaol5069 4 місяці тому

    Thanks, well done. A lot of whinging in the comments, "but this, but that". What do they expect in under 5 mins?

  • @hansvetter8653
    @hansvetter8653 Рік тому

    Great presentation! Thanks!

  • @AndriiKuftachov
    @AndriiKuftachov 10 місяців тому

    I bought your books 📚, but haven't had time to read, by I hope I will do soon.

  • @MarcDunivan
    @MarcDunivan Рік тому +1

    What about the SPI flash? Coreboot/DepthCharge or uBoot and TowBoot?
    What about the details of gdm3 and starting the graphical shell?

  • @terrorgen
    @terrorgen Рік тому +2

    Wonder why there is a stage 1 (initrd) and stage 2 in the Linux boot process

    • @mikhailbrest6385
      @mikhailbrest6385 Рік тому +1

      initrd used to be a ext2/ext3 partition that can be mounted as loop device, now it's just a compressed a cpio archive, usually distro kernel is light and doesn't have network/disk/fs drivers so when the kernel is pushed to memory by grub it can't recognize hw and even mount fs. All needed drivers are stored in initrd image. More over linux thin clients mount root via nfs or nbd and again drivers and glue shell code is stored in initrd. And so called second stage is a chain load when a real hd init process is started and a root pivot is happening.

  • @ThePlayerOfGames
    @ThePlayerOfGames Рік тому +3

    1:40 actual Linux boot process begins at that time stamp, preceding this is just a general description of BIOS/UEFI basics

    • @trueriver1950
      @trueriver1950 11 місяців тому +3

      Yes and no.
      No: The video answers the question "what happens when you boot a Linux machine from cold", so quite correctly included the BIOS/UEFI stages.
      Yes: if you are only looking to understand the part that Linux plays in the boot process start at that timestamp.
      Both are legitimate ways of using this informative video

  • @BerniesBastelBude
    @BerniesBastelBude Рік тому

    thank your for this helpful explanation!

  • @ILLUSTRON-l5v
    @ILLUSTRON-l5v 2 місяці тому

    Nice tutorial

  • @apivovarov2
    @apivovarov2 10 місяців тому

    GRUB2 can be replaced by SystemD-boot too...

  • @jobautomation
    @jobautomation Рік тому

    Thanks! Loud and clear

  • @Treviath
    @Treviath 10 місяців тому

    I think this video could have extended itself to include the graphical boot process. The display manager which boots up the desktop environment.

    • @jonathanjohnston9272
      @jonathanjohnston9272 5 місяців тому

      Right. I use LightDM, which handles the graphical login, let's me select which Desktop Environment I want to use, & starts the DE

  • @gtrxdude
    @gtrxdude Місяць тому

    40 years of using computers and I never knew what POST stood for.

  • @dharundeepak
    @dharundeepak Рік тому +3

    If initramfs also coved in this video then this could be the best one...

  • @davidoflight1313
    @davidoflight1313 11 місяців тому

    Excellent presentation and narration; whats' used for your animations?

  • @KamalcranioBR
    @KamalcranioBR 11 місяців тому

    0:35 that is incorrect. You CAN run GPT with BIOS in most modern CSM implementations.

  • @jairunet
    @jairunet 11 місяців тому

    Thank you for the information, as a follow-up will be great to take a step back and have instructions on how to identify if our system (desktop, laptop, mini PC, or server) supports UEFI for a faster boot, better functionality, and security. Thank you again!

    • @MichaelAbramo
      @MichaelAbramo 11 місяців тому

      That should be something you can look up based on your OS version and your motherboard model.

  • @VasaMusic438
    @VasaMusic438 11 місяців тому

    Great !!!
    more please !!

  • @SurprisedDivingBoard-vu9rz
    @SurprisedDivingBoard-vu9rz 7 місяців тому

    How to run two kernel at the same time. Can you ever switch processor type. Two clocks.

  • @vikastiwari6478
    @vikastiwari6478 5 місяців тому

    Boot process involving in section
    Post
    Bios
    Mbr
    Grub2
    Kernel
    Systemd
    Target
    In simple word
    Allt things available in internet.
    From power on to started all applications how things work this is called boot process.