Category Archives: Blog

Recovering a bad eMMC flashed image on NanoPi R2C

FriendlyElec has poor instructions in their wiki and after much trial and error I finally was able to recover and reset the onboard eMMC storage on my Nanopi R2C Plus.

Backstory: I used FriendlyElec eFlasher tool to flash a raw .img file to the onboard eMMC 8GB storage of my NanoPi. This led to an onbootable system. I had to use UART serial to view the errors and debug.

You will need a UART serial connection and putty installed. This quick how-to guide is intended to be ‘cliff notes’ on what I did to get my device back in working order; you will have to teach yourself or search how to use some of these processes.

Steps

  1. Connect UART debug serial to the board.
  2. Use putty or terminal to verify that device is unable to boot due to onboard eMMC image.
  3. Prepare a microSD card for recovery (it will wipe all your data). Download rk3328-sd-friendlywrt-5.15-20220125.img and use balenaEtcher to prep the MicroSD.
  4. Make sure the board is disconnected from power but you have the UART connected and putty running. Now short the “MASK” positive and negative connectors in the board with some cables; I used the GPIO connector nearby as short-circuit source since simply joining both MASK connectors together wasn’t doing anything.
  5. While you are shorting the MASK and the board is powered off, then turn on board. It should short-circuit at boot and skip using eMMC for boot and use the SD card instead.
  6. Once the image is booted, use SSH to connect to the OS and wipe out the
/dev/mmcblk2

Wireguard VPN on OpenVZ VPS

There are a few tutorials out there for setting this up and while some worked, I found this one deep in a chinese github and its my preference for this kind of setup:

curl -fsSL git.io/wireguard-go.sh | sudo bash

ZFS remove and re-add same disk (use different disk labels)

To remove and re-add devices in a zpool, you will need to offline the disk, detach the disk, wipe the gpt partition then re-add it to pool as a new disk. This will re-silver the pool.

sgdisk -Z /dev/disk/by-id/ata-WDC_WD100EMAZ-

Steps.

  1. zpool offline gdata wwn-0x5000cca273cf31b3
  2. zpool detach …
  3. sgdisk -Z …
  4. zpool attach gdata (disk-still-in-mirror-here) (new-disk /dev/disk/by-id/ata-WDC_WD100EMAZ)

Netboot.xyz

Tiny bootable .iso that downloads liveCD images for multiple OS like Debian.

Windows Uninstaller tool

Came across Revo Uninstaller which seems to be very useful tool to make sure that all files and registry keys are actually removed from windows when you uninstall a program.

https://www.revouninstaller.com/revo-uninstaller-free-download/

ZFS on Proxmox thin-provisoned VMs disks

I’ve been a huge fan of promox since version 1.0 – they later implemented native support of my favorite filesystem ZFS and if you are an early adopter like me your proxmox /etc/pve/storage.cfg file may not have some settings like sparse that the new installations configure by default.

Checking if ZFS VM disk is thin-provisoned

Use the following command to see the zfs properties we care about:

zfs get volblocksize,volsize,refreservation,used  gdata/pve/base-152-disk-0

Expected output


NAME                       PROPERTY        VALUE      SOURCE
gdata/pve/base-152-disk-0  volblocksize    8K         default
gdata/pve/base-152-disk-0  volsize         64G        local
gdata/pve/base-152-disk-0  refreservation  none       local
gdata/pve/base-152-disk-0  used            7.31G      -

The property refreservation=none tells us this disk is thin-provisioned. Meaning ZFS won’t guarantee and account for the VM ‘max disk size’ in the zpool usage metrics. This may be helpful if you want to overprovision a VM disk to say 1TB but rarely use that much and you don’t want zpool list to claim you have 1TB phantom disk usage.

What does a non thin-provisioned ZFS VM disk look like?

The volsize=64G and refreservation=64G would be set on the example above.

ASRock Rack X470D4U build notes

My notes and resources on X470D4U. This motherboard needs special tweaks in order to have the DDR4 memory settings and timings work.

There are also many ‘quirks’ with this board, when modifying DDR4 overclocking settings the board tends to fail to POST. Removing the CMOS battery and unplugging should do the trick at resetting – but sometimes this is not enough. The workaround is using IPMI to do a ‘bios update’ without preserving bios settings. This usually makes my system be able to POST again.

Memory tweaking

Windows 10 (due to tools)
* Thaiphoon Burner (to get ram info – but didn’t work for me.)
* ZenTimings (visualization for voltages from Ryzen platform – actually detects individual dims)
* AMD Ryzen Master Utility (AMD own tool)
* HWInfo64
* CPU-Z

Tuning resources / videos:
Video explains detecting memory, using Ryzen Calculator for manual settings input of motherboard.

BIOS walk through for this board. In German.

Some of these tools like Thaiphoon mail fail to work if you don’t have the AMD Chipset drivers installed. Download them, install, reboot, retry. Use the all-in-one detect tool to take care of it (lazy method) although I did all this it did not work for me. Still get the “SPD EEPROM” error. Let me know if you find a solution.

A good guide on memory OC. Another great explanation in detail.

BIOS Post codes

https://forum.level1techs.com/t/list-of-dr-debug-bios-codes/114364

AMD specific gotcha

This comment on reddit can explain why a bios flash is the only way to recovery from bad memory OC settings. Includes terminology too.

mostly the same, but…

DRAM Voltage = MEM VDDIO

SOC Voltage = VDDCR SOC

VDDG CCD Voltage = not available in RM

VDDG IOD Voltage = CLDO VDDG

cLDO VDDP Voltage = CLDO VDDP

MEM VTT is simply half of MEM VDDIO and usually there is no need to change that. And you can find it on the Advanced page of DRAM calc.

There is a chance to brick the BIOS by setting wrong values in RM (because they aren’t stored in cmos and can’t be cleared easily). If you don’t have USB flash or dual BIOS then don’t touch it, use BIOS menu.

Finding the cheapest Virtual Private Server (VPS) providers (<$10 per year)

Sometimes we want to test software or do remote monitoring and testing that you may not want to pay a premium to do, or maybe you just want to do it as a hobby. In this post I will share some tips on where to find dirt-cheap providers of virtual servers (VPS).

I strongly advise against placing any production or critical workflows on any of these; use for testing or fun.

Continue reading

How to setup dual-stack IPv4 IPv6 Azure VM without a load-balancer

I wanted to document my Microsoft Azure saga in getting a public IPv6 address to work in a virtual machine without a load balancer in front of it. My needs were pretty simple and straightforward I wanted a virtual server that had a static IPv4 and IPv6 public addresses so that I can monitor my home network and other websites.

You would think this would be pretty easy, a few clicks and done? That wasn’t my experience on Azure and setting this up isn’t easy nor straightforward. Below is how to get it done, if this helps you – you can buy me a coffee or beer.

Continue reading

Bootable USB disk from .iso image

If you’re looking to create a bootable USB drive to install multiple operating systems or other images you should take a look into Ventoy.

Ventoy is an open source tool that allows you to format the USB disk and drop any .iso image into the USB drive – magically making any .iso be bootable without having to reformat the USB disk multiple times when you want to image different things.

https://www.ventoy.net/