Fixing Windows 10 bootloader with bcdboot

In this tutorial I will outline one way to fix an issue with the Windows 10 bootloader if you’ve run into an issue. This isn’t the only possible option, however I found this worked for me after performing a restore of the main NTFS OS partition but not any of the boot or system partitions at this same time. This may also help if your Windows 10 installation isn’t detected on boot after performing a disk clone, or if you’ve installed a fresh copy of Windows 10 to fix a boot issue, and then tried to restore the NTFS OS partition over the top of that fresh install, but then the OS doesn’t boot. You may simply see a Windows boot screen with an error, or a black screen with a message along the lines of “No operating system installed”.


You’ll need access to some form of Windows 10 installation media, such as a USB drive or DVD. You can download the media creation tool from Microsoft here – https://www.microsoft.com/en-au/software-download/windows10

Boot your PC into the Windows 10 installation media.

At the first screen which asks for region information, click next. You’ll then see a “Repair your computer” option at the very bottom left. Click on this.

From here you should be able to go “Troubleshoot”, then “Advanced Options”, and finally “Command Prompt”.


At the command prompt, type –

diskpart
list volume


You should see a list of volumes (partitions) that are detected. We want to locate the volume that is used for your bootloader. Typically this is going to be the one without a drive letter already assigned, and it’ll usually be a small partition under 1GB in size. It’ll also use a FAT32 filesystem.

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     X                NTFS   Simple      1863 GB  Healthy
  Volume 1     C                NTFS   Partition    162 GB  Healthy    
  Volume 2                      FAT32  Partition    600 MB  Healthy    
  Volume 3     R                NTFS   Partition    111 GB  Healthy
  Volume 4     S                NTFS   Partition    111 GB  Healthy
  Volume 5     Z                NTFS   Partition    931 GB  Healthy
  Volume 6     V                NTFS   Partition   2794 GB  Healthy
  Volume 7     D                FAT32  Removable     28 GB  Healthy


We need to select that volume and assign a drive letter to it –

select volume 2
assign letter B
list volume


When you list the volumes again, you should now see that the volume “2” has been assigned letter “B” –

 Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     X                NTFS   Simple      1863 GB  Healthy
  Volume 1     C                NTFS   Partition    162 GB  Healthy    
  Volume 2     B                FAT32  Partition    600 MB  Healthy    
  Volume 3     R                NTFS   Partition    111 GB  Healthy
  Volume 4     S                NTFS   Partition    111 GB  Healthy
  Volume 5     Z                NTFS   Partition    931 GB  Healthy
  Volume 6     V                NTFS   Partition   2794 GB  Healthy
  Volume 7     D                FAT32  Removable     28 GB  Healthy


Exit diskpart at this point and you’ll be dropped back into the normal command prompt –

exit


Here we’ll run the “bcdboot” command. In this case, you want to first define the volume that you know has your Windows installation on it – your main NTFS OS partition. Typically you can figure this out based on the size if you know what that would be, if not… you’ll need to search around for more pointers as it’s beyond what I’ll be explaining here.


The command will be set to first define the volume where your Windows installation is, and then the drive letter we just assigned for the drive with the bootloader. So for instance we have “volume 1 – C” as our Windows install, and “volume 2 – B” as the boot volume.

bcdboot C:\Windows -s B:


This should (hopefully!) succeed, and then on reboot you’ll be able to boot into Windows. If you happen to see multiple “Windows” installs to choose from, where one is the one we’ve just fixed, but the other leads nowhere – you can run “msconfig” inside windows and go to the “Boot” tab, and then delete that second option from the boot menu.


Toshiba Canvio Slim 2TB Portable 2.5″ USB 3.0 HDD – HDTD320AS3EA / MQ04UBD200 Benchmark

