Windows EC2 INACCESSIBLE BOOT DEVICE

So i have a Windows 2016 Datacenter edition EC2 instance that was used for a SQL server and it’s killing me today with the INACCESSIBLE BOOT DEVICE blue screen.

Here’s me documenting what i tried to use to fix it and things that failed:

[Preparations]

  • Take snapshot of the instance
  • Stop instance
  • Detach root volume
  • Create a secondary windows instance, which i’ll be using for restore purposes and log on via RDP to it.
  • Points 1 2 3  below are happening with the volume attached to the recovery instance, after which i detach it, and reattach it to the damaged instance, and boot it up, see if it works.
  • Between each failed point 1 2 3 etc, i am detaching the volume from the damaged instance, and attaching it back to the rescue instance to try the next thing. Make sure you attach it as “/dev/sda1”, as that’s the root mount.

[Things that have failed so far]

1 – Attach it to the recovery instance, run CMD in an elevated prompt and run the command below(didn’t boot):

bcdedit /store D:\boot\bcd /set {default} bootstatuspolicy ignoreallfailures

2 – Use DISM to figure out if it was an automated windows update that installed some patch that bricked it (wasn’t)

dism /Image:D:\ /Get-Packages

3 – Installed EC2 Recovery tools and tried using the offline mode both to “fix boot issues” and “restore last known registry config” (neither worked)

4 – Running a SFC scan to see if there’s any integrity issues (didn’t work):

sfc /scannow /offwindir=d:\windows /offbootdir=d:\

5 – Attempt to rewrite the boot records with bcdedit:

bootsect /nt60 D: /mbr
D:\windows\system32\bcdboot.exe D:\Windows /s D:
bcdedit /store D:\Boot\BCD /set {default} device partition=D:
bcdedit /store D:\Boot\BCD /set {default} osdevice partition=D:
bcdedit /store D:\Boot\BCD /set {bootmgr} device partition=D:

6 – Re-create the boot partition:

bcdboot C:\Windows /S D:

The system received an error from the “MySQL” database “mysql”: ER_PASSWORD_NO_MATCH (Can’t find any matching row in the user table)

One of my proactive management customers came up to me today with an issue he’s been having on one of his cPanel/WHM servers: he has been trying to add a user to a database he created and he received this error:

The system received an error from the “MySQL” database “mysql”: ER_PASSWORD_NO_MATCH (Can’t find any matching row in the user table)

Apparently commenting out skip-name-resolve in /etc/my.cnf fixed it.

then run a MySQL server restart with: /scripts/restartsrv_ mysql and you should be good to go.

How to fix -> npm ERR! cb() never called!

npm install
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>

I got this error today on a cPanel server where i am running a node.js app that’s reversed proxy to, by Nginx. The error happens when trying to run “npm install” on a large project where roughly 1200 modules should be installed. What happens is that not all of them got installed and some were missing the binaries.

After doing a ton of googling, i found that the ulimit might be an issue, so i went ahead and disabled “Shell and fork bomb protection” that limits the ulimit to 100.

Restart the shell and npm install worked without issues due to having ulimit set to 4096.

Good luck!

Ubuntu how to right click and scroll

I have not been using my Ubuntu laptop touchpad for ages, but recently i have been traveling and i am taking my laptop out every day, so i have to use the touchpad way more frequently.

A wrench got thrown in my thinking process when i saw i cannot right click or edge scroll but it looks like this behavior was just changed. If it’s simpler or not it’s for you to judge:

Right clicking in Ubuntu is now achieved by using 2 fingers to click on the touchpad.

Edge scroll seem to not be working anymore, however you can scroll by using 2 fingers instead of one, anywhere on the touchpad.

Happy Ubuntu-ing!

Ubuntu – close Discord but notifications still come

So i am using Discord a lot and i have encountered this problem more than once: you close Discord but the notifications still come even though the icon in the systray is not there. Pretty annoying right?

I found 2 cool things to deal with this:

1 – https://extensions.gnome.org/extension/1031/topicons/ – install topIcons Plus – this will show you the systray at the top and if you close any program from there, it really stays closed.

2 – press “control+q” while having Discord opened. – same result.

Enjoy!

Create MySQL Admin user

If you want to create a MySQL admin user that can connect from anywhere, feel free to tweak the string below:

#create SQL Admin user
CREATE USER ‘clusterAdmin’@’%’ IDENTIFIED BY ‘YOUR_cool_password_here’;
GRANT ALL PRIVILEGES ON *.* TO ‘clusterAdmin’@’%’;
FLUSH PRIVILEGES;

If you want to limit connections to localhost, switch the “%” to “localhost”

Google Cloud Platform – FTP

So if you’re getting an error similar to this: “500 I won’t open a connection to 10.142.0.9 (only to…” if you’re trying to use FTP on a VM on Google Cloud, fear not, it’s an easy fix.

You can do this 2 ways:

1 – FTP -p remote-host

or

2 – FTP remote-host -> log in -> then type “passive” without quotes, and everything should be just fine.

Enjoy!

MySQL 5.7 – reset root password

So there’s been a change in the way you reset the MySQL root password in MySQL 5.7 as in the “password” field got removed, so the old way of resetting the password doesn’t work anymore:

| authentication_string | text | YES | | NULL | |

So let’s go:

1 – stop the mysqld:

systemctl mysqld stop

2 – start mysqld with skip-grant so it doesn’t ask for your password:

mysqld –skip-grant-tables &

3 – change the pw:

use mysql;

update user set authentication_string=password(‘yourNewPwHere’) where user=’root’;

flush privileges;

quit

4 – stop the mysql

5 – start the mysql with the new root pw

systemctl start mysqld

Enjoy!