Humorous story based on real events.
It was a boring evening. Wives are not at home, alcohol is over, DotA does not connect. What to do in this situation? Of course, collect Gentoo !!!
So, let's begin!
Given: an old server with 2Gb RAM, AMD Athlon Dual, two 250Gb hard drives, one of them has a system and a non-working bios battery. Also Sony Bravia TV with VGA input and mouse. As well as a Wi-Fi router and a working laptop with Manjaro Arch Linux and the i3 environment.
Required: Install Gentoo.
Day 1
21:00 Get out of the closet old dusty servachek. From there I take out a box with wires and other junk and an old TV set (a wardrobe in the hallway is large, everything fits there). I rummage in the box, disentangle the wires, pull out a patchcord, a VGA cable, a mouse, a power cable, and a set of screwdrivers (if needed).
21:15 I start to look at all this and think about the question “How can I do this?”. After all, the most important attribute for installing Gentoo - the keyboard, I did not have!
21:20 I think, “What if you get a screw out of a server, stick it in a usb carrying system and deploy a system on it? Not kosher, it’s necessary to assemble the core on the same gland ... ”. While I was thinking about this option, I managed to pull out the screw and put it in the carrier, but when I twisted the last bolt into the box, I decided that it wouldn't work like that!
21:30 I unscrew the bolts back, put the screw in place in the server. I am thinking further: “There is only one option - SSH access. Can there be such a LiveUSB with sshd already running? ”
21:35 I go to the official website of Gentoo . Shake my habit "Minimal Installation CD". I cancel. Without a keyboard - this is a dead number! Below is a link to "Hybrid ISO (LiveDVD)". Yeah, I think that's where it all is! I download and deploy to a USB flash drive .
21:50 I carry the server, the TV set, the wires, the mouse from the kitchen, where my thoughts and preparations took place, to the far corner room. The server is noisy like an industrial vacuum cleaner, so the policeman would definitely come to visit! All connected and started the car.
22:00 Previous OS is loaded! I turn off the server and start thinking: “The battery is dead, I don’t need to enter the BIOS (there is no keyboard), but I need to, by all means, boot from the USB flash drive!”. I disassemble the server, turn off one screw. I'm running. The previous OS is loaded! Turn the screw back, turn off the other! Works!
22:10 And here is the long-awaited screen for selecting the download option from LiveUSB! The time remaining until the automatic selection of the first boot option runs, “Now everything will be, you just have to wait a bit,” I rejoice! The cherished 30 seconds pass, the screen goes blank, and nothing happens. “Okay, as long as it loads, I'll go smoke ...”, decided to take a break and take a break from this noise.
10:15 pm Returning to the “noise room”. The screen is black and nothing happens either! "Strange ...", I thought, "In any case, it would have already loaded!". By the way, everything is aggravated by the fact that my TV set does not always show what is happening on the screen, it does not perceive some modes and refuses to broadcast a picture of what is happening ... I reboot the server. I sit, I look ... Again the black screen, all the same. Well, I freaked out, and started poking at the buttons of the mouse ... And, oh God, it turned on and the download went. Later, I discovered that the download continues only after pressing the little button on this wonderful mouse! Do not be this button, God knows, what would this evening have ended!? After all, the goal is set, and it is necessary to achieve it in any way!
22:20 Ringing in the ears, but I continue to go to my goal! Gentoo has loaded! Paints are pleasing to the eye! The mouse walks around the screen! And below it is written “No password needed for login”, it’s just good, because I don’t have a keyboard! There are two fields on the screen: the choice of the working environment and password, well, and the login button. LiveDVD Gentoo offers a fairly extensive choice of environments, including Fluxbox, Openbox, rat (xfce), plasma, etc. The option with the choice of "rat" seemed to me a great choice! I go into the working environment "rat". Perfectly! There is a terminal, but why should I, I don’t have a keyboard!
22:25 I'm starting to look for some on-screen keyboard or something. Found only "Character Map". "Well, fine, here it is my way out!", I thought. But it was not there! The text can be stuck, copied, pasted, but how to press Enter !? Let me remind you that the task is to start sshd, which is reduced to entering “ sudo /etc/init.d/sshd start ” in the terminal, and pressing the Enter button, which I don’t have! What to do? But there is a solution!
22:30 Rest time from the noise. I go to the kitchen and sit down at the laptop. Any terminals, if you insert copied text with a line break into them, will execute the command, since perceive a line break as Enter . So, the solution is found! It is necessary to fill in the Internet HTML-page with the command and line feed. It is HTML, because, as a simple text file, the browser will open in one line "devouring" all transitions to a new line. So my page looks like this:
')
<html>sudo /etc/init.d/sshd start<br/>1</html>
22:40 Returning to the "room noise." The main thing is to have time to return before turning on the screensaver, which when leaving it says that it will not let the old version back into the system with an empty password! I open the browser and symbol table with the anticipation of success! I type " mydomain ". I am looking for a point ...
22:50 Found the point! You need to select the "By Unicode Block" view mode. I dialed the address further, the benefit of “/” and the numbers were found along with the dot! I copy the text, paste it into the address bar, press the switch. The time in the system due to a dead bios battery is set as "01/01/2002", and under such conditions SSL certificates do not work!
23:00 I'm in the kitchen, resting from the noise. The main thing is not to rest for a long time, and then the screensaver will turn on! I configure NGINX to upload my file without HTTPS to the address “ mydomain.ru/2.htm ”, since the old address was redirected and cached by the browser.
23:05 A little rested from the noise and with anticipation of success, I fill the link again, because the button “ Backspace ” can not be emulated! Well, this is for laughter, but in fact I just press in the symbol table “2”, select, copy and replace in the address bar. Go! “Well, really!” I thought. With a sense of pride, I copy two lines from a page and put it in the terminal. The SSH server is running, it's time to try to connect by looking at the IP address in the web-based management interface on the Wi-Fi router! Actually, no, it's too early! It is a pity, I did not immediately understand ...
23:15 Returning to the "mouse", adding to this line
sudo passwd<br/>123<br/>1
23:17 Connected! Now I'm not afraid of screensaver and noise!
01:00 About the process that I have undergone since the installation of an ssh connection and up to this point there is a detailed description in a variety of sources, the most complete is presented in the Gentoo Handbook . I assembled the kernel, installed the grub and the assembled kernel in it. Configured network and ssh on new system. Done, " reboot "!
Day 2 - day off
10:00 Returned to its task. Turned on the server. Nothing happens on the screen, there is no server on the network! Thought network problems. Booting from LiveDVD I built a network, but it did not help ...
10:30 Decided that it would be nice to study the boot logs. There are no logs! “Yeah, that means it didn’t get to boot the system! But what is written on the screen? ”, I thought. A little thinking about the reasons why the TV does not show anything, put forward the hypothesis that he can not show the resolution in which there is a console output. On the screen, in fact, it is written like that ...
11:00 AM. Changed GRUB settings to 640x480 output. It helped. It is written "Loading Linux 4.19.27-gentoo-r1 ...". It turned out that he screwed up when building the kernel.
11:30 I put genkernel, I will experiment with manual kernel tuning later. Do not put! It turns out the jamb with the date. It is better to update it every time you start, much depends on this date. I would put it in the BIOS, but for this you need a keyboard ... I change the date to the current one.
14:00 Cheers! The kernel has compiled! Filled the kernel into the bootloader, rebooted. Finally it all worked!
The first goal is reached!
Then I'm going to put the CentOS on the second hard drive without a keyboard, but from the jenta! But I will write about this in the second part. In the third part I will carry out load testing of the web server with a simple application on both these systems and compare the RPS.
Source: https://habr.com/ru/post/447330/
All Articles