You are not logged in.

#1 2019-07-25 23:22:05

Soptik
Member
Registered: 2019-03-11
Posts: 64

[Solved] Computer crashed and grub refuses to load out of nowhere

Hi,

if you want to hear details about the problem, skip to the mark below. But I'll describe here in few lines what happened, because I find it very interesting.

I just installed neovim, so naturally I was installing tens of plugins, messing up with my config. I download ALE and configured it to work nicely with Rust. As I was writing and testing how good it works , something weird happened. I wanted to save file, but some scary error displayed. Hm, weird - I'm in my home directory, the file is mine - why doesn't neovim let me create the file? And why can't it create swap files? So I quit neovim and noticed plenty of IO errors. I tried to enter neovim, but I was greeted by IO error instead. df, du, ls - everything yielded an error. Even my scripts that I use to display network connection status started throwing errors at me. I rebooted my computer. I was convinced I either have full disk or at worse it just died. But after reboot, I was greeted by the awful message that no OS was found and to use live boot USB. After a while I was able to launch live archlinux.

---- ISSUE DESCRIPTION STARTS HERE -----

After launching live arch, I mounted my disk and checked it out - I had plenty of space left, about 10G, and it was not corrupted - I had all my files there. I don't get what happened - how was I able to destroy my grub without even running anything as root?

Here's my disk structure:
sda: 1TB HDD, used for large files, nothing interesting here
nvme0n1: SSD with everything on it

nvme0n1 divides into:

p1 - EFI system partition (vfat)
p5 - Linux filesystem (ext4)
p6 - Linux swap (swap)

I think the most interesting partition is p1, so here is find ran on p1 mountpoint:

https://pastebin.com/dt8N8E8F (note: I was running windows alongside arch. Not they are almost entirely gone, the only thing left is their bootloader)

Another interesting folders in p1:

# ls EFI/GRUB

# ls EFI/Boot
bootx64.efi fbx64.efi mmx64.efi

# ls EFI/EFI/GRUB

# ls EFI/arch
grubx64.efi

I tried running grubconfig prior to running the #ls and #find. I also upgraded my system (Syu) and new linux version was installed, so initramfs should be updated. I'd try more before asking on forum, but I have absolutely no idea what to do now. I don't even know why it happened - how can editing file in nvim without root destroy grub or my boot configuration.

Last edited by Soptik (2019-07-26 20:07:04)

Offline

#2 2019-07-26 00:22:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,530
Website

Re: [Solved] Computer crashed and grub refuses to load out of nowhere

Soptik wrote:

how can editing file in nvim without root destroy grub or my boot configuration.

What??  How on earth did you come to the conclusion that that was the cause?  You were likely also breathing at the time, but you'd not ask how breathing could destroy grub.

Something seems to have gone quite wrong with the disk resulting in all those IO errors, the problem with GRUB, and all the errors in neovim.  If it was a one-off event, it'd be hard to trace what went wrong with the disk, but I'd say you should ensure you have backups of anything important.  It could be as simple as the drive cable coming a bit loose.

Last edited by Trilby (2019-07-26 00:38:57)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2019-07-26 00:28:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] Computer crashed and grub refuses to load out of nowhere

Not an Installation issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2019-07-26 05:13:39

Soptik
Member
Registered: 2019-03-11
Posts: 64

Re: [Solved] Computer crashed and grub refuses to load out of nowhere

Yes, sorry you’re right. But I still don’t quite get how did it mess up grub. I wasn’t doing an update, so it shouldn’t be writing into the partition at all. If anything I’d expect p5 partition (where everything else is) to get corrupted, not p1, which I didn’t even touch at the time.

Anyway, can one tell from the information I provided where is the problem? What else should I try to do?

Can I test whether the problem is in grub or if uefi forgot grub exists? When I start computer, windows bootloader shows up, so I think the problem is either in grub being corrupted or uefi somehow forgetting that grub exists.

Last edited by Soptik (2019-07-26 06:39:57)

Offline

#5 2019-07-26 07:28:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,493

Re: [Solved] Computer crashed and grub refuses to load out of nowhere

It didn't and I'd strongly recommend to run a SMART test, https://wiki.archlinux.org/index.php/SMART
Also check the condition before and be prepared to backup all valuable data, because this:

So I quit neovim and noticed plenty of IO errors

Is never a very good sign.

and it was not corrupted - I had all my files there.

Is like saying "I'm not sick, all my limbs are still there" (still I've got a fucking flu…)

Offline

#6 2019-07-26 16:30:48

Soptik
Member
Registered: 2019-03-11
Posts: 64

Re: [Solved] Computer crashed and grub refuses to load out of nowhere

It looks like my SSD (primary - p5) for some reason doesn’t support smart, I was unable to run test on it. But my HDD (secondary - sda) is fine according to smart, so I dd’ed ssd into hdd.

It’s weird that I have this kind of problems, my laptop isn’t even half a year old.

I’ll try to find out how to scan ssd.

Anyway, how can I make bootloader work again? Any ideas or requests for more information? I can follow wiki without problems, I just don’t know what is happening and I don’t want to make it even worse.

Last edited by Soptik (2019-07-26 16:33:03)

Offline

#7 2019-07-26 19:28:59

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,493

Re: [Solved] Computer crashed and grub refuses to load out of nowhere

Re-install it, but if the disk is broken (might have overheated?) that's not really gonna fix anything (you might not even be able to re-install the bootloader w/o I/O errors…)

Offline

#8 2019-07-26 20:05:49

Soptik
Member
Registered: 2019-03-11
Posts: 64

Re: [Solved] Computer crashed and grub refuses to load out of nowhere

You were right, reinstall was definitely the fastest way to solve it. It took like 10 minutes. If someone comes here and wants to know how to reinstall in case something similar happen: You probably won't need to setup the system from scratch again if you can browse your data from chroot. So this is enough for my specific install, consult !aw GRUB and !aw UEFI for specific layout.

# grub-install --target=x86_64-efi --efi-directory=efi --bootloader-id=GRUB
# grub-mkconfig /boot/grub/grub.cfg

The only thing that is different now is that windows bootloader disappeared, but I guess it doesn't matter to much. It lasted from when I nuked Windows after about a month of dualboot and I used it when I was unable to boot into Arch - it had an option to boot into BIOS, which I will have to do with live usb instead, since my computer doesn't have a way to do it directly - or at least none that I'm aware of. But I guess it's better now.

I'm curious if I will encounter further problems with my SSD, it's only few months old, too young to die.

Offline

Board footer

Powered by FluxBB