Disaster Recovery when GRUB dies

Поділитися
Вставка
  • Опубліковано 19 тра 2024
  • Preparation, and knowing how to restore GRUB, can save you from an unbootable system. Here's a couple tips on recovery, and how to chroot into your broken system to restore GRUB.
    ---- Commands to chroot ------------------------------------------------------------------
    sudo mount /dev/(DEVICE HERE) /mnt
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /sys /mnt/sys
    ALSO don't forget to mount your BOOT EFI partition if you have a UEFI System
    finally to get internet working (I made a typo in the video, there no 'e' in resolv):
    sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
    ---------------------------------------------------------------------------------------------------------------------
    Links:
    TimeShift video : • Backup Linux with TIME...
    Recovery with TimeShift : • How I fixed my bootloa...
    Gparted Live : gparted.org/livecd.php
    Arch-based Distros : wiki.archlinux.org/index.php/...
    Patreon support : / doriandotslash
    Music by MrGamer (@AndreasRohdin): / gamermachine
  • Наука та технологія

КОМЕНТАРІ • 37

  • @novikovPrinciple
    @novikovPrinciple 4 роки тому +15

    Basically me everytime Windows 10 rolls out another "necessary" update and screws up my dual boot

    • @Doriandotslash
      @Doriandotslash  4 роки тому +8

      Hah yeah that can happen. I completely got rid of Windows not that long ago. No regrets!

    • @Selbstdenkender
      @Selbstdenkender 3 роки тому

      That's why I stopped using Windows and started using qemu/KVM to run Windows programs in a VM in Linux. I recommend it.

  • @thenextpoetician6328
    @thenextpoetician6328 4 роки тому

    Good to know the CLI solution. I gave myself major problems within days as a noob late last winter, and went with SuperGrub2 because it's just too easy. Saved my system many times.
    In the last few weeks I've installed Regolith, then i3wm alongside Mint Cinnamon, then ArcoLinux with i3, xfce, and OpenBox. I'm in a bit over my head, but that's one way to learn to swim. It's the space-efficiency and compartmentalization, and inherent focus. Without tiling, every window starts in competition with every other to be in front. Tiling is shoulder to shoulder. Small t truth is that set of inter-locking universalizable principles of Reason governing all relations and actions. So it fits. It's a way of thinking. I'm finding quirks of the system. :-o)

    • @Doriandotslash
      @Doriandotslash  4 роки тому +1

      Getting in over your head is sometimes the best way to learn ;) I find i3 ok, but it's just a personal preference to not use it. I tend to forget keybindings easily lol

    • @thenextpoetician6328
      @thenextpoetician6328 4 роки тому

      @@Doriandotslash The thing is they're not universal. First Rule for me is refresh the system don't reload it. If I had a memory for CLI procedures that would be my preference. You make it easy to follow along. Great choice on the new CPU.

    • @Doriandotslash
      @Doriandotslash  4 роки тому +2

      @@thenextpoetician6328 Thanks! The real appeal was being able to upgrade to a newer/better CPU without having to change the motherboard :)

    • @thenextpoetician6328
      @thenextpoetician6328 4 роки тому

      @@Doriandotslash Right arm. Saves bucks for now, and it's a chip which will be supported for years if you just decide you can't live without some fancy new features down the road. :)

  • @mamartin2966
    @mamartin2966 4 роки тому

    Great video and a plus for the commands in the description.
    1) why do you use ./ before the path when removing grub catalog? (rm -rf ./grub)
    2) how do you screen capture when a PC is rebooting to see BIOS booting, Grub, and so forth - is it like some external recorder/grabber?
    3) couldn't you just recreate a grub config without installing it?
    4) I think you can also use in Mint/Ubuntu/Debian when booting grub (if you have other problems than grub itself) to use Advance Options -> recovery (or similar) to fix some system issues, no to reinstall the system as advised in the end of the video.
    Thanks

    • @Doriandotslash
      @Doriandotslash  4 роки тому

      Thanks!
      1) The dot slash ./ means the current directory you're in. It's force of habit for my to use it all the time and just ensures I'm calling the right file. There isn't always a need for it.
      2) Yes and external screen recorder.
      3) Yes you could, but reinstalling it also helps in case grub itself is corrupt. You could skip that step and see if it works, and if not, then reinstall grub. But I find it just saves time to do both.
      4) Correct. Most distros give you a recovery option, however, that doesn't help if grub won't even start at all.

  • @hammerheadcorvette4
    @hammerheadcorvette4 3 роки тому +2

    I'd like to see systemd-boot video if possible

  • @maxsilvester1327
    @maxsilvester1327 3 роки тому

    If you use an arch live cd, you can just mount the partitions and do arch-chroot. This will do all bind mounts automaticaly and then chroot. I think manjaro-chroot works as well but I haven't used it

    • @Doriandotslash
      @Doriandotslash  3 роки тому

      True. But even though I am an Arch user, I'm well aware that Arch isn't for everyone. Gparted gives you some graphical tools to work with.

  • @GuyPipili
    @GuyPipili 3 роки тому +1

    You should also talk about ventoy where it's easy to put multiple iso on one thumbdrive very easily.

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

    Thanks!

  • @djsensacion7
    @djsensacion7 4 роки тому

    Great video ! Could I request an update on your Fedora 30 Silverblue experience?

    • @Doriandotslash
      @Doriandotslash  4 роки тому +1

      Other than the Silverblue Update video I posted? I'm still using it on my main laptop and it's still running great and I have no complaint about it at all! I would definitely recommend it for a regular desktop distro any day.

    • @djsensacion7
      @djsensacion7 4 роки тому

      @@Doriandotslash I'm currently on F30 workstation and have been looking into possibly making the leap, but I have steam with proton & Lutris running great, so I don't want to break that current install. I do like the Atomic concept and containers for development. I guess toolbox would replace the use of systemd-nspawn or but I also sandbox apps like Firefox using sandbox from selinux. So my use case is different from a normal user

    • @Doriandotslash
      @Doriandotslash  4 роки тому +2

      @@djsensacion7 Yeah the gaming might be affected, but there is a Steam flatpak that works great, and you can install graphics drivers as a package layer on top of the OS. But if you were to try it out or even try it as a dual-boot, I'd strongly recommend doing a full backup of your drive first, just in case.

  • @maxsilvester1327
    @maxsilvester1327 3 роки тому +1

    I think the kernel unmounts everything automatically on reboot/shutdown

  • @shorthornstudios
    @shorthornstudios 4 роки тому +2

    One time I had a grub issue on my experiment linux machine so I reinstalled linux.

  • @aprilmintacpineda2713
    @aprilmintacpineda2713 4 роки тому +1

    How are you recording your screen even when your PC is booting up?

    • @Doriandotslash
      @Doriandotslash  4 роки тому

      External video capture onto my production machine.

  • @Tomyb15
    @Tomyb15 4 роки тому

    How different is the process if you have systemd boot instead of grub like with Pop-os!

    • @Doriandotslash
      @Doriandotslash  4 роки тому

      It should all be the same with regards to mounting and chrooting. The difference would be that instead of installing grub, you install systemd-boot with the bootctl command and point it to the esp folder. The entire point of chroot'ing here is like bypassing the failed boot by cheating and using another disk to boot, then entering the OS from there.

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

    If you accidentally delete the folder containing Grub in it, can't you just boot into the live environment and recover the folder using Testdisk? Wouldn't that be a lot easier?

  • @pctlc
    @pctlc 4 роки тому

    Excellent video!!

  • @mehedyhasan4952
    @mehedyhasan4952 4 роки тому

    Please make this video for manjaro or arch basd distro with BIOS

    • @Doriandotslash
      @Doriandotslash  4 роки тому

      The steps are the same. Except during the grub reinstallation. For that part you just need to follow the boot loader section of the Arch Install Guide.

  • @Reziac
    @Reziac 4 роки тому

    Good info, tho guess how many of us will remember all those steps :)
    What happens if you don't manually unmount everything before you reboot?
    Back when I had Mint 17 installed... it had this horrible bug (possibly driver-specific, but I gather inherited from Ubuntu; apparently since fixed) where if you would just LOOK in the video config -- just look, don't touch anything -- GRUB would commit seppuku. (Reproducible.) At the time someone in the Mint forum recommended a bootable fixit utility that didn't require any commandline knowledge; just boot it up, pick the obvious option, let it churn for a bit, fixed. I'll have to see if I can find it again; it was much easier than all this, cuz all you needed to know was how to boot from external media. It may have been Ubuntu-family specific; I don't recall by now.
    [After the second such adventure, Mint left the building, and I now use PCLinuxOS.]

    • @Doriandotslash
      @Doriandotslash  4 роки тому +1

      I put the commands in the description which you can print and keep with a recovery stick if you really needed to. Unmounting probably isn't a huge deal since the LiveUSB *SHOULD* unmount everything when rebooting/shutting down, but that's not a guarantee depending on what distro you're using. The fixit stick is all fine for Mint and maybe other Ubuntu-based distros, but it probably won't help you with Fedora, Gentoo, Arch, and all their derivatives. Knowing how to do this is just a 'good to know' skill, because what if that fixit stick doesn't work? You fix it yourself.

  • @RayVermey
    @RayVermey 4 роки тому +1

    Great instructional video! Thanks (/etc/resolve.conf != /etc/resolv.conf though :-) )

  • @realwizardry834
    @realwizardry834 4 роки тому +2

    You literally spend about 20 seconds in grub rescue mode. Come on man. The whole video can be summarised as 'use a live CD/USB image of any distro to re-install grub'.

    • @Doriandotslash
      @Doriandotslash  4 роки тому +6

      Actually I never used grub rescue mode at all. The point of this video is to help people who aren't familiar with this, so you obviously don't fit the mold here.