Below are some basic benchmarks of the Toshiba Canvio Slim 2TB Portable 2.5″ USB 3.0 HDD – HDTD320AS3EA – Which in this instance has a Toshiba MQ04UBD200 drive inside. Please note these are purely just for my own interest and for anyone else interested – these tests are not performed for proper review purposes or under strict testing environment settings, so they may not be perfectly accurate, however they should represent ballpark figures of what to expect (unless I’ve made a mistake in my benchmark process!). At the time of writing, these can be sourced for ~$99 AUD and come with a 3 year warranty.

CrystalDiskInfo SMART details for the drive inside – a 2TB Toshiba MQ04UBD200.
CrystalDiskMark benchmark results (formatted)
Read speed benchmark from HD Tune (formatted)
Minimum – 32.7 MB/s
Maximum – 136.7 MB/s
Average – 104.6 MB/s
Access Time – 18.5 ms
Burst Rate – 157.1 MB/s
Write speed benchmark from HD Tune (unformatted)
Minimum – 0.1 MB/s
Maximum – 124.6 MB/s
Average – 41.9 MB/s
Access Time – 8.20 ms
Burst Rate – 123.7 MB/s

Simplecom CHN411 USB C to 3 Port USB 3.0 Hub with Gigabit Ethernet ( RTL8153 ) Benchmark

This is the silver version. It is also available in black.

Below are some basic iperf benchmarks of the Simplecom CHN411 USB C to 3 Port USB 3.0 Hub with Gigabit Ethernet adapter. Only the ethernet port was benchmarked as I don’t have any very high speed USB devices to test the USB 3.0 hub ports with. The adapter is confirmed to be using a Realtek RTL8153 chip for the ethernet port. This is a very common chip and you’ll likely see the same one in use across many similar looking adapters with different branding on the outside. The testing was performed using a direct connection between the adapter and a bare metal machine that uses an Intel 82574L Gigabit NIC.

iperf3 TCP test

[  5] local 192.168.1.2 port 45814 connected to 192.168.1.2 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   113 MBytes   952 Mbits/sec    0    288 KBytes       
[  5]   1.00-2.00   sec   112 MBytes   941 Mbits/sec    0    288 KBytes       
[  5]   2.00-3.00   sec   112 MBytes   941 Mbits/sec    0    303 KBytes       
[  5]   3.00-4.00   sec   112 MBytes   943 Mbits/sec    0    318 KBytes       
[  5]   4.00-5.00   sec   112 MBytes   939 Mbits/sec    0    318 KBytes       
[  5]   5.00-6.00   sec   113 MBytes   944 Mbits/sec    0    318 KBytes       
[  5]   6.00-7.00   sec   112 MBytes   941 Mbits/sec    0    318 KBytes       
[  5]   7.00-8.00   sec   112 MBytes   941 Mbits/sec    0    318 KBytes       
[  5]   8.00-9.00   sec   112 MBytes   940 Mbits/sec    0    318 KBytes       
[  5]   9.00-10.00  sec   113 MBytes   945 Mbits/sec    0    318 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.10 GBytes   943 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.10 GBytes   941 Mbits/sec                  receiver
iperf UDP test

------------------------------------------------------------
Client connecting to 192.168.1.1, UDP port 5001
Sending 1470 byte datagrams, IPG target: 11.76 us (kalman adjust)
UDP buffer size:  208 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.2 port 46526 connected with 192.168.1.1 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.11 GBytes   957 Mbits/sec
[  3] Sent 813889 datagrams
[  3] Server Report:
[  3]  0.0- 0.0 sec  1.11 GBytes  -nan bits/sec   0.037 ms    0/813889 (0%)

The results are on par with my expectations and I haven’t had any compatibility issues with the device across different operating systems.

Asus Zenbook UX431F display won’t work on Fedora 30 Linux without “NOMODESET”

Upon installing Fedora 30 to an Asus Zenbook UX431F, I encountered an issue where there is no display output unless “nomodeset” is inside the GRUB config. This limits the display resolution to 800×600 for the Zenbook’s screen which isn’t ideal. External monitors will work just fine though.

The first issue of note is that the Fedora live ISO will not output anything to the monitor when going through the normal installation process. At the boot prompt when using the live ISO you’ll need to go to Troubleshooting and Install Fedora in basic graphics mode.


