DEV Community

loading...
Cover image for #4 Fully operational OS!

#4 Fully operational OS!

arthurborges profile image Arthur Borges ・3 min read

Photo by Markus Spiske on Unsplash

I'm not a SysAdmin or Hardware person. But I'm very curious. My last attempt to solve the boot problems didn't work, so I decided to learn the inner working of the problem and solve it completely. This post is the narrative of those experiences and I hope that it will help me and others pass through these boot problems in the future.

The fresh install

As I did not know beforehand what was the problem, I decided to reinstall Ubuntu 20.04.

At first, I installed only with one partition, /, occupying all the disk. It did not work, because there wasn't a boot partition. (Although I read somewhere that Ubuntu could create that partition automatically - let me know if this works and how to proceed in the comments)

Then, I installed it again, with two ext4 partitions, /boot and /, the first occupying 1GB of disk (Why so large? I don't know, I just followed the advice of a person in AskUbuntu and did now wanted to mess without fully understanding the implications of a smaller - how much smaller is good? - partition)

After doing that, BOD again! (Black Screen of Death). The error message this time was error: file '/grub/i386-pc/normal.mod' not found. But for my luck, it displayed a grub rescue prompt!

The grub rescue prompt

Then the miracle happened. I found this awesome article of How to Forge website explaining the differences between grub and grub rescue prompts and how to use them.

In my case, the problem was that the OS couldn't find the normal module on the boot partition, because I wasn't pointing it correctly when I first attempted to copy and paste random commands from StackOverflow answers.

But this time I understood it right! I used the following commands:

ls

This command alone lists the partitions, and I found to have three of them. One inaccessible, the other two probably related to /boot and /.

The output of ls was (hd0) (hd0,msdos1) (hd0,msdos2).

ls (something)

Them, I proceeded to identify the partitions. I ran ls (hd0,msdos1) and ls (hd0,msdos2), and it outputted the files inside those partitions. The first being boot and the latter, /root.

set

The next step involved setting the prefix (boot) to the boot path and root to the root one. I achieved that with the following commands:

set prefix=(hd0,msdos1)/grub
set root=(hd0,msdos2)
set
Enter fullscreen mode Exit fullscreen mode

Here I must state that those commands applied to my case. Instead of just copy-paste, you should use the ls commands to identify the names and paths for your case and apply them correctly.

normal module commands

Then, after the correct pointing, I used the following commands to change to load and activated the normal module:

insmod normal
normal
Enter fullscreen mode Exit fullscreen mode

Here, the magic happens! The computer boots! I then restarted it to see if the changes were correctly made, and to my surprise, they weren't! The same "can't find normal module" again. I discovered that I had to perform a "grub-install". I wasn't installing it correctly, So I searched this post for clarification.

I was doing:

grub-install /dev/sda1

instead of:

grub-install /dev/sda

Great! Now I have a fully operational OS! I've restarted a couple of times and no more BODs again!

Discussion (3)

Collapse
thefern profile image
Fernando B πŸš€

Not sure why you are having problems with your installation. Usually you just run the gui installer and when it comes to the partition you select the first option which does all partitions for you. If is the only hdd then you should be good to go.

Collapse
arthurborges profile image
Arthur Borges Author

Yes, on the first try I performed that, but then it stated that it couldn't find the normal module. My disk is a brand new SSD so I shouldn't be having these issues. Anyway, now it is solved and I'm glad that I know the intrinsic mechanisms of the normal module pointing, which will be helpful in the future.

Collapse
thefern profile image
Fernando B πŸš€

Yes, is what matters the most. Learning something along the way. Glad is solved!

Forem Open with the Forem app