#Grub not booting to OS

247 messages · Page 1 of 1 (latest)

main condor
#

I was getting some issues with Java so I decided to do "sudo pacman -Rsc jre-openjdk" (sudo pacman -R jre-openjdk didnt work because i had jre18-openjdk=18.0.2.u9-1 as a dependency) and now whenever I try to perform 'sudo pacman -S jdk-openjdk' I cannot because it saays that all of the files of "jre-openjdk-headless" already exists in the filesystem, is there anyway to remove these? I know that it isn't a good idea to manually remove pacman files. Any help is greatly appreciated!

untold nymph
#

remove jre-openjdk-headless

#

btw it's dangerous to use the c option

       -c, --cascade
           Remove all target packages, as well as all packages that depend on one or more target packages. This operation
           is recursive and must be used with care, since it can remove many potentially needed packages.
#

you told pacman to remove everything that requires java basically

main condor
#

The files that it removed was java-environment-common-3-3 jdk-openjdk-18.0.2.u9-1 openjdk-doc-18.0.2.u9-1 openjdk-src-18.0.2.u9-1 tlauncher-tl-999-0 worldpainter-2.8.1-1 jre-openjdk-18.0.2.u9-1

untold nymph
#

i usually remove things with -Rns (don't keep config files, remove packages that only this package requires and which i haven't manually installed)

main condor
untold nymph
#

pick one of the files that it's telling you already exists on the file system and do pacman -Qo <file>

#

this will tell you which package owns the file

main condor
#

Claims that nobody owns it

untold nymph
#

what about pacman -Qo /usr/share/licenses/java-openjdk

untold nymph
# main condor

oh you didn't use the right path in these commands, i would recommend copy/pasting them

untold nymph
main condor
#

huh ig you dont need superuser to run -Qo

#

pacman -Qo works itself though, tested it with neofetch and htop and it works fine

untold nymph
#

well it seems like somehow you've ended up with java files on your system that aren't owned by a package, in this case there are 2 options:

  • use the --overwrite option with pacman to tell it to overwrite files that already exist
  • or manually delete these files that are conflicting
main condor
#

is manually deleting pacman files safe?

untold nymph
#

they aren't pacman files

#

and it's usually a bad idea, but in this case, it would be safe to rm -rf /usr/share/licenses/java-openjdk for example

#

but you might wanna just let pacman handle it with --overwrite '*'

main condor
#

oops already did rm -rf

untold nymph
#

it's fine

#

sudo pacman -S --needed --overwrite '*' jre-openjdk

main condor
#

didnt even know about those pacman tools

#

wait.. i might be able to run sudo pacman -Syu for the first time in about 3 years

untold nymph
#

lol

#

that's a long time without updates...

#

do you use grub as your bootloader?

main condor
untold nymph
#

if you haven't updated in 3 years then remember to re-run the grub-install command to update the grub executable on your EFI partition

#

.aw grub

shy mantleBOT
untold nymph
#

on some systems grub will brick itself if you don't

#

and you'd have to chroot in from a usb

#

to fix it

main condor
#

should i do it after i update everything?

untold nymph
#

yeah, before rebooting

#

you'll want to update your pacman config file

main condor
#

should i update my pgp keys?

untold nymph
#

yeah it may ask you to do so
also, if you get an error about unable to verify the signature of a package, run sudo pacman -Sy archlinux-keyring then do your Syu again

main condor
#

what? my partitions shouldn't have changed

untold nymph
#

you have to give it argmuents

#

see the arch wiki link

main condor
#

oh youre right i forgot

#

i could just bang it

untold nymph
#

i can help you figure out the right args if you don't know what to put

main condor
#

not sure what my mount point is

#

assume its sda1, right?

untold nymph
#

show lsblk -f

main condor
#

my sda1 is EFI, sda2 is swap and sda3 is normal files

#

i have an sda4?

untold nymph
#

also show ls -R /boot/efi

main condor
#

rest are microsoft files

untold nymph
#

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --no-nvram should do

main condor
untold nymph
#

do it with sudo

main condor
#

there it goes

#

do you need sudo to go through EFI partitions?

#

like it wont even detect it?

untold nymph
#

you mean grub-install?

