Score:1

Broken grub and system

us flag

I'm trying to fix grub from a USB drive. I am not sure why the problem happened. I was running Ubuntu 20.04 and restarted normally and on the restart, I get grub-rescue screen. I don't have windows installed, just the Ubuntu. I am currently using usb to fix it. I ran Boot-repair but got below error

Error detected in grub_mkconfig

After rebooting, I was taken to grub screen. I am trying these solutions, but nothing worked.

I run the following:

sudo mount /dev/sda1 /mnt
sudo grub-install --root-directory=/mnt /dev/sda

I get the following error:

grub-probe: error: failed to get canonical path of /cow.

Even when running

sudo grub-mkconfig > /boot/grub/grub.cfg

or

update-grub

in chroot, I get the same error. Can someone explain the error, and explain how to solve it?

This is the result of running sudo fdisk /dev/sda command

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1  *          2048 1901873141 1901871094 906.9G 83 Linux
/dev/sda2       1901875198 1953523711   51648514  24.6G  5 Extended
/dev/sda5       1901875200 1937033215   35158016  16.8G 82 Linux swap / Solaris
/dev/sda6       1937035264 1953523711   16488448   7.9G 83 Linux

Edit: Pastebin link to the Bootinfo summary report: https://paste.ubuntu.com/p/sT23JKdBr8/ Pastebin link after peerforming boot repair:https://paste.ubuntu.com/p/nRf4Q29pfv/

Jeff avatar
mx flag
To be honest, the best thing to do, in my opinion, is to reinstall Ubuntu 20.04. DO you know if you can back up the system? Try running sudo rsync -a --info=progress2 --exclude="lost+found" --exclude=".cache" /home /path/to/disk/to/save/home/to
Jeff avatar
mx flag
This should back up the /home directory. Make sure you have another external drive.
Jeff avatar
mx flag
To back up, after reinstalling Ubuntu, run sudo rsync -a --info=progress2 --exclude="lost+found" /path/to/disk/to/save/home/to /home/
Jeff avatar
mx flag
I am going to put my comments as an answer
oldfred avatar
cn flag
Please copy & paste the pastebin link to the Bootinfo summary report ( do not post report), do not run the auto fix till reviewed.Lets see details, use ppa version with your USB installer (2nd option) or any working install, not Boot-Repair ISO https://help.ubuntu.com/community/Boot-Repair https://sourceforge.net/p/boot-repair/home/Home/ The /cow means you were trying to update the live installer, not your install. But if you correctly chrooted into your install, you should have been able to fix it from there.
newbie avatar
us flag
https://paste.ubuntu.com/p/sT23JKdBr8/ here is the pastebin link
nobody avatar
gh flag
it looks your system is installed in biosmode. Are your live session also boot up in bios mode? for bios mode right place to reinstall grub is in MBR of the drive. this should do it https://askubuntu.com/questions/88384/how-can-i-repair-grub-how-to-get-ubuntu-back-after-installing-windows
Martin Zeitler avatar
in flag
Also see https://askubuntu.com/questions/254491/failed-to-get-canonical-path-of-cow
WinEunuuchs2Unix avatar
in flag
Before the crash did you make any changes to `/etc/default/grub` file? Can you list the file contents in your question? Changing some of the `GRUB_CMDLINE_LINUX_DEFAULT` options in the file ***might*** fix the error.
Score:1
mx flag

To be honest, the best thing to do, in my opinion, is to reinstall Ubuntu 20.04. DO you know if you can back up the system? Try running sudo rsync -a --info=progress2 --exclude="lost+found" --exclude=".cache" /home /path/to/disk/to/save/home/to

This should back up the /home directory. Make sure you have another external drive.

To back up, after reinstalling Ubuntu, run sudo rsync -a --info=progress2 --exclude="lost+found" /path/to/disk/to/save/home/to /home/

For more information, see this thread on AskUbuntu. It seems to be a very similar issue, and could have a better solution.

Organic Marble avatar
us flag
Your website 404s, and even if it works, you probably shouldn't be advertising it.
Jeff avatar
mx flag
@OrganicMarble I put the wrong website on it. LOL. Sorry forgot the other "e." I fixed it
Score:1
cn flag

When I wanted a simple grub repair (and couldn't figure out how to fix grub), I just did an additional install. I would make some space for a new partition (or use an unneeded partition) and install a new (small/minimal) instance of linux there. I would make sure I am installing the new bootloader over the old bootloader. Then let the install find my old install and add it to the menu. Then both installs were accessible on reboot. Basically I let the install fix the problems.

Edit: tested and updated with additional command.
If you cared to remove the NEW install, you can now log in the old OS and run sudo grub-install /dev/wherever-your-bootloader-is. Just to get a warm fuzzy I went into /etc/default/grub and made a subtle change to the "GRUB_TIMEOUT" (which I had set at 7 seconds. I changed it to 13 seconds to verify that I'm on the right track)... and then sudo update-grub. Rebooting right now brought me to the grub menu with my 13 second timeout, so I know I'm good for grub now configured by my old install. Logging back into the old system, now you are able to delete the NEW OS partition and run update-grub again... This will bring your grub menu back to just the original one install...

....in your specific case, I'd be a little careful. Your layout looks odd (to me 'personally')... You have a large 906G partition with the boot label, then a extended partition with a ton of swap and then a 7.9 gig partition inside that. I can't tell where your OS install is, so I'd be hesitant to tell you where to install without seeing df -h and knowing what you have on those partitions. You'd just want to make sure you're not installing over your existing OS or any data that you want to keep. You'd want to shrink one of those partitions and make a new one with the new space... You also may be able to get away with plugging in a usb drive or sd card and doing the small OS install there instead, while making sure you're designating the bootloader location to be on that drive that is currently named /dev/sda in your picture.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.