Once Fedora has installed run through the following steps –

  • Download 1920×1080.bin from here or here.
  • Move that file to /lib/firmware/edid/
  • Edit /etc/default/grub and remove nomodeset then add the following line to the bottom – GRUB_CMDLINE_LINUX_DEFAULT="drm.edid_firmware=eDP-1:edid/1920x1080.bin"
  • Run sudo grub2-mkconfig -o /boot/grub2/grub.cfg
  • Reboot


Fedora should boot up and display at the proper 1920×1080 60hz resolution. After doing this there is an unfortunate issue wherein the onboard audio seems to stop working. I’m unsure as to why this is but if you use an external audio device such as a USB DAC or USB headset – audio will work fine through that. The onboard audio does work prior to this fix, however the system volume slider simply returns the volume as off or at maximum rather than incrementing properly. Edit – After a running a recent yum update I’m no longer having any issues with the onboard audio.

This issue appears to be present across most Linux distributions on some Asus Zenbook devices as tested by other users. It might also be a wider issue for devices using the Intel HD 620 integrated GPU. For further information on the actual bug and the original source of this fix, please refer to the following links –

https://bugs.launchpad.net/ubuntu/+source/linux-hwe/+bug/1821533
https://ubuntuforums.org/showthread.php?t=2420705

AzuraCast – Simple, open-source self-hosted web radio

For many years now I have hosted internet radio and internet radio events using a very simple stack of just IceCast + EZStream, tied in with a few very simple scripts and cron jobs. This has always worked incredibly reliably and kept these setups very minimal with less parts in the chain to potentially have an issue or drive up resource usage. The negative of this has always been a lack of flexibility. In the past I had looked into software such as Centova Cast, however this comes at a cost and isn’t an open-source solution – which is what I will generally opt for where possible.

Introducing AzuraCast! I have been experimenting with AzuraCast for the last few months and it certainly shows a lot of promise. Rather than repeating specifics about it myself – here is a copy-paste directly from their GitHub.

AzuraCast is a self-hosted, all-in-one web radio management suite. Using its easy installer and powerful but intuitive web interface, you can start up a fully working web radio station in a few quick minutes.

Features

For Radio Stations

  • Rich Media Management: Upload songs, edit metadata, preview songs and organize music into folders from your browser.
  • Playlists: Add music to standard-rotation playlists (in sequential or shuffled playback order) or schedule a playlist to play at a scheduled time, or once per x songs/minutes/etc.
  • Live DJs: Set up individual DJ/streamer accounts and see who’s currently streaming from your station’s profile page.
  • Web DJ: Broadcast live directly from your browser, with no extra software needed, with AzuraCast’s built-in Web DJ tool.
  • Public Pages: AzuraCast includes embeddable public pages that you can integrate into your existing web page or use as the basis for your own customized player.
  • Listener Requests: Let your listeners request specific songs from your playlists, both via an API and a simple public-facing listener page.
  • Remote Relays: Broadcast your radio signal (including live DJs) to any remote server running Icecast or SHOUTcast.
  • Web Hooks: Integrate your station with Slack, Discord, TuneIn, Twitter and more by setting up web hooks that connect to third-party services.
  • Detailed Analytics and Reports: Keep track of every aspect of your station’s listeners over time. View reports of each song’s impact on your listener count. You can also generate a report that’s compatible with SoundExchange for US web radio royalties.

For Server Administrators

  • Role-based User Management: Assign global and per-station permissions to a role, then add users to those roles to control access.
  • Custom Branding: Modify every aspect of both the internal and public-facing AzuraCast pages by supplying your own custom CSS and JavaScript.
  • Authenticated RESTful API: Individual users in the system can create API keys which have the same permissions they have in the system. The AzuraCast API is a powerful and well-documented tool for interacting with installations.
  • Web Log Viewing: Quickly diagnose problems affecting any part of the AzuraCast system through the system-wide web log viewer.
  • Automatic Radio Proxies: Many users can’t connect directly to radio station ports (i.e. 8000) by default, so AzuraCast includes an automatic nginx proxy that lets listeners connect via the http (80) and https (443) ports. These proxies are also compatible with services like CloudFlare.

