Most relatable Linux title ever
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
Lesson I also learned when I started out with Linux… don’t fuck with grub unless you really understand what you’re doing! Borking grub is a right of passage imo.
I’m not sure how to fix your issue (I gave up on dual booting and just have windows in a virtual machine, so Windows doesn’t mess up grub).
I always keep backups of the working grub config in case I need to restore. Just boot into a version of Linux on a usb key and copy the working config.
I'll have to give this another try tomorrow when I'm more awake. I probably should have just asked here when I had grub issues in the first place.
Just boot into a version of Linux on a usb key and copy the working config.
So I guess this is what the guides are saying, but I seem to get stuck on the installation step with this error grub2-install: error: this utility cannot be used for EFI platforms because it does not support UEFI Secure Boot
. Hopefully I understand it better once i'm more awake. Thank you though!
You need to turn off secure boot in your bios maybe
Turning off secure boot in bios did the trick for me when I setup Mint with Windows 11.
In addition to GRUB_SAVEDEFAULT
you also need to set GRUB_DEFAULT=saved
.
You should probably follow these instructions from the Fedora Wiki: Reinstalling GRUB.
You could take a look at refind, if you're on a efi system. Refind is a boot manager that can either chainload other Bootmanagers, kernels as well as eny efi bootloader entries. Even if grub is borked. You can probably set it up on a usb stick or even find a rescue distro that uses refind. It's good as a failsafe if you can't get grub to work.
Highly recommend this. It's magic.
Also recommend, refind has saved my dual boot machines more times than I can count
Agreed, I've been using refind for about a year now and it hasn't failed me.
I installed Windows on an isolated drive, connected another drive, installed Linux and refind.
running a quick refind-install in the terminal picked up the windows bootloader and all of the Linux kernels that I have installed.
This is the reason I really like the distros that everyone shits all over for being "just pre-installed software, custom configs, and themes" like mint or Garuda or zorin... Almost all of them come out of the box with a graphical interface for managing grub settings (and most other parts of the OS) so you don't have to faff with getting command line just right, you just select the thing you want from a drop down box and it works.
I'll probably get shit all over myself for saying this though, lol.
Every time someone says experienced users should use a more difficult to use distribution I die a little inside - I happily use Mint, have done for years, why make my life more difficult?
I recently had GRUB issues which I managed to fix so I'm a little fresh in my mind. It's 10pm here so I'll be sleeping soon though.
Check the Arch wiki for how to fix GRUB, it has a lot of helpful tips: https://wiki.archlinux.org/title/GRUB
I put Mint onto a USB and then booted into the Live to be able to have full OS to fix GRUB, rather than using the rescue interface. So definitely do that if you have a spare PC you can use to put an image on a USB.
Here's some other links I saved:
https://bbs.archlinux.org/viewtopic.php?id=283343
https://wiki.archlinux.org/title/GRUB
https://wiki.archlinux.org/title/EFI_system_partition#Mount_the_partition
https://superuser.com/questions/165116/mount-dev-proc-sys-in-a-chroot-environment
And I'll post my commands I used to rebuild GRUB
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82/boot/grub$ find . -name normal.mod
./x86_64-efi/normal.mod
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82/boot/grub$ ls
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82/boot/grub$ vi grub.cfg
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82/boot/grub$ cd ../..
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ sudo mount -o bind /dev dev
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ sudo mount -o bind /proc proc
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ chroot .
chroot: cannot change root directory to '.': Operation not permitted
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ sudo chroot .
[root@mint /]# find . -name grubx64.efi
[root@mint /]# sudo fdisk -l
sudo: unable to allocate pty: No such device
[root@mint /]# exit
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ mount -o bind /dev/pts dev/pts
mount: /media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82/dev/pts: must be superuser to use mount.
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ sudo mount -o bind /dev/pts dev/pts
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ sudo chroot .
[root@mint /]# sudo fdisk -l
[root@mint /]# lsblk
lsblk: failed to access sysfs directory: /sys/dev/block: No such file or directory
[root@mint /]# exit
exit
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ sudo mount -t sysfs /sys /mnt/sys
mount: /mnt/sys: mount point does not exist.
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ sudo mount -t sysfs /sys
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ sudo mount -t sysfs /sys sys
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82$ sudo chroot .
[root@mint /]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 2.6G 1 loop
sda 8:0 1 14.6T 0 disk
└─sda1 8:1 1 14.6T 0 part
sdb 8:16 0 476.9G 0 disk
└─sdb1 8:17 0 476.9G 0 part
sdc 8:32 1 232.9G 0 disk
├─sdc1 8:33 1 223.1G 0 part
└─sdc2 8:34 1 9.8G 0 part [SWAP]
sdd 8:48 1 14.6T 0 disk
└─sdd1 8:49 1 14.6T 0 part
sde 8:64 1 29.1G 0 disk
├─sde1 8:65 1 2.8G 0 part
├─sde2 8:66 1 4.1M 0 part
└─sde3 8:67 1 26.4G 0 part
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 500M 0 part
├─nvme0n1p2 259:2 0 2G 0 part
└─nvme0n1p3 259:3 0 929G 0 part /
[root@mint /]# fdisk -l
[root@mint /]# mount /dev/nvme0n1p1 /efi
[root@mint /]# grub-install --target=x86_64-efi --efi-directory=efi --bootloader-id=GRUB
Installing for x86_64-efi platform.
Installation finished. No error reported.
So for a step by step,
I booted into Mint and opened a terminal and cd to my OS drive.
I checked my grub folder:
mint@mint:/media/mint/a96b3354-70dd-45ed-8c6c-95171e9f1e82/boot/grub$ ls
fonts grub.cfg grub.cfg.broke grubenv locale themes x86_64-efi
made an edit with vi (irrelevant here)
went back to / on my OS drive
mounted the various partitions needed, that's all the mount -o bind commands, dev, proc, dev/pts, sys
then chroot to my OS drive so that I'm working inside my Arch install not the Mint install
then I mount the efi and grub install
[root@mint /]# mount /dev/nvme0n1p1 /efi
[root@mint /]# grub-install --target=x86_64-efi --efi-directory=efi --bootloader-id=GRUB
I wish you all the best. The way I avoid dealing with this on my own PC is I use separate physical drives. I unplug one, install OS, swap, install the other OS, and just use BIOS to choose which drive to boot from. I find that to be a lot less of a headache.
More specific questions might be better than my mess above:
The guide I mentioned above seems to be the guide a few other forums reference. Is there a boot repair tool for Fedora KDE Plasma?
Alternatively, I am able to make it to the last step of the regular guide, where I need to run
sudo grub-install --boot-directory=/mnt/boot --bootloader-id=ubuntu --target=x86_64-efi --efi-directory=/mnt/boot/efi
I get a sudo: grub-install: command not found
message. Since I'm on Fedora and not Ubuntu, what would be the correct command for me, assuming that's the reason. I didn't think it would work, but I tried just swapping 'fedora' for 'ubuntu' and got the same error
edit: Got a little further by using grub2 instead: sudo grub2-install --boot-directory=/mnt/boot --bootloader-id=ubuntu --target=x86_64-efi --efi-directory=/mnt/boot/efi
, but got a new error:
grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist
edit: Got a little further by running sudo dnf install grub2-efi-x64-modules
. Now when I run that command, error is
grub2-install: error: this utility cannot be used for EFI platforms because it does not support UEFI Secure Boot.
secure boot is definitely off, so I'm stuck again
Did you try: sudo update-grub
Honestly, if you're new to linux, the best way to recover from borked GRUB is to reinstall linux. You can boot from a live CD, mount positions, chroot, and fix it, but I found that more difficult than reinstall until I had a bunch of experience.
Right, and while in the install process, and the installer detects there is another os in your drive, "tell" the installer (there will be the option to do this) that you want both systems and choose the order of prefered booting. It is the simpler way for a new user.
I have been using linux since 2000 year and at firts had to learn how to configure lilo to get my cdrom working. When distros changed to grub i quit learning that stuff. Used my time learning other things, like R or chempaint.
No one should begin tinkering with grub and other sensitive parts of your system, begin with the command line and system tools first.
It's been years since I dual booted. If you want Windows to be default I'm struggling to think of what could be gained by dual booting over just running your Linux system in a vm in Windows.
If you're like me you'll want to dual boot because two games you play often enough are Windows only (easy anti cheat). That and of course I use one or two software as daily driver that are Windows only
I would not recommend dual booting Fedora, it doesn't like it. You're better off with Mint or any Ubuntu flavour where the installer will setup dual boot easily.
That's probably what I'll do in the future.
Would Kubuntu be ok?
Yes it would be fine
Me, yesterday:
Welcome to dual booting with Windows! Best advice I can give is try to keep Windows away from your Linux drive as it doesn't like to share. A 2nd drive for your Linux install can save a ton of headache (I went so far as to put Windows on my old PC when I upgraded).