0

I was working on a project and wanted to delete a directory's subfolders and files inside it. So this is what I typed while I was inside the directory:

sudo rm -R /*

and it deleted everything inside the root (/) directory.

When I boot the system I get to the grub rescue screen and at the top it says:

error: file '/boot/grub/i368-pc/normal.mod' not found.

I tried typing ls (hd0,msdos1) but it says Filesystem is unknown.

screenshot of the error

Ubuntu (20.04) was running on VirtualBox. Is there any way to rescue at least my own files?

mypr
  • 1

2 Answers2

2

Edit: I found a more comprehensive and cleaner response here: Grub rescue prompt, repair grub

I got into grub rescue after changing the swap partition. So no hardware problem or deleted files.

First thing for me to figure out was the keyboard layout. As far as I could tell it is en_us. To know this is essential because you need at least some, to type the console commands.

Now with the ls command you can search for your OS partition. Just check every partition listed with ls (hd0,msdos5)/ to check their content. As far as I can tell if you know your partition number (ex. sda5) you can use ls (hd0,5)/ as well. As soon as you find the right partition it lists the root folders. You need to know the path to the root folder and the grub folder.

Then type set prefix=(hd0,5)/boot/grub and set root=(hd0,5). While replacing your own partitions.

Now type insmod linux and insmod normal. If no error occurs, you can boot by typing normal.

If the boot works, you need to fix grub. Check for tutorials for that.

I write this answer because I found it first, while having this problem. A reinstall would be possible but silly.

0

I solved the issue by trying ubuntu with bootlable disk(virtual). I used it to check my hdd and fortunately I found my project folders undamaged and upload them a cloud service asap. I will make a clean installation and continue on my project. Thanks all of you for helping me.

mypr
  • 1