#

efi directory should be owned by root so it needs root to write to it

main condor
#

is there anything else i should do?

untold nymph
#

run sudo mkinitcpio -P and sudo grub-mkconfig -o /boot/grub/grub.cfg for good measure

#

then you should be good to reboot

main condor
untold nymph
#

i don't know what pkgctl is, but this is normal message from SSH when you connect to a server for the first time

#

if you want to be very secure, you're supposed to double check the key matches what it's supposed to be

main condor
#

it gave an error anyway

#

do you think i'd be fine without it?

untold nymph
#

what is pkgctl

#

i don't know what this command does lol

main condor
#

assume its package control?

#

new version of asp

untold nymph
#

ohh

#

you don't need to follow that part of the news

main condor
#

oh ok

untold nymph
#

just need to sudo cp /etc/pacman.conf /etc/pacman.conf.old && sudo mv /etc/pacman.conf.pacnew /etc/pacman.conf

main condor
#

and i should be good

untold nymph
#

yeah

main condor
#

there was a warning that said ```Warning: os-prober will not be executed to detect other bootable partitions.

i assume its fine?
untold nymph
#

yeah

#

os-prober is a grub feature that lets it scan for other operating systems and show them as options in the boot menu

#

so like you could boot windows from the grub menu if you wanted to

#

it's just telling you that's disabled

main condor
#

Uh it's not booting right now and my laptop monitor is busted

untold nymph
#

what do you mean busted?

main condor
#

It's been broken, been using an external monitor to fix it and it's been fine

untold nymph
#

oh

main condor
#

May be screwed

untold nymph
#

is arch your default boot option?

main condor
#

Should be

untold nymph
#

try pressing enter a couple of times

main condor
#

I've always booted to it by default

untold nymph
#

you might be in the grub menu

main condor
#

Arrow keys and pressing enter doesn't work either

untold nymph
#

did you press any keys before pressing enter

main condor
#

Don't think so

#

Oh I'm in grub rescue

untold nymph
#

hmm, it looks like something's broken with grub

#

are you able to go into the bios menu and see that properly on the second display?

main condor
#

Think it's "grub_is_lockdown not found'"

untold nymph
#

we updated the bootloader and the grub config file, so my only idea is that maybe the firmware boot option should've been updated (no --no-nvram option)
to fix this you'll need to boot archiso from a USB

#

actually, no, that wouldn't be the issue

#

because grub is being started

main condor
#

Should I try to chroot in?

untold nymph
#

yeah

#

i hope you have USB higher in the boot order than Arch's GRUB

#

might be hard to change the order when you can't see half the screen

main condor
#

Also my screen is about to burn in on the other side

#

I may try to brute force find my bios options

untold nymph
#

though, it may be necessary to mess with boot options anyway

#

it seems like this could be an issue with the firmware boot entry

#

my troubleshooting idea after chrooting in will be to run grub-install again without --no-nvram

#

but you will probably end up with 2 boot entries for grub

#

and you'd need to try each

#

you can modify boot order in linux though

#

if you can get the usb booted

main condor
#

I think I have to let it cool

#

The sides at times just get brighter

#

Assume it's on the brink of burning out

untold nymph
#

what happened to this poor laptop

main condor
#

Not even sure honestly

#

Got it in USB

#

I'm actually shocked the screen didn't burn out

untold nymph
#

lol

main condor
#

Can you walk me through chrooting?

untold nymph
#

sure

#

show lsblk -f

main condor
#

Sda3 has all my main files

untold nymph
#
mount /dev/sda3 /
mount /dev/sda1 /boot/efi
#

oh wait

#

that's wrong

#

sudo umount /dev/sda3 and sda1 if you already did it

#
mount /dev/sda3 /mnt
mount /dev/sda1 /mnt/boot/efi
main condor
#

Got it

untold nymph
#

arch-chroot /mnt

main condor
#

Done

untold nymph
#

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB2
explicitly naming it GRUB2 instead of GRUB, this is optional but you're gonna have 2 grub entries anyway so might as well label them

main condor
#

Is chrooting that easy?

untold nymph
#

yeah

main condor
#

Should I do anything else while I'm in here?

untold nymph
#

yes

#

show the output of efibootmgr

main condor
#

Used to dualboot but scrapped it (hence the sda4)

#

Oh wait

#

There's a grub 2 below the windows boot manager

#

Don't know why it wasn't showing

untold nymph
#

okay i was confused

#

are there any more entries?

main condor
#

Nope

#

Grub, windows, grub 2

untold nymph
#

what is the bootnum of GRUB2

#

like 0000, 0001, i assume it's 0002?

main condor
#

Wait why can't I just replace the command with just 'GRUB' and overwrite it?

main condor
untold nymph
main condor
#

Uh

untold nymph
#

efibootmgr --bootorder 0002,0001,0000
this will make the GRUB2 entry top priority, then the windows one, then the old GRUB, you can arrange them how you like but put 0002 as the first one

main condor
untold nymph
#

restart isn't a command

main condor
#

You're right

#

It's reboot, forgot

untold nymph
#

and grub-mkconfig -o /boot/grub/grub.cfg

main condor
#

Did it first on accident

#

Is it fine if I do it then do it again?

untold nymph
#

which

untold nymph
#

yeah

main condor
#

Oh NVM

#

Misread

#

Got it

#

Reboot now?

untold nymph
#

yeah

#

i don't remember if you can reboot from inside the chroot, if not, then just do exit then reboot

main condor
#

You have to do exit then reboot

#

It ignores reboot if you're in chroot

#

Same error?

#

Should I type anything in grub rescue?

untold nymph
#

it is possible to manually boot the OS from the grub rescue prompt, but that won't fix the problem

#

sorry, but i don't really know what's wrong with it now

main condor
#

Should I try to chroot in and manually start it from there?

untold nymph
#

you can't boot the OS from the chroot

main condor
#

Should I check grub lists in chroot?

untold nymph
#

yeah you can

main condor
#

Grub not booting to OS

#

Alright I'm chrooted

untold nymph
#

you can check efibootmgr and GRUB2 should be on top

main condor
#

It's not on top

untold nymph
#

actually it may not be on top but it should be the first number listed on the BootOrder line

main condor
untold nymph
#

i don't think it matters if it boots the old or original grub entry anyway, they appear to be identical

main condor
#

Doesn't one have the no vram option though?

untold nymph
#

this is an option to grub-install that tells it to not create a new boot entry

#

if you wanna check the grub config (and see the menu entries) you can do less /boot/grub/grub.cfg

#

the grub menu entries look like this

main condor
#

I'm in, not sure anything seems off though

#

Then again I probably wouldn't be able to tell

#

This is really basic but how do I get out of less? Im doing Ctrl C and it's not doing anything

untold nymph
#

press q

main condor
#

Still not doing anything

#

Just reboot and rechroot ig?

untold nymph
#

if you're stuck in less you can press Ctrl Alt F2 then run killall -9 less then Ctrl Alt F1

#

there are 7 TTYs you can access with F1-7

main condor
#

I'm just gonna rechroot because I'm forgot how to type my password on qwerty since I've been using a different layout

untold nymph
#

oh there's no password

#

in the iso

#

just root and enter when it asks password

main condor
#

Oh

#

Oops

#

Was trying to type my normal username and password

untold nymph
#

heh

main condor
#

Anything else I should try to look at?

#

Why is it saying that no boot order is set in efibootmgr

untold nymph
#

probably just your laptop's firmware doesn't talk properly with linux

#

so efibootmgr can't tell what the order is

untold nymph
#

someone else may be able to help you more

main condor
#

Is my firmware messed up? It gave me a warning on it at the start of booting

untold nymph
#

what was the warning?

#

were you able to read it

main condor
#

I'll get it again rq

untold nymph
main condor
#

Alright, my firmware is about 10 years old anyway

untold nymph
#

tl;dr to anyone else coming to help:
they updated their arch system for the first time in 3 years, and made sure to run grub-install and grub-mkconfig
the system boots to the grub rescue prompt
we chrooted in, installed grub again with a different entry ("GRUB2"), same issue persists
also their laptop screen is nearly unusable and they are restricted to an external display

main condor
#

Welp its getting late and i should probably head to bed, goodnight

untold nymph