How do I fix grub?

Forum Forums New users New Users and General Questions How do I fix grub?

  • This topic has 9 replies, 4 voices, and was last updated May 3-5:34 pm by BobC.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #21063
    Anonymous

      This is my first post. Hi everyone, I really like how antiX works on my x64 bit laptop, but I still have problem I’d like to fix. I realized my text post was long, sorry, I hope it is readable. Also, I like to add a secondary question: did I install antiX correctly?

      I’ll divide it into parts because I don’t really know how to describe it… anyway.

      Pre-antix installation:
      As a newbie in using Linux, I decided to install Lubuntu as a dual boot on my Lenovo n585 alongside with its pre-installed Windows 8, I did not choose “something else” in the installer hence I don’t know what Lubuntu did to successfully install itself and its grub manager. Its Calamares installer was run through UEFI.

      After tinkering Lubuntu, I just decided to replace Lubuntu with antiX because I don’t like how the said OS still lags from time to time.

      Installing antiX:
      Now, when I installed antiX thru a live-USB, I did not manually clear or reformat the /dev/sda# my former OS is in, instead, I just did these three instructions in the antiX installation thru gparted.

      1-Delete ext4 where Lubuntu was
      2-New partition for the said ext4
      3-New partition from that ext4 for swap

      I remember not touching the boot selection and leaving it as it is as “root” with MBR selected.

      Post-installation of antiX:
      My laptop current starts at a broken grub screen with “grub>_” and “minimal BASH line is supported…” line.

      I can’t select which OS to boot with, unless I access the BIOS menu and manually select either the Windows Boot manager or the antiX live-USB. I’d like to take note that there are two options there that are labeled as Ubuntu, wherein if I selected those it just goes back to my broken grun screen.

      Other details on what I did:

      1- I tried to use the boot-repair app from the live usb, I went on reinstalling grub option and I did not change anything and still selected MBR. There were two locations presented: the drive as a whole in the first option and the /dev/sda#. For the second option, it defaults into the # where I had my antiX was installed so I just went with it. It doesn’t fix my problem, I got a successful confirmation but the problem is still there.

      After reading on other forums, it seems like I need to reinstall grub, but often they point out that I need to intall it in /dev/sda. But I can’t find it, even in the gparted app. It just shows /dev/sda#1-10.

      2- When installing antiX, I remember indicating that the grub should be installed alongside the root of antiX sda#.

      And yes, even if I had the grub manager working on pre-installation, I still selected to install grub.

      3- A minor issue, I now hear a distinct scratch from the inside of my laptop, I just want to hear if there’s any problem with that, I think it might damage my laptop’s driver.

      That’s all whay I could write, I hope there’s a fix. Thank you.

      #21072
      Anonymous
        Helpful
        Up
        0
        ::

        As a newbie in using Linux … dual boot … I don’t know what Lubuntu did … UEFI … not touching the boot selection and leaving it as it is as “root” with MBR selected … My laptop current starts at a broken grub screen with “grub>_” … I can’t select which OS to boot with …

        Sorry to say but, I doubt very much that anybody here is gonna take as much time, as it would be necessary to help you on that matter.

        The only way to explain you the whole process correctly would be: somebody takes similar Lenovo and does the whole process from scratch, with all the images and text needed to explain you the very basics. There are some computer magazines (German c’t) which write some 10+ pages to explain the proper installation process to those who understand the basics already — and you don’t.

        You can’t get properly booting system, installed on UEFI but, not touching MBR — either it’s MBR/CSM or it’s UEFI w/ or w/o secure boot. Also, it doesn’t matter what boot manager controls the boot sequence — Windows boot manager can pass the sequence to Grub, same as the other way round but, you need SOME boot manager that’s properly installed and you need the properly installed O/S itself that can be started at all or you’ll end up on some prompt — either Windows or Grub/Linux.

        Also, you can’t compare Ubuntu installer with any other installer out there. The only ‘smart’ installer is the one from Ubuntu and it’s the only one where you can do: “Install beside …” with completely 0 (zero) knowledge/effort.

        Installing two Linuxes beside each other is already a problem enough — If you try to install Fedora and Ubuntu beside each other, one boot loader will kill the another one. That’s progress. 😉

        Now, the easiest way to help you to help yourself would be:

        1. Simply put the backup image, which you made before you started fiddling with dual-boot, back to your HDD/SSD, and you’re up and running.

        2. Since you probably didn’t make that image before starting, try to boot in Windows first.

        Since it’s installed in UEFI mode, you’ll have FAT32 partition (for UEFI), Windows recovery partition and the system partition.

        There might or might not be 2 more partitions: Data partition and or OEM partition (Lenovo might have it).

        Once in Windows, check what you have and delete all that’s not FAT32/NTFS (Unknown to Windows).

        Be careful on what you do there.

        You see ‘Virgin Win 10’ on the 1st screenshot.

        Nobody can say how it looks in your case since it depends who made your install, was it a ‘clean’ install or udated Win 7 …

        On the 2nd screenshot, you can see the same Windows 10 edition but here, it started with Win 8.1 and then it got upgraded to 10.

        On the 3rd screenshot you can see Win 7 to Win 10 upgrade … 1. and 3. are MBR, 2. is (U)EFI (99 MB shows it) … What I wanna say — don’t trust and retype blindly.

        After that, you’d like to start from the boot media (Windows 8 / 8.1 — those are 2 different O/S!) and let it auto-repair the boot manager.

        Windows can usually fix it but, if not, you can still do the upgrade repair which will then fix your Windows install.

        Now you should have a properly working Windows to start with.

        You’d like to make an image of it.

        There are many programs that can do it but, easiest, quickest and the most reliable (Windows backup) is Acronis True Image.

        That way, you’ll ensure that you have a backup of your system and that you can start fiddling around with it, without being scared if something goes wrong.

        Make sure you execute the both commands from the 4th screenshot first though; sfc and chkdsk.

        ‘System File Check’ is System health check.

        ‘CHecK DiSK’ will check the integrity of file system.

        If it happens that you end up in a loop, where one check finds some errors which it can’t repair and tells you, you should execute the other one first (which then tells you to run the first one first again) — don’t bother repairing. Repair is still possible but, it takes more time than 3 fresh installs.

        If you can speak German, the very best site on anything Windows related is: Deskmodder

        If they don’t have a solution on how to fix something, then there’s no solution.

        Addendum:

        5th screenshot showing how to check and repair Windows 8 / 8.1 / 10.

        1. sfc /scannow — tells you it found errors but, it’s unable to repair them

        2. chkdsk /x /f /r — checks and repairs the filesystem upon reboot

        3. sfc /scannow — another check with same result as 1.

        4. Dism /Online /Cleanup-Image /CheckHealth — checks the registry and finds that it’s not corrupt

        5. Dism /Online /Cleanup-Image /ScanHealth — scanns for files that are corrupt and need to be replaced / it returns: can be repaired

        6. Dism /Online /Cleanup-Image /RestoreHealth — uses Win Update to replace the corrupt files and returns success

        7. sfc /scannow — checks the system again and returns successful repair

        #21074
        Moderator
        BobC
          Helpful
          Up
          0
          ::

          I think what happened was that when you installed lbuntu, it installed grub, but then you deleted that operating system, so now it can’t find it to boot.

          I think what you need to do is boot from USB again, go to control centre and run the boot repair, and on the first window leave the default first button to install grub to the hard drive. On the 2nd screen on an EFI system I would expect that the boot method would be the ESP option, and then the location would be your main drive like sda and default the boot location to your antix partition like sda3 or sda4 assuming windows was taking up sda1 and sda2 for example. In the pic, I can’t select ESP because this machine doesn’t have EFI.

          • This reply was modified 4 years ago by BobC.
          • This reply was modified 4 years ago by BobC.
          Attachments:
          #21084
          Member
          fatmac
            Helpful
            Up
            0
            ::

            I agree, your bootstrap is looking for its matching grub files, which you have deleted, so you will need to install grub to the MBR, not the root of your new distro, as you don’t have a chain loader installed.

            Linux (& BSD) since 1999

            #21085
            Anonymous
              Helpful
              Up
              0
              ::

              Thanks for the efforts in helping me. I now had antiX installed and its grub manager, but now I have a new problem.

              As suggested by @BobC, I chose ESP instead of MBR and it automatically chose /dev/sda2, I don’t know why but it’s not a recovery or my Windows OS so I just went with it.

              My new problem is how do I add the option to boot into Windows when I’m in grub. Currently, it has options to boot into antix w/ or w/o advance settings and system setup. The only way I could access Windows 8.1 is to change the boot priority in booting its boot manager first.

              I might just ask it on an another thread next time, but if there’s a solution already then that would be great.

              Thanks, especially to @BobC.

              #21087
              Anonymous
                Helpful
                Up
                0
                ::

                Wait, what? I could go for another fresh install if it can fix my new problem. I was late when I saw your post, so please excuse my hastiness.

                I did select root instead of a proper partition when installing grub on my first install of antiX. I just really don’t know what other place I could install it to because I can’t find my /dev/sda.

                I now think my /boot folders are in /dev/sda2 after I installed it with the option of ESP…

                Anyway still, thanks.

                #21092
                Anonymous
                  Helpful
                  Up
                  0
                  ::

                  It seems to me that you ended up with what you don’t want to have — mixed CSM & UEFI setup.

                  In Windows you can check it through Msinfo32.

                  If you are in UEFI mode, it’ll return something like: “Safe state”, “UEFI” and such; otherwise it’ll mention “Legacy” or “CSM”

                  In Linux you can check it through command efibootmgr.

                  If it returns UEFI boot variable, it’s booting in UEFI mode; otherwise, if it returns something like “EFI variables are not supported on this system”, you’re in “BIOS-mode”.

                  #21101
                  Moderator
                  BobC
                    Helpful
                    Up
                    0
                    ::

                    Yes, you could reinstall antiX but I think the result might be the same. Usually EFI systems are setup to boot to EFI, but sometimes the system setup gets changed to boot other ways. It would be helpful to know the brand and model of the machine as well as the setup boot options in place. A search on the manufacturers website might reveal where the problem is there.

                    PS: the fact that you were able to boot to windows using some other method says that it still is on the drive and intact enough to boot, but I don’t understand why antiX grub didn’t find it. Hopefully you have anything important backed up, because when you start changing, moving, resizing, or deleting partitions it is likely to cause loss of data if any mistakes are made (I have made mistakes myself and lost stuff, and I don’t want to get blamed for yours).

                    PSS: I did a search, and found a thread on what looks to be your current problem. The one solution suggests checking an option to rebuild windows boot files, but I don’t see that on antiX’s boot repair screen (this machine isn’t EFI might be why). They also had another way to fix it.

                    To be honest we are beyond my technical knowledge level, where I would be experimenting, so you would be wise to wait for a reply from someone that really KNOWS the boot and boot repair.

                    • This reply was modified 4 years ago by BobC.
                    • This reply was modified 4 years ago by BobC.
                    • This reply was modified 4 years ago by BobC.
                    #21112
                    Anonymous
                      Helpful
                      Up
                      0
                      ::

                      Wish you luck!

                      #21148
                      Moderator
                      BobC
                        Helpful
                        Up
                        0
                        ::

                        I still think:

                        1. trying the reload of antiX and telling it that its an EFI machine, and to install grub (can’t hurt to try that)
                        2. reloading lbuntu to use its boot manager, then once it works, install antix and then go back and update lbuntu’s boot manager to also show antix (not a pretty solution, but should work)
                        3. go and add the text code from the link where they added the windows EFI boot to the grub custom cfg file manually (I went and tried it on my one UEFI machine, and it could probably be tweaked to work if you knew the right parameters, but I don’t)

                        All look like possible solutions if nobody else will help.

                        Ok, I threw in my best suggestions. I guess you either keep searching and trying, or reload. Sorry if I can’t be more help.

                        PS: I thought some more about this. I don’t give up easily, LOL…

                        If you now can boot into antiX on the hard drive, then I think you could do that, then go to a terminal and run
                        sudo update-grub
                        I think it will rebuild your grub menu and hopefully it will find and include windows when it does. I think you will see the operating systems found on the terminal screen, and if it finds windows it will set it up as a boot option.

                        If that didn’t work, I figured out how to do that option 3 above on my EFI windows 10 dual boot machine. Of course the parameters might not be exactly the same on yours… Basically, as root, you need to create a file /boot/grub/custom.cfg and then it will appear as a menu option at the bottom of the grub boot menu:

                        # custom.cfg - test manually created windows 10 boot option
                        #
                        # at grub menu, if you do a 
                        # c[Enter] 
                        # to get a command screen, 
                        # then 
                        # ls[Enter]
                        # to see all the possible partitions, 
                        # then look for the lowest partition number of the first hd,
                        # which in my case was (hd0,gpt1), so then I do an
                        # ls (hd0,gpt1)/[Enter]
                        # to see what is in there and see EFI, so then do an
                        # ls (hd0,gpt1)/EFI/[Enter]
                        # to see what is in there and see Microsoft, so then do an
                        # ls (hd0,gpt1)/EFI/Microsoft/[Enter]
                        # to see what is in there and see Boot, so then do an
                        # ls (hd0,gpt1)/EFI/Microsoft/Boot/[Enter]
                        # to see what is in there and see bootmgfw.efi which is what needs to run
                        # based in what the standard grub install generated for my machine
                        # in gparted that windows partition appears as /dev/sda1
                        
                        menuentry 'Test /boot/grub/custom.cfg UEFI Windows Boot Manager (on /dev/sda1)' {
                        	insmod part_gpt
                        	insmod fat
                        	set root='hd0,gpt1'
                        	search --set=root --file /EFI/Microsoft/Boot/bootmgfw.efi
                        	chainloader /efi/Microsoft/Boot/bootmgfw.efi
                        }
                        

                        And now I will also say good luck, but to be honest I think one of these will work 🙂

                        • This reply was modified 4 years ago by BobC.
                        • This reply was modified 4 years ago by BobC.
                      Viewing 10 posts - 1 through 10 (of 10 total)
                      • You must be logged in to reply to this topic.