Proxmox: replace zfs root disk

Changing a failed bootable device
Depending on how Proxmox VE was installed it is either using systemd-boot or grub through proxmox-boot-tool [1] or plain grub as bootloader (see Host Bootloader). You can check by running:

proxmox-boot-tool status

The first steps of copying the partition table, reissuing GUIDs and replacing the ZFS partition are the same. To make the system bootable from the new disk, different steps are needed which depend on the bootloader in use.

zpool status
zpool offline rpool /dev/source # (=failed disk)
## shutdown install the new disk or replace the disks
sgdisk /dev/source -R /dev/target
sgdisk --randomize-guids /dev/target
zpool replace rpool /dev/source /dev/target
zpool status  # => resilvering is working

Note Use the zpool status -v command to monitor how far the resilvering process of the new disk has progressed.

With proxmox-boot-tool:
get uuid from new disk:

proxmox-boot-tool format
proxmox-boot-tool init

Note ESP stands for EFI System Partition, which is setup as partition #2 on bootable disks setup by the Proxmox VE installer since version 5.4. For details, see Setting up a new partition for use as synced ESP.

bareos: prune all clients

set -e set -x CLIENTS=$(echo "list clients" | bconsole | grep "-fd" | awk -F'|' '{ print $3 }' | sed 's/\ //g') for CLIENT in $CLIENTS ; do echo "pruning $CLIENT…" echo "prune jobs client=$CLIENT jobtype=backup yes" | bconsole done echo "done."

Note to self: Install MacOS in Virtualbox

Grab MacOS


sudo apt install qemu-utils make
cd scripts/bigsur
make BigSur-recovery.img
vboxmanage convertdd BigSur-recovery.img BigSur-recovery.vmdk
  • Using MacOS Profile in Virtualbox, create a new VM.
  • Remove CD-Drive. Add second SATA Disk with previously created VMKD
  • Disable Floppy Boot
  • Set RAM / CPU to sane values
  • Set Video RAM to 128MB
  • Set USB Emulation to USB3.0

After creating the VirtualBox VM

VBoxManage modifyvm "macOS" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "macOS" VBoxInternal/Devices/efi/0/Config/DmiSystemProduct "MacBookPro15,1"
VBoxManage setextradata "macOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-551B86E5744E2388"
VBoxManage setextradata "macOS" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "macOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
VBoxManage setextradata "macOS" VBoxInternal2/EfiGraphicsResolution 1280x800

For Ryzen, add

VBoxManage modifyvm "macOS" --cpu-profile "Intel Core i7-6700K"


Bigsur works.

Don’t update to MacOS12 Monterey yet. Fresh installation also won’t work. MacOS and/or the Installer of Monterey are randomly crashing.

Fix for UEFI + Hardware RAID + Linux = megaraid_sas io_page_fault

Short remider to myself and the rest of the world:

  • Upgrade Firmware to latest (yes, 2013 is better than 2011)
  • Set UEFI to UEFI ONLY! It’s 2021 as of now, so nobody should be using BIOS anymore. Seriously.
  • Boot Kernel with iommu=soft option (in grub press “e” if you are locked out already)
  • Put iommu=soft boot option to /etc/default/grub (GRUB_CMDLINE_LINUX_DEFAULT) and do a update_grub && reboot to make it a permanent fix
  • If running AMD + Proxmox, use amd_iommu=on iommu=pt
  • If running INTEL + Proxmox, use intel_iommu=on iommu=pt

Linux: Make uPD720201 great again!

After returning my first USB3 PCIe Card because it randomly stopped working and, just to experience the same problems with the card I got in exchange – thanks amazon – i finally found the root cause and permanent fix.

The Renesas uPD720201 USB 3.0 Host Controller seems to have broken S3 power saving implenented. Since you probably are not using your full size PCIe card while on battery, you can safely disable power saving features.

Edit your /etc/default/grub and add usbcore.autosuspend=-1 to your GRUB_CMDLINE_LINUX_DEFAULT. Afterwards run update_grub.

Turn your PC off and unplug from the wall outlet, this will bring your card out of S3 sleep.

Then boot your PC again – problem solved!

Compiling and running ethminer 0.19.0 on Ubuntu 21.04

git clone
cd ethminer
git checkout tags/v0.19.0
git submodule update --init --recursive
rm -rfv build && mkdir build && cd build

export CC=/usr/bin/gcc-8
export CXX=/usr/bin/g++-8
cmake .. && make . && sudo make install

ethminer -P stratum://

Notes to self:

  • use gcc-8
  • have at least 4GB Memory on the GPU
  • use a CUDA-10 compatible card

Bosch Logixx 7 Waschtrockner WHV28540/06: Fehlerspeicher auslesen und Testprogramme Starten

Fehlercode auslesen

  • Drehschalter auf 0 (aus)
  • Drehschalter auf Pos. 4 (3 Uhr)
  • Temperaturwahltaste gedrückt halten, mit gedrückter Taste Drehschalter um eine Position im Uhrzeigersinn drehen
  • Temperaturwahltaste loslassen
  • Fehlercode wird angezeigt

Bekannte Fehlercodes:

  • E09: NTC-Fühler am Luftauslass -> kann der Fühler sein, kann aber auch die Platine oder das Verbindungskabel sein (NTC lässt sich mit Widerstandsmessung und Referenzwert-Diagramm testen)

Testprogramme / Service-Modus:

  • Drehschalter auf 0 (aus)
  • Drehschalter auf 6 Uhr
  • Temperaturwahltaste gedrückt halten, mit gedrückter Taste Drehschalter um eine Position im Uhrzeigersinn drehen
  • Temperaturwahltaste loslassen
  • Testprogramme können mit dem Drehschalter gewählt und mit Start-Taste gestartet werden

MegaCli: Enable Caches

./MegaCli64 -LDSetProp -Cached -LAll -aAll
./MegaCli64 -LDSetProp EnDskCache -LAll -aAll
./MegaCli64 -LDSetProp ADRA -LAall -aAll
./MegaCli64 -LDSetProp WB -LAll -aAll

Make Ubuntu great again!

sudo apt --purge autoremove apport apport-gtk appstream snap epiphany-browser epiphany-browser-data epiphany-browser-data epiphany-extensions firefox

How to hibernate and resume from swap file in Ubuntu 20.04 using full disk encryption

On my laptop, I am running full disk encryption (LUKS with a single encrypted ext4 partition), and a single, large swap file as large as my system RAM (16GB).

Here’s how to make it work:

Make your swapfile have at least the size of your systems RAM:

sudo swapoff /swapfile
sudo dd if=/dev/zero of=/swapfile bs=$(cat /proc/meminfo | grep MemTotal | grep -oh '[0-9]*') count=1024 conv=notrunc
sudo mkswap /swapfile
sudo swapon /swapfile

Note the UUID of the partiton containing your swapfile:

$ sudo findmnt -no SOURCE,UUID -T /swapfile
/dev/nvme0n1p5 20562a02-cfa6-42e0-bb9f-5e936ea763d0

Reconfigure the package uswsusp correctly:

sudo apt -y install uswsusp
sudo dpkg-reconfigure -pmedium uswsusp
# Answer "Yes" to continue without swap space
# Select "/dev/disk/by-uuid/20562a02-cfa6-42e0-bb9f-5e936ea763d0" replace the UUID with the result from the previous findmnt command
# Encrypt: "No"

Edit the SystemD hibernate service using sudo systemctl edit systemd-hibernate.service and fill it with the following content:

ExecStartPre=-/bin/run-parts -v -a pre /lib/systemd/system-sleep
ExecStartPost=-/bin/run-parts -v --reverse -a post /lib/systemd/system-sleep

Note the offset of your swapfile relative to the partition start:

$ sudo swap-offset /swapfile
resume offset = 34818

Tell grub to resume by editiing your etc/default/grub


GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=20562a02-cfa6-42e0-bb9f-5e936ea763d0 resume_offset=34818 quiet splash"

Update grub:

sudo update-grub

Create /etc/initramfs-tools/conf.d/resume

RESUME=UUID=20562a02-cfa6-42e0-bb9e-5e936ea763d0 resume_offset=34816
# Resume from /swapfile

Update initramfs:

sudo update-initramfs -u -k all

Now you can just hibernate your system with

sudo systemctl hibernate

Clean default sources.list file for Ubuntu 20.04 focal

deb focal main restricted universe multiverse
deb focal-updates main restricted universe multiverse
deb focal-security main restricted universe multiverse
deb focal-backports main restricted universe multiverse

deb-src focal main restricted universe multiverse
deb-src focal-updates main restricted universe multiverse
deb-src focal-security main restricted universe multiverse
deb-src focal-backports main restricted universe multiverse

deb focal partner
deb-src focal partner

Saving battery life on linux using powertop

Most distributions come with a handy tool called powertop, that is able to automatically set kernel parameters to save energy.

sudo powertop --auto-tune

Settings are not permanent, to you can use the following snippet to create and load a systemd unit file to load the settings after rebooting your machine:

cat << EOF | sudo tee /etc/systemd/system/powertop.service
Description=PowerTOP auto tune

ExecStart=/usr/sbin/powertop --auto-tune


systemctl daemon-reload
systemctl enable powertop.service
systemctl start powertop.service