Zum Inhalt

Kategorie: Allgemein

Metaebene, persönliches, Blog-bezogenes

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

Leave a Comment

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!

Leave a Comment

Compiling and running ethminer 0.19.0 on Ubuntu 21.04

git clone https://github.com/ethereum-mining/ethminer.git
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://0x2a9d3072a8feb1578c2f10069010480b8742c39c@eu1.ethermine.org:4444

Notes to self:

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

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
Leave a Comment

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:

[Service]
ExecStart=
ExecStartPre=-/bin/run-parts -v -a pre /lib/systemd/system-sleep
ExecStart=/usr/sbin/s2disk
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

NOTE: THE OFFSET IS DIFFERENT FROM SYSTEM TO SYSTEM! YOU NEED TO USE THE VALUE RETURNED ON YOUR SYSTEM!

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
39 Comments

Clean default sources.list file for Ubuntu 20.04 focal

deb http://de.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://de.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://de.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://de.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

deb-src http://de.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://de.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

deb http://archive.canonical.com/ubuntu focal partner
deb-src http://archive.canonical.com/ubuntu focal partner
1 Comment

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
[Unit]
Description=PowerTOP auto tune

[Service]
Type=idle
Environment="TERM=dumb"
ExecStart=/usr/sbin/powertop --auto-tune

[Install]
WantedBy=multi-user.target
EOF

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

1 Comment

Workaround of the month: Fix broken n32 o32 virtalenv on Gentoo mips when emerging spidermonkey-52.9.1pre1

Virtualenv ist utterly broken when you run Gentoo on MIPS using n32.

This will lead to spidermonkey-52.9.1pre1 failing to emerge, because of "ImportError: No module named pkgutil" or the like. Here's how to fix it:

Step 1: as root, create a user patch directory and download my patch for virtualenv into it, so emerge applies it to the source as soon as you re-emerge the package

mkdir -p /etc/portage/patches/dev-python/virtualenv-16.0.0
wget -O /etc/portage/patches/dev-python/virtualenv-16.0.0/virtualenv-16.0.0-multilib.patch https://rephlex.de/blog/wp-content/uploads/2019/01/virtualenv-16.0.0-multilib.patch.txt

Step 2: and download multiarch.patch into the directory we just created

Step 3: as root, test if the patch executes:

cd /usr/portage/dev-python/virtualenv
ebuild virtualenc-16.0.0.ebuild clean prepare

Step 4: re-emerge dev-lang/python-exec and dev-python/virtualenv

emerge dev-lang/python-exec dev-python/virtualenv

Step 5: Create a necessary symlink

ln -s /usr/lib32/python2.7 /usr/lib/python2.7

You're done!

Leave a Comment