AzuraCast is still currently in beta, however the developers seem very active on the project and updates are regular. This is definitely a long awaited alternative to the commercial/paid software solutions for managing internet radio. I’m very excited to watch how this project develops. For more information, check out their website over at – https://www.azuracast.com/

Verbatim 16GB Store N Go USB 3.0 Flash Drive VBPLAT16GB Benchmark

Below are some basic benchmarks of the Verbatim 16GB Store N Go Platinum USB 3.0 Flash Drive – Model – VBPLAT16GB. “Platinum” in this case refers to the colour only. There are also “Gold” versions of these same flash drives with the same specifications. Please note these are purely just for my own interest and for anyone else interested – these tests are not performed for proper review purposes or under strict testing environment settings, so they may not be perfectly accurate, however they should represent ballpark figures of what to expect (unless I’ve made a mistake in my benchmark process!)


CrystalDiskMark benchmark results (formatted)
Read speed benchmark from HD Tune (unformatted)
Minimum – 109.2 MB/s
Maximum – 138.6 MB/s
Average – 126.4 MB/s
Access Time – 0.566 ms
Burst Rate – 74.8 MB/s
Write speed benchmark from HD Tune (unformatted)
Minimum – 6.1 MB/s
Maximum – 25.7 MB/s
Average – 18.6 MB/s
Access Time – 613.9 ms
Burst Rate – 65.7 MB/s

SanDisk 16GB Ultra USB 3.0 Flash Drive SDCZ4816GB Benchmark

Below are some basic benchmarks of the SanDisk 16GB Ultra USB 3.0 Flash Drive – Model – SDCZ4816GB. Please note these are purely just for my own interest and for anyone else interested – these tests are not performed for proper review purposes or under strict testing environment settings, so they may not be perfectly accurate, however they should represent ballpark figures of what to expect (unless I’ve made a mistake in my benchmark process!)


CrystalDiskMark benchmark results (formatted)

Read speed benchmark from HD Tune (unformatted)
Minimum – 94.5 MB/s
Maximum – 117.7 MB/s
Average – 104.5 MB/s
Access Time – 0.683 ms
Burst Rate – 75 MB/s

Write speed benchmark from HD Tune (unformatted)
Minimum – 4.7 MB/s
Maximum – 16.2 MB/s
Average – 11.9 MB/s
Access Time – 4.40 ms
Burst Rate – 75.7 MB/s

Installing Rocket.Chat on Ubuntu Xenial 16.04 via Snap

This is a simple tutorial to get Rocket.Chat running on a Ubuntu Xenial 16.04 server (You’ll likely be perfectly fine to run through the same process on a different Ubuntu version such as 18.04 if you’d prefer) In this case we’re installing this on a fresh server and we’ll be installing Rocket.Chat as a Snap and using Caddy as a reverse proxy. Caddy will also deal with issuing SSL certificates via Let’s Encrypt. With this you’ll be able to get Rocket.Chat up and running within ~10 minutes, from there you can go on and make further server configuration changes for security and so on, as well as configure Rocket.Chat in more depth – which won’t be covered within the scope of this tutorial.


Let’s first start with some updates.

apt-get update
apt-get upgrade


Basic UFW setup

Let’s setup a basic firewall using UFW. First install UFW if it’s not installed –

apt-get install ufw


Setup the default access rules –

ufw default deny incoming
ufw default allow outgoing


Setup the firewall rules that we’ll want –

ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp


Enable the firewall –

ufw enable


You can check the status of ufw with –

ufw status


If you add or remove rules you should reload ufw with –

ufw reload


If you need to disable ufw you can do so with –

ufw disable


Install Fail2Ban

apt-get install fail2ban


Install Rocket.Chat as a Snap

Install Snap if it’s not already installed –

apt-get install snapd


Install Rocket.Chat –

snap install rocketchat-server


