Grub Rescue Issue After Last Update  [Solved]

Message
Author
User avatar
asqwerth
Developer
Posts: 8046
Joined: Sun May 27, 2007 5:37 am

Re: Grub Rescue Issue After Last Update

#11 Post by asqwerth »

dragonfly wrote: Mon Sep 19, 2022 5:28 pm ...

The last update listed 3 options: agree to full upgrade, stay with current version, or compare the differences. I selected the third option with the hopes to make a more informed decision. The computer froze up after listing the comparison. I left it alone for a bit, but it was totally frozen, nothing would close, open, minimize, etc. and so I forced it off with the power button. Now it only boots with a picture of the Lenovo theme and grub rescue>.

I have...
For future reference (since you may encounter this again in a future update of certain packages) , the computer did not freeze in the midst of the update. The terminal was waiting for you to return to the previous page to answer the question of whether you wanted to keep or replace your existing config files (nothing to do with full upgrade) . You do that by pressing "q".

https://forum.mxlinux.org/viewtopic.php ... 84#p695184
so, the listing of differences in the terminal can be scrolled down (if it doesn't fit in one page) with space bar, and "quitted" by pressing "q" on your keyboard. Pressing "q" will bring you back to the previous terminal screen where you were asked to input Y,N or D, so that you can input your response to that question.
Desktop: Intel i5-4460, 16GB RAM, Intel integrated graphics
Clevo N130WU-based Ultrabook: Intel i7-8550U (Kaby Lake R), 16GB RAM, Intel integrated graphics (UEFI)
ASUS X42D laptop: AMD Phenom II, 6GB RAM, Mobility Radeon HD 5400

dragonfly
Posts: 28
Joined: Mon Sep 19, 2022 4:19 pm

Re: Grub Rescue Issue After Last Update

#12 Post by dragonfly »

Thanks asqwerth, I did not know that. I hope I didn't damage anything too badly. I'll certainly keep that in mind for if it happens again. I had not encountered that before and assumed it was frozen.

dragonfly
Posts: 28
Joined: Mon Sep 19, 2022 4:19 pm

Re: Grub Rescue Issue After Last Update

#13 Post by dragonfly »

I tried the suggestion in #10 to enter chroot after booting with the live usb. It brought me to the chroot-rescue-scan terminal. After a very brief scanning of partitions and directories it says:

Warning: No Linux systems were found
Paused at exit
Press <Enter> to continue

Pressing Enter makes it disappear.

When I open a terminal in the live usb and enter sudo fdisk -l, it does show:
/dev/sda 1, 256m EFI system
/dev/sada 2, 923.3G Linux filesystem (which is the largest size of all and makes me think this is where my Linux operation is)
/dev/sda 3, 8G Linux filesystem

Each also has starting, ending, and sector numbers. There is also another listing for /dev/sdb1 and /dev/sdb2 which is the live usb.

Am I thinking right on this? It looks like my system is in there still...

Also, I forgot to mention this is not a dual boot set up. It is solely MX Linux.

User avatar
pbear
Posts: 313
Joined: Tue Aug 09, 2022 9:24 pm

Re: Grub Rescue Issue After Last Update

#14 Post by pbear »

That's both puzzling and cause for concern. Hard shutdown is bad practice, and how to get out of a frozen system without doing so was one of several things I was going to mention after we got the system back on its feet, but I can't recall another instance of hard shutdown blowing up the system so badly it couldn't be repaired by fsck, never mind so badly it couldn't be detected by a system scan.

Let's try a simple test. Boot the live system, open Terminal, click the maximize button (upper-right), and run these commands:

Code: Select all

sudo mount /dev/sda2 /mnt
ls /mnt
ls /mnt/boot
ls /mnt/boot/grub
ls /mnt/home/dragonfly
Note: If your username on the system is something else, substitute the correct name in the last command. As you probably can guess, the object of these commands is to see whether you still have the files we would expect to see in those directories. Frankly, if these files are missing, there's not much point worrying about the rest. Remember, the sudo password in a live session is demo.

Once you've run all the commands, click Edit > Select All on Menu (top of screen), then Edit > Copy. Still in the live session, set up an internet connection, navigate to the Forum and paste from clipboard into your next reply. To make the thread easier to read, select with your mouse the text you just pasted, then click the </> button above the text entry window, which will put the outputs in a code box, just like the one I used above.

By the way, had you by some mad chance set up Timeshift and/or saved a system image with MX Snapshot? If you did either of those things, we should be restoring the system that way.

dragonfly
Posts: 28
Joined: Mon Sep 19, 2022 4:19 pm

Re: Grub Rescue Issue After Last Update

#15 Post by dragonfly »

So this is what resulted from the commands:
(My apologies, but I am not seeing a </> button over this entry window to make this easier to read. Maybe I am looking in the wrong place? I do see a Full Editor & Preview button below this screen. Does that make the code box?)
Also, I'm not sure what Timeshift is so I am guessing I did not intentionally do that.

demo@mx1:~/Desktop
$ sudo mount /dev/sda2 /mnt
mount: /mnt: /dev/sda2 already mounted on /mnt.
demo@mx1:~/Desktop
$ ls /mnt
bin initrd.img libx32 media opt run tmp var
etc lib lost+found mnt root sys usr vmlinuz.old
demo@mx1:~/Desktop
$ ls /mnt/boot
ls: cannot access '/mnt/boot': No such file or directory
demo@mx1:~/Desktop
$ ls /mnt/boot/grub
ls: cannot access '/mnt/boot/grub': No such file or directory
demo@mx1:~/Desktop
$ ls /mnt/home/Vicky
ls: cannot access '/mnt/home/Vicky': No such file or directory
demo@mx1:~/Desktop
$

dragonfly
Posts: 28
Joined: Mon Sep 19, 2022 4:19 pm

Re: Grub Rescue Issue After Last Update

#16 Post by dragonfly »

Also, I don't know if this helps at all, but I ran this command, sudo parted -ls. It brings up all this, but I am wondering if all 3 are supposed to say "primary".

demo@mx1:~/Desktop
$ sudo parted -ls
[sudo] password for demo:
Model: ATA ST1000LM035-1RK1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 269MB 268MB fat32 primary boot, esp
2 269MB 992GB 991GB ext4 primary legacy_boot
3 992GB 1000GB 8590MB linux-swap(v1) primary


Model: SanDisk Cruzer Glide (scsi)
Disk /dev/sdb: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
2 621kB 4889kB 4268kB primary esp


demo@mx1:~/Desktop
$

User avatar
pbear
Posts: 313
Joined: Tue Aug 09, 2022 9:24 pm

Re: Grub Rescue Issue After Last Update

#17 Post by pbear »

Some of that is okay, but on the whole doesn't look good. On the plus side, to answer your question, all the partitions being primary is exactly as should be. This means as opposed to logical, which was an important distinction in the old BIOS-style partition scheme (which was limited to four primary partitions). I am puzzled, though, by the legacy_boot flag on sda2.

Big problem is that most of your system folders seem to be missing, in particular the /boot and /home directories. For comparison, here's what I get:

Code: Select all

demo@mx1:~
$ ls /mnt
bin   etc         initrd.img.old  libx32      mnt   pulse  sbin       tmp  vmlinuz
boot  home        lib             lost+found  opt   root   sys        usr  vmlinuz.old
dev   initrd.img  lib64           media       proc  run    timeshift  var
Unless someone else has a bright idea, I think you are looking at reinstall. Sorry.

Moreover, as the /home directory has gone missing, there's no simple way to "get my data off the hard drive" (as requested in the first post), from which I infer you don't have backups and the files aren't duplicated on your other computer. You could try data recovery with TestDisk, but that's time consuming and rarely 100% effective. In future, do backups obviously (Linux has several good apps for the purpose), but too late for that here.

As an aside, for future reference, in Linux your "real" username is always lower case (the other one is called your display name). The command should have been ls /mnt/home/vicky. Here, though, there's no /home directory, so that's why you got "no such file or directory."

Stuart_M
Posts: 711
Joined: Wed Aug 07, 2019 7:10 pm

Re: Grub Rescue Issue After Last Update

#18 Post by Stuart_M »

dragonfly wrote: Tue Sep 20, 2022 2:46 am ...
(My apologies, but I am not seeing a </> button over this entry window to make this easier to read. Maybe I am looking in the wrong place? I do see a Full Editor & Preview button below this screen. Does that make the code box?)
...
Yes, you are looking in the wrong place. Clicking on the "Full Editor & Preview" button at the bottom of the "Quick Reply" window will show the </> button.

You can also make your text appear in a code window by simply typing "[code]" at the beginning of the text, and "[/code]" (minus the quotation marks) at the end of the text. The </> button does that automatically by putting the code tags around the highlighted text.

dragonfly
Posts: 28
Joined: Mon Sep 19, 2022 4:19 pm

Re: Grub Rescue Issue After Last Update

#19 Post by dragonfly »

Thank you all for your help. I do have a back to an external hard drive, but it is not the most recent back up. So I haven't totally lost everything, but I will definitely be more regular with back ups in the future. I learned a lot through this process. Thanks again!

User avatar
pbear
Posts: 313
Joined: Tue Aug 09, 2022 9:24 pm

Re: Grub Rescue Issue After Last Update

#20 Post by pbear »

You're welcome. Sorry the story didn't have a happier ending. A few closing thoughts.

1. I'm still mystified that a hard shutdown could have so thoroughly trashed the system. I wonder whether the hard drive is failing.

2. When the system freezes, try to do a soft shutdown before resorting to the power button. The generally recommended procedure is something called "Raising Elephants," which refers to a special key sequence which usually shuts down the system in an orderly way, avoiding corruption of the file system. (Doesn't work is some cases, though, e.g., a kernel panic.) The key sequence is: (i) hold down the Alt key (and keep held throughout); (ii) hit (and release) the SysRq/PrintScreen key; (iii) tap in order, pausing a few seconds between each, the keys REISUB or REISUO (can be upper or lower case, both work). The "B" option initiates reboot, the "O" option does a shutdown. The usual mnemonic is something like Raising Elephants Is So Utterly Boring/Obnoxious. The trick is remembering all the details. Print out and put in a drawer next to your computer. Or do an internet search (e.g., Linux Raising Elephants) when the need arises.

3. After you reinstall, look into Timeshift (mentioned earlier). It's a great app, installed on MX out-of-the-box, which keeps a shadow copy of all your system files so you can restore to a prior state if something goes sideways during update (or otherwise). Main thing to be careful about is that it requires a lot of space, so save snapshots on a USB drive if you're tight on the hard drive. Also, do not use Timeshift for data files. Use something else.

4. Don't beat yourself up too much over not-quite-current backups. There's a cost to obsessively current backups. In general, I only backup data files once per month, though a particularly important project might be backed up manually more often, even daily. Strike a reasonable balance and then stick to the plan.

Hope that helps. Good luck.

Post Reply

Return to “Software / Configuration”