this post was submitted on 25 Feb 2024
43 points (95.7% liked)

Linux

48287 readers
627 users here now

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

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I'm trying to update my grub boot order back to booting the first option instead of the second, so I run sudo nano /etc/default/grub, but it brings up this, which is not the file I want to edit.

I'm on fedora 38

you are viewing a single comment's thread
view the rest of the comments
[–] Jordan_U@lemmy.ml 30 points 8 months ago (1 children)

This should get you back to defaults:

sudo cp /usr/share/grub/default/grub /etc/default/grub && sudo update-grub

At some point you definitely did accidentally write to /etc/default/grub when you meant to write to /boot/grub/grub.cfg.

There's no shame in that; Grub's configuration process is very confusing and counter-intuitive.

Everybody who has used Linux long enough has stories of breaking their systems in sillier ways, and this didn't even really break your system 🙂.

[–] Interstellar_1@pawb.social 3 points 8 months ago (1 children)

THanks! but I'm getting the error cp: cannot stat '/usr/share/grub/default/grub': No such file or directory when running this.

[–] Jordan_U@lemmy.ml 0 points 8 months ago* (last edited 8 months ago) (2 children)

What version of Ubuntu are you using?

What is the output of the following command?:

dpkg -l | grep grub

If you urgently want your grub menu to default to the first entry that can be done first, but unless that's needed I'd prefer to get to the root of the problem(s) and get a proper fix.

[–] Interstellar_1@pawb.social 3 points 8 months ago (1 children)
[–] Jordan_U@lemmy.ml 2 points 8 months ago* (last edited 8 months ago) (1 children)

Ahh, sorry.

For Fedora it looks like the default /etc/default/grub looks like this:

GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rhgb quiet" GRUB_DISABLE_RECOVERY="true" GRUB_ENABLE_BLSCFG=true

( Taken from https://discussion.fedoraproject.org/t/how-to-regenerate-etc-default-grub/72677/9 )

If you're using LVM / LUKS you may need additional kernel parameters, like resume=... for suspend to disk to work properly.

Please, before doing anything else, post the output of the following:

cat /proc/cmdline

And make a backup of your existing grub.cfg with:

sudo cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg-backup-$(date --iso-8601=s)

Also, be sure that you have a LiveUSB on hand. You don't want to be SOL if we break something and can't boot again without fixing it first.

[–] Jordan_U@lemmy.ml 1 points 8 months ago

Interstellar_1@pawb.social

Sorry again. I wrote this last comment (and this one, TBH) from my phone and "--iso=s" should have been "--iso-8601=s" . I've edited my comment and the command should now work (Making a backup of your grub.cfg containing the date, to the second, in the filename. I did that to hopefully avoid you running the same command again after trying some fixes and accidentally clobbering your backup).

[–] Interstellar_1@pawb.social 0 points 8 months ago

This command doesn't work for me