At this point the Rocket.Chat service will have automatically started, you can check if it’s running with –

service snap.rocketchat-server.rocketchat-server status


Configure Caddy and SSL

Initial configuration-

snap set rocketchat-server caddy-url=https://<your-domain-name>
snap set rocketchat-server caddy=enable
snap set rocketchat-server https=enable
rocketchat-server.initcaddy


Assuming you didn’t have any errors, restart Rocket.Chat and Caddy –

systemctl restart snap.rocketchat-server.rocketchat-server.service
systemctl restart snap.rocketchat-server.rocketchat-caddy.service


You can check Caddy’s logs with the following command

journalctl -r | grep caddy | less


Redirect HTTP to HTTPS

Redirecting HTTP to HTTPS is handled in the Caddy configuration by ommitting the http or https prefix. For instance you should have something like this inside /var/snap/rocketchat-server/current/Caddyfile –

your-domain-name.com {
  proxy / localhost:3000 {
    websocket
    transparent
  }
}


Restart Caddy once again after saving your changes –

systemctl restart snap.rocketchat-server.rocketchat-caddy


Onto Rocket.Chat itself!

At this point you’ll have a working Rocket.Chat installation running. You can browse to https://yourserver.com and you should be presented with the Setup Wizard screen to create the first user whom will by the Admin by default.

Once logged in, you may get a pop-up stating something along the lines of – The setting Site URL is configured to http://localhost and you are accessing from https://yourserver.com - Do you want to change to https://yourserver.com ? – You’ll want to click YES.

At this stage you’ll want to setup Rocket.Chat itself, so please refer to their documentation here – https://rocket.chat/docs


~Extra~

You can install a Discord style dark theme using this here! https://github.com/0x0049/Rocket.Chat.Dark


Backup and restore or migrate a Snap based installation of Rocket.Chat

This is a simple tutorial to backup and restore, or backup and migrate a Snap based installation of Rocket.Chat.


Stop the Rocket.Chat server

First you’ll need to stop the Rocket.Chat server.

service snap.rocketchat-server.rocketchat-server stop

Note that we’re only stopping the rocketchat-server service, not the MongoDB service, which should still be running. Check with –

service snap.rocketchat-server.rocketchat-mongo status | grep Active
Active: active (running) (…)


Create a backup.

snap run rocketchat-server.backupdb

You should see output similar to this –

[+] A backup of your data can be found at /var/snap/rocketchat-server/common/backup/rocketchat_backup_<timestamp>.tar.gz

Download that backup file over SFTP for instance, or transfer it to the server you’re migrating your Rocket.Chat installation to.

Your Rocket.Chat server will still be stopped at this point, so if you just wanted to create a backup for your existing installation, you can start the server back up with –

service snap.rocketchat-server.rocketchat-server start


Migrate (or restore) from backup

Now if we’re going to migrate our Rocket.Chat installation, on the server we’re migrating the installation to, you’ll want to have already installed Rocket.Chat as a Snap. Once done upload the *.tar.gz backup file from earlier to /var/snap/rocketchat-server/common/ on the destination server.

Once again, stop the rocketchat-server service, but not the MongoDB service –

service snap.rocketchat-server.rocketchat-server stop

service snap.rocketchat-server.rocketchat-mongo status | grep Active
Active: active (running) (…)

Restore using the *.tar.gz backup that we created –

snap run rocketchat-server.restoredb /var/snap/rocketchat-server/common/rocketchat_backup.tgz

*** ATTENTION ***
* Your current database WILL BE DROPPED prior to the restore!
* Would you like to make a backup of the current database before proceeding?
* (y/n/Q)>

Y

[*] Extracting backup file...
[*] Restoring data...
[*] Preparing database...
[+] Restore completed! Please restart the snap.rocketchat services to verify.

Start the Rocket.Chat server at this point, and your installation will now be running based on the Rocket.Chat Snap backup that was performed!

service snap.rocketchat-server.rocketchat-server start

Installing Rocket.Chat on Ubuntu Xenial 16.04 via Snap with an NGINX reverse proxy

Please note that Rocket.Chat Snaps now come with Caddy to deal with the reverse proxy and free SSL certificate’s via Let’s Encrypt – so you may wish to refer to my newer post here. NGINX won’t have websockets configured if you use this guide – which are required if you intend to use the mobile Rocket.Chat apps.

This is a simple tutorial to get Rocket.Chat running on a Ubuntu Xenial 16.04 server (You’ll likely be perfectly fine to run through the same process on a different Ubuntu version such as 18.04 if you’d prefer) In this case we’re installing this on a fresh server and we’ll be installing Rocket.Chat as a Snap and using NGINX as a reverse proxy, as well as setting up an SSL certificate via Let’s Encrypt. With this you’ll be able to get Rocket.Chat up and running within ~10 minutes, from there you can go on and make further server configuration changes for security and so on, as well as configure Rocket.Chat in more depth – which won’t be covered within the scope of this tutorial.


Let’s first start with some updates.

apt-get update
apt-get upgrade


Basic UFW setup

Let’s setup a basic firewall using UFW. First install UFW if it’s not installed –

apt-get install ufw


Setup the default access rules –

ufw default deny incoming
ufw default allow outgoing


Setup the firewall rules that we’ll want –

ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp


Enable the firewall –

ufw enable


You can check the status of ufw with –

ufw status


If you add or remove rules you should reload ufw with –

ufw reload


If you need to disable ufw you can do so with –

ufw disable


Install Fail2Ban

apt-get install fail2ban


Install Rocket.Chat as a Snap

Install Snap if it’s not already installed –

apt-get install snapd


Install Rocket.Chat –

snap install rocketchat-server


At this point the Rocket.Chat service will have automatically started, you can check if it’s running with –

service snap.rocketchat-server.rocketchat-server status


Install and configure NGINX to use as a reverse proxy + SSL setup

Install NGINX –

apt install nginx
systemctl start nginx
systemctl enable nginx


Remove the default NGINX site –

rm /etc/nginx/sites-enabled/default


Create the NGINX config for Rocket.Chat

vim /etc/nginx/sites-available/rocketchat.conf


Once inside vim, you should have the following (edit “yourserver.com” to be your actual domain that you’re going to use for this server) –

server {
     listen 80;
 
     server_name yourserver.com; 

     location / {
     proxy_pass http://localhost:3000/; 
     }
 }


Enable the new configuration by creating a link to it from /etc/nginx/sites-available/ –

ln -s /etc/nginx/sites-available/rocketchat.conf /etc/nginx/sites-enabled/


Test the configuration –

nginx -t


Assuming no errors are reported, reload the NGINX config with –

nginx -s reload


SSL Setup using Let’s Encrypt + Certbot

Install Certbot and run it –

apt-get install software-properties-common
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install python-certbot-nginx
certbot --nginx


Follow the prompts on screen and you should be issued a valid Let’s Encrypt SSL certificate. Make sure you do choose to force a HTTPS redirect when prompted.

Certbot will automatically deal with SSL certificate renewal, a cron will automatically be created under /etc/cron.d/certbot. You can test the renewal process as a dry run via –

certbot renew --dry-run


Certbot will have updated the NGINX configuration, test that the config is valid with –

certbot renew --dry-run


Assuming no errors are reported, reload the NGINX config with –

nginx -s reload


Onto Rocket.Chat itself!

At this point you’ll have a working Rocket.Chat installation running. You can browse to https://yourserver.com and you should be presented with the Setup Wizard screen to create the first user whom will by the Admin by default.

Once logged in, you should get a pop-up stating something along the lines of – The setting Site URL is configured to http://localhost and you are accessing from https://yourserver.com - Do you want to change to https://yourserver.com ? – You’ll want to click YES.

At this stage you’ll want to setup Rocket.Chat itself, so please refer to their documentation here – https://rocket.chat/docs


~Extra~

You can install a Discord style dark theme using this here! https://github.com/0x0049/Rocket.Chat.Dark