Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Orange Pi Zero 2 crashes when doing the benchmark test #22

Closed
munecito opened this issue May 10, 2022 · 29 comments
Closed

Orange Pi Zero 2 crashes when doing the benchmark test #22

munecito opened this issue May 10, 2022 · 29 comments

Comments

@munecito
Copy link

It crashes at the same place each time.

"Running additional hardware identification tests..." It just freezes and can't do anything with the SBC other than pull the cord to restart it.

@TheRemote
Copy link
Owner

Hey munecito,

That is a very strange issue and I've never heard of it before (except for on Pi using NVMe with too little power).

The weird thing about yours is it sounds like it's the identification tests that are freezing and NOT the actual benchmark which is where we typically expect things to freeze if there is power issues.

I don't think that I have a successful test on the Zero 2 so it's possible there's some kind of bug / problem for sure.

I do have an idea of how to try to narrow it down if you are willing to indulge / try a few things. This is the code in question:

Print_Style "Running additional hardware identification tests..." "$YELLOW"
Test_udevadm=$(udevadm info -a -n "$BootDrive" 2>&1 | sed 's/;/!/g' | sed '/^[[:space:]]*$/d')
Test_lsblk=$(lsblk -l -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL 2>&1 | sed 's/;/!/g')
Test_lshw=$(lshw 2>&1 | sed 's/;/!/g')
Test_lsusb=$(lsusb 2>&1 | sed 's/;/!/g')
Test_lsscsi=$(lsscsi -Lv 2>&1 | sed 's/;/!/g')
Test_lscpu=$(lscpu 2>&1 | sed 's/;/!/g')
Test_lspci=$(lspci -v 2>&1 | sed 's/;/!/g')
Test_findmnt=$(findmnt -n 2>&1 | sed 's/;/!/g')
Test_diskbyid=$(ls /dev/disk/by-id 2>&1 | sed 's/;/!/g')
Test_df=$(df -h 2>&1 | sed 's/;/!/g')
Test_cpuinfo=$(cat /proc/cpuinfo 2>&1 | sed 's/;/!/g')
Test_dmesg=$(dmesg -Lnever 2>&1 | grep usb | sed 's/;/!/g')
Test_fstab=$(cat /etc/fstab 2>&1 | sed 's/;/!/g')
Test_dmidecode=$(dmidecode 2>&1 | sed 's/;/!/g')
Test_hwinfo=$(hwinfo --arch --bios --block --bridge --disk --framebuffer --gfxcard --hub --ide --isapnp --listmd --memory --mmc-ctrl --monitor --netcard --partition --pci --pcmcia --pcmcia-ctrl --redasd --scsi --sound --storage-ctrl --sys --tape --usb --usb-ctrl 2>&1 | sed 's/;/!/g')
Test_nvme=$(nvme list -o json 2>&1)
Test_nvme+=$(nvme show-regs "$BootDrive" -H 2>&1 | sed 's/;/!/g')
Test_smartctl=$(smartctl -x "$BootDrive" 2>&1 | sed 's/;/!/g')
Test_smartctl=$(sudo sdparm --long --verbose "$BootDrive" 2>&1 | sed 's/;/!/g')
Capacity=$(lsblk -l 2>&1 | grep "$BootDriveSuffix" -m 1 | awk 'NR==1{ print $4 }' | sed 's/,/./g')

The problem must be in this section. If you pretty much paste those lines one at a time we should be able to find exactly what is going wrong / locking it up. After this there is an additional message you would be seeing if it got that far where it begins the actual benchmark.

If you can find out which line is crashing the system we should be able to learn more / potentially even fix it. Thanks!

@munecito
Copy link
Author

Hello.

Those lines run fine on their on. but if I run the test as per your automated script it does stop at the same time each time and the orange pi crashes.

I am going to try to run it on a fresh install of armbian to see if that does the trick. Maybe it is Armbian that makes it crash, or maybe is the pihole that runs on the same SBC. Funnily enough the reported temperature does not go past 53C.

Here is the transcript of what happens until the point it freezes.

$ sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 33539 100 33539 0 0 330k 0 --:--:-- --:--:-- --:--:-- 334k
Board information: Manufacturer: - Model: Orange Pi Zero 2 - Architecture: aarch64 - OS: Debian GNU/Linux 11 (bullseye)
Fetching required components ...
Hit:1 http://deb.debian.org/debian bullseye InRelease
Get:2 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:3 http://security.debian.org bullseye-security InRelease [44.1 kB]
Get:5 http://deb.debian.org/debian bullseye-backports InRelease [44.2 kB]
Hit:4 http://sg-mirror.bret.dk/armbian/apt bullseye InRelease
Get:6 http://deb.debian.org/debian bullseye-backports/main arm64 Packages.diff/Index [63.3 kB]
Hit:7 http://giteduberger.fr rpimonitor/ InRelease
Get:8 http://deb.debian.org/debian bullseye-backports/main armhf Packages.diff/Index [63.3 kB]
Get:9 http://deb.debian.org/debian bullseye-backports/main armhf Contents (deb).diff/Index [63.6 kB]
Get:10 http://deb.debian.org/debian bullseye-backports/main all Contents (deb).diff/Index [63.6 kB]
Get:11 http://deb.debian.org/debian bullseye-backports/main arm64 Contents (deb).diff/Index [63.6 kB]
Get:12 http://deb.debian.org/debian bullseye-backports/main arm64 Packages T-2022-05-11-0202.22-F-2022-05-10-1404.38.pdiff [4,150 B]
Get:12 http://deb.debian.org/debian bullseye-backports/main arm64 Packages T-2022-05-11-0202.22-F-2022-05-10-1404.38.pdiff [4,150 B]
Get:13 http://deb.debian.org/debian bullseye-backports/main armhf Packages T-2022-05-11-0202.22-F-2022-05-10-1404.38.pdiff [4,162 B]
Get:13 http://deb.debian.org/debian bullseye-backports/main armhf Packages T-2022-05-11-0202.22-F-2022-05-10-1404.38.pdiff [4,162 B]
Get:14 http://deb.debian.org/debian bullseye-backports/main armhf Contents (deb) T-2022-05-11-0202.22-F-2022-05-10-2005.15.pdiff [774 B]
Get:14 http://deb.debian.org/debian bullseye-backports/main armhf Contents (deb) T-2022-05-11-0202.22-F-2022-05-10-2005.15.pdiff [774 B]
Get:15 http://deb.debian.org/debian bullseye-backports/main all Contents (deb) T-2022-05-10-1404.38-F-2022-05-10-1404.38.pdiff [118 B]
Get:15 http://deb.debian.org/debian bullseye-backports/main all Contents (deb) T-2022-05-10-1404.38-F-2022-05-10-1404.38.pdiff [118 B]
Get:16 http://deb.debian.org/debian bullseye-backports/main arm64 Contents (deb) T-2022-05-11-0202.22-F-2022-05-10-2005.15.pdiff [785 B]
Get:16 http://deb.debian.org/debian bullseye-backports/main arm64 Contents (deb) T-2022-05-11-0202.22-F-2022-05-10-2005.15.pdiff [785 B]
Fetched 455 kB in 15s (30.2 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
bc is already the newest version (1.07.1-2+b2).
curl is already the newest version (7.74.0-1.3+deb11u1).
dmidecode is already the newest version (3.3-2).
fio is already the newest version (3.25-2).
hdparm is already the newest version (9.60+ds-1).
hwinfo is already the newest version (21.72-1).
libxml-dumper-perl is already the newest version (0.81-1.3).
lshw is already the newest version (02.18.85-0.7).
lsscsi is already the newest version (0.31-1).
nvme-cli is already the newest version (1.12-5).
pciutils is already the newest version (1:3.7.0-5).
sdparm is already the newest version (1.10-1).
smartmontools is already the newest version (7.2-1).
usbutils is already the newest version (1:013-3).
xxd is already the newest version (2:8.2.2434-3+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
iozone3 is already the newest version (489-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Clock speeds: CPU: 1512 - Core: - RAM:
System rootfs drive (/) has been detected as /dev/mmcblk0p1 (mmcblk0p1)
Starting INXI hardware identification...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1062k 100 1062k 0 0 747k 0 0:00:01 0:00:01 --:--:-- 747k
System:
Kernel: 4.9.255-sun50iw9 arch: aarch64 bits: 64 compiler: gcc v: 8.3.0 Console: pty pts/0
Distro: Armbian GNU/Linux 11 (bullseye)
Machine:
Type: ARM System: Orange Pi Zero 2 details: N/A
CPU:
Info: quad core model: N/A variant: cortex-a53 bits: 64 type: MCP arch: ARMv8 rev: 4
Speed (MHz): avg: 480 min/max: 480/1512 cores: 1: 480 2: 480 3: 480 4: 480 bogomips: N/A
Features: Use -f option to see features
Graphics:
Device-1: sunxi-disp driver: disp v: N/A bus-ID: N/A
Device-2: sunxi-hdmi driver: allwinner,sunxi_hdmi v: N/A bus-ID: N/A
Device-3: mali-midgard driver: N/A bus-ID: N/A
Display: unspecified server: N/A driver: N/A note: X driver n/a tty: 80x40
Message: Unable to show GL data. Required tool glxinfo missing.
Network:
Device-1: sunxi-gmac driver: sunxi_gmac v: kernel port: N/A bus-ID: N/A
IF: eth0 state: up speed: 1000 Mbps duplex: full mac:
Device-2: sunxi-wlan driver: sunxi_wlan v: N/A bus-ID: N/A
IF-ID-1: dummy0 state: down mac:
IF-ID-2: gre0 state: down mac:
IF-ID-3: gretap0 state: down mac:
IF-ID-4: ip6_vti0 state: down mac:
IF-ID-5: ip6tnl0 state: down mac:
IF-ID-6: ip_vti0 state: down mac:
IF-ID-7: sit0 state: down mac:
IF-ID-8: tunl0 state: down mac:
IF-ID-9: wlan0 state: dormant mac:
Drives:
Local Storage: total: 29.81 GiB used: 1.53 GiB (5.1%)
ID-1: /dev/mmcblk0 model: JB1RT size: 29.81 GiB
Message: No optical or floppy data found.
Partition:
ID-1: / size: 28.92 GiB used: 1.53 GiB (5.3%) fs: ext4 dev: /dev/mmcblk0p1
Info:
Processes: 171 Uptime: 12h 58m Memory: 965.2 MiB used: 213 MiB (22.1%) Init: systemd runlevel: 5
Compilers: gcc: 10.2.1 Packages: 565 Client: Sudo v: 1.9.5p2 inxi: 3.3.15
Running additional hardware identification tests...

Let me try on a fresh install and report back

@munecito
Copy link
Author

No dice.

Fresh install gets just to the same point as with pihole installed.

https://imgur.com/awEEIWL

I don't know how else I can help you but do let me know and I will give it a go.

@TheRemote
Copy link
Owner

TheRemote commented May 11, 2022

Hello,

Thanks a ton for your investigation. Supporting other boards is brand new and you're the first person I've heard really giving it a go but it's very new and hasn't had it for years and years (although many people took it anyway).

I've added some additional debug messages to the script to try and pinpoint what is going wrong here. There is some additional code that runs after what I sent you to try and the problem must be after that. I added several messages to tell us which "track" it's taking here.

After the code I sent you is the following:

# Check for Micro SD / MMC card
if [[ "$BootDrive" == *"mmcblk"* ]]; then
  # Determine if MMC or Micro SD
  RootDrive=$(echo "$BootDrive" | cut -dp -f1 | cut -d/ -f3)
  MMCType=$(cat /sys/block/"$RootDrive"/device/type)

  # Get card information
  Manufacturer=$(echo "$Test_udevadm" | grep -m 1 "manfid" | cut -d= -f3 | cut -d\" -f2 | xargs)
  if [ -z "$Manufacturer" ]; then
    Manufacturer=$(cat /sys/block/"$RootDrive"/device/manfid)
    Product=$(cat /sys/block/"$RootDrive"/device/type)
    Firmware=$(cat /sys/block/"$RootDrive"/device/fwrev)
    DateManufactured=$(cat /sys/block/"$RootDrive"/device/date)
    Model=$(cat /sys/block/"$RootDrive"/device/name)
    Version=$(cat /sys/block/"$RootDrive"/device/hwrev)
    Vendor=$(cat /sys/block/"$RootDrive"/device/oemid)
    SSR=$(cat /sys/block/"$RootDrive"/device/ssr)
    SCR=$(cat /sys/block/"$RootDrive"/device/scr)
    CID=$(cat /sys/block/"$RootDrive"/device/cid)
    CSD=$(cat /sys/block/"$RootDrive"/device/csd)
    OCR=$(cat /sys/block/"$RootDrive"/device/ocr)
  else
    Product=$(echo "$Test_udevadm" | grep -m 1 "{type}" | cut -d= -f3 | cut -d\" -f2 | xargs)
    Firmware=$(echo "$Test_udevadm" | grep -m 1 "{fwrev}" | cut -d= -f3 | cut -d\" -f2 | xargs)
    DateManufactured=$(echo "$Test_udevadm" | grep -m 1 "date" | cut -d= -f3 | cut -d\" -f2 | xargs)
    Model=$(echo "$Test_udevadm" | grep -m 1 "{name}" | cut -d= -f3 | cut -d\" -f2 | xargs)
    Version=$(echo "$Test_udevadm" | grep -m 1 "{hwrev}" | cut -d= -f3 | cut -d\" -f2 | xargs)
    Vendor=$(echo "$Test_udevadm" | grep -m 1 "oemid" | cut -d= -f3 | cut -d\" -f2 | xargs | xxd -r)
    SSR=$(echo "$Test_udevadm" | grep -m 1 "{ssr}" | cut -d= -f3 | cut -d\" -f2 | xargs)
    SCR=$(echo "$Test_udevadm" | grep -m 1 "{scr}" | cut -d= -f3 | cut -d\" -f2 | xargs)
    CID=$(echo "$Test_udevadm" | grep -m 1 "{cid}" | cut -d= -f3 | cut -d\" -f2 | xargs)
    CSD=$(echo "$Test_udevadm" | grep -m 1 "{csd}" | cut -d= -f3 | cut -d\" -f2 | xargs)
    OCR=$(echo "$Test_udevadm" | grep -m 1 "{ocr}" | cut -d= -f3 | cut -d\" -f2 | xargs)
  fi

This had no output logging indicating that the other hardware tests finished so I added that in and a few other messages as well.

The only possibility I'm thinking is if for some reason accessing those /sys/block registers is taking down the system. Definitely possible but not something I've seen / heard of before. There were a couple of other specific possibilities that could have ran some more code before any output and all of those have messages now indicating that's where it is currently at.

Would you be willing to run it again? I still expect the problem to happen but I'm expecting different output this time. I didn't include this last time because I don't see anything in there that would explain it off the top of my head and figured for sure that one of those tests must have been triggering it.

Thanks!

@munecito
Copy link
Author

munecito commented May 11, 2022

I tried 3 different things here:

First I ran the script as per normal. I don't know if having a recurrent DNS didn't update the script but the results were the same as before:

Running the script

$ sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash[sudo] password for pihole:
Sorry, try again.
[sudo] password for pihole:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 33779 100 33779 0 0 73432 0 --:--:-- --:--:-- --:--:-- 73273
Board information: Manufacturer: - Model: Orange Pi Zero 2 - Architecture: aarch64 - OS: Debian GNU/Linux 11 (bullseye)Fetching required components ...
Hit:2 http://security.debian.org bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye InRelease
Hit:4 http://deb.debian.org/debian bullseye-updates InRelease
Hit:5 http://deb.debian.org/debian bullseye-backports InRelease
Hit:6 http://giteduberger.fr rpimonitor/ InRelease
Hit:1 http://sg-mirror.bret.dk/armbian/apt bullseye InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
bc is already the newest version (1.07.1-2+b2).
curl is already the newest version (7.74.0-1.3+deb11u1).
dmidecode is already the newest version (3.3-2).
fio is already the newest version (3.25-2).
hdparm is already the newest version (9.60+ds-1).
hwinfo is already the newest version (21.72-1).
libxml-dumper-perl is already the newest version (0.81-1.3).
lshw is already the newest version (02.18.85-0.7).
lsscsi is already the newest version (0.31-1).
nvme-cli is already the newest version (1.12-5).
pciutils is already the newest version (1:3.7.0-5).
sdparm is already the newest version (1.10-1).
smartmontools is already the newest version (7.2-1).
usbutils is already the newest version (1:013-3).
xxd is already the newest version (2:8.2.2434-3+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
iozone3 is already the newest version (489-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Clock speeds: CPU: 1512 - Core: - RAM:
System rootfs drive (/) has been detected as /dev/mmcblk0p1 (mmcblk0p1)
Starting INXI hardware identification...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1062k 100 1062k 0 0 675k 0 0:00:01 0:00:01 --:--:-- 675k
System:
Kernel: 4.9.255-sun50iw9 arch: aarch64 bits: 64 compiler: gcc v: 8.3.0 Console: pty pts/0
Distro: Armbian GNU/Linux 11 (bullseye)
Machine:
Type: ARM System: Orange Pi Zero 2 details: N/A
CPU:
Info: quad core model: N/A variant: cortex-a53 bits: 64 type: MCP arch: ARMv8 rev: 4
Speed (MHz): avg: 480 min/max: 480/1512 cores: 1: 480 2: 480 3: 480 4: 480 bogomips: N/A
Features: Use -f option to see features
Graphics:
Device-1: sunxi-disp driver: disp v: N/A bus-ID: N/A
Device-2: sunxi-hdmi driver: allwinner,sunxi_hdmi v: N/A bus-ID: N/A
Device-3: mali-midgard driver: N/A bus-ID: N/A
Display: unspecified server: N/A driver: N/A note: X driver n/a tty: 80x40
Message: Unable to show GL data. Required tool glxinfo missing.
Network:
Device-1: sunxi-gmac driver: sunxi_gmac v: kernel port: N/A bus-ID: N/A
IF: eth0 state: up speed: 1000 Mbps duplex: full mac:
Device-2: sunxi-wlan driver: sunxi_wlan v: N/A bus-ID: N/A
IF-ID-1: dummy0 state: down mac:
IF-ID-2: gre0 state: down mac:
IF-ID-3: gretap0 state: down mac:
IF-ID-4: ip6_vti0 state: down mac:
IF-ID-5: ip6tnl0 state: down mac:
IF-ID-6: ip_vti0 state: down mac:
IF-ID-7: sit0 state: down mac:
IF-ID-8: tunl0 state: down mac:
IF-ID-9: wlan0 state: dormant mac:
Drives:
Local Storage: total: 29.81 GiB used: 1.53 GiB (5.1%)
ID-1: /dev/mmcblk0 model: JB1RT size: 29.81 GiB
Message: No optical or floppy data found.
Partition:
ID-1: / size: 28.92 GiB used: 1.53 GiB (5.3%) fs: ext4 dev: /dev/mmcblk0p1
Info:
Processes: 173 Uptime: 3h 55m Memory: 965.2 MiB used: 204.8 MiB (21.2%) Init: systemd
runlevel: 5 Compilers: gcc: 10.2.1 Packages: 565 Client: Sudo v: 1.9.5p2 inxi: 3.3.15
Running additional hardware identification tests...


If I Run just the last part of the code that was sent if just hangs and I need to CTRL C to break it and be able to go back to the command line:

root@orangepizero2:/home/pihole# # Check for Micro SD / MMC card
if [[ "$BootDrive" == "mmcblk" ]]; then

Determine if MMC or Micro SD

RootDrive=$(echo "$BootDrive" | cut -dp -f1 | cut -d/ -f3)
MMCType=$(cat /sys/block/"$RootDrive"/device/type)

Get card information

Manufacturer=$(echo "$Test_udevadm" | grep -m 1 "manfid" | cut -d= -f3 | cut -d" -f2 | xargs)
if [ -z "$Manufacturer" ]; then
Manufacturer=$(cat /sys/block/"$RootDrive"/device/manfid)
Product=$(cat /sys/block/"$RootDrive"/device/type)
Firmware=$(cat /sys/block/"$RootDrive"/device/fwrev)
DateManufactured=$(cat /sys/block/"$RootDrive"/device/date)
Model=$(cat /sys/block/"$RootDrive"/device/name)
Version=$(cat /sys/block/"$RootDrive"/device/hwrev)
Vendor=$(cat /sys/block/"$RootDrive"/device/oemid)
SSR=$(cat /sys/block/"$RootDrive"/device/ssr)
SCR=$(cat /sys/block/"$RootDrive"/device/scr)
CID=$(cat /sys/block/"$RootDrive"/device/cid)
CSD=$(cat /sys/block/"$RootDrive"/device/csd)
OCR=$(cat /sys/block/"$RootDrive"/device/ocr)
else
Product=$(echo "$Test_udevadm" | grep -m 1 "{type}" | cut -d= -f3 | cut -d" -f2 | xargs)
Firmware=$(echo "$Test_udevadm" | grep -m 1 "{fwrev}" | cut -d= -f3 | cut -d" -f2 | xargs)
DateManufactured=$(echo "$Test_udevadm" | grep -m 1 "date" | cut -d= -f3 | cut -d" -f2 | xargs)
Model=$(echo "$Test_udevadm" | grep -m 1 "{name}" | cut -d= -f3 | cut -d" -f2 | xargs)
Version=$(echo "$Test_udevadm" | grep -m 1 "{hwrev}" | cut -d= -f3 | cut -d" -f2 | xargs)
Vendor=$(echo "$Test_udevadm" | grep -m 1 "oemid" | cut -d= -f3 | cut -d" -f2 | xargs | xxd -r)
SSR=$(echo "$Test_udevadm" | grep -m 1 "{ssr}" | cut -d= -f3 | cut -d" -f2 | xargs)
SCR=$(echo "$Test_udevadm" | grep -m 1 "{scr}" | cut -d= -f3 | cut -d" -f2 | xargs)
CID=$(echo "$Test_udevadm" | grep -m 1 "{cid}" | cut -d= -f3 | cut -d" -f2 | xargs)
CSD=$(echo "$Test_udevadm" | grep -m 1 "{csd}" | cut -d= -f3 | cut -d" -f2 | xargs)
OCR=$(echo "$Test_udevadm" | grep -m 1 "{ocr}" | cut -d= -f3 | cut -d" -f2 | xargs)
fi

^C


Then if I copy the whole content oh Storage.ch and run it from the command line it gets a bit further but still freezes.

I think it may be related to getting the card information.

If I copy the whole content of the script:

root@orangepizero2:/home/pihole# #!/bin/bash

Storage benchmark by James A. Chambers (https://jamesachambers.com/)

Benchmarks your storage and anonymously submits result to https://pibenchmarks.com

Results and discussion available at https://jamesachambers.com/2020s-fastest-raspberry-pi-4-storage-sd-ssd-benchmarks/

To run the benchmark use the following command:

sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

Terminal colors

BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
LIME_YELLOW=$(tput setaf 190)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
BRIGHT=$(tput bold)
NORMAL=$(tput sgr0)
BLINK=$(tput blink)
REVERSE=$(tput smso)
UNDERLINE=$(tput smul)

Prints a line with color using terminal codes

Print_Style() {
printf "%s\n" "${2}$1${NORMAL}"
}

Get binary from string

Get_Binary() {
local BinaryStr
BinaryStr=$(printf "$1" | xxd -r -p | xxd -b | cut -d: -f 2 | sed 's/ .*//; s/ //g' | sed ':a;N;$!ba;s/\n//g')
echo "$BinaryStr"
}

Get specific bits from binary string

Get_Bits() {

$1 - Binary String

$2 - BitsStart

$3 - BitsCount

$4 - Structure size in bits

local BitsStart=$(($4 - $2 - $3))
local BinaryStr=$(printf "$1")
echo "${BinaryStr:BitsStart:$3}"
}

Get decimal from binary

Get_Decimal() {
echo "$((2#$1))"
}

Get hex from binary

Get_Hex() {
printf '%x\n' "$((2#$1))"
cd ~ || returnme directory.com/$NORMAL"esults at:"5s\n" " " "Score: $Score" " "($fio4kRandWriteSpeed KB/s)""r=$Adapt
Board information: Manufacturer: - Model: Orange Pi Zero 2 - Architecture: aarch64 - OS: Debian GNU/Linux 11 (bullseye)
Fetching required components ...
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://security.debian.org bullseye-security InRelease
Get:4 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Hit:5 http://deb.debian.org/debian bullseye-backports InRelease
Hit:2 http://sg-mirror.bret.dk/armbian/apt bullseye InRelease
Hit:6 http://giteduberger.fr rpimonitor/ InRelease
Fetched 39.4 kB in 5s (7,450 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
bc is already the newest version (1.07.1-2+b2).
curl is already the newest version (7.74.0-1.3+deb11u1).
dmidecode is already the newest version (3.3-2).
fio is already the newest version (3.25-2).
hdparm is already the newest version (9.60+ds-1).
hwinfo is already the newest version (21.72-1).
libxml-dumper-perl is already the newest version (0.81-1.3).
lshw is already the newest version (02.18.85-0.7).
lsscsi is already the newest version (0.31-1).
nvme-cli is already the newest version (1.12-5).
pciutils is already the newest version (1:3.7.0-5).
sdparm is already the newest version (1.10-1).
smartmontools is already the newest version (7.2-1).
usbutils is already the newest version (1:013-3).
xxd is already the newest version (2:8.2.2434-3+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
iozone3 is already the newest version (489-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Clock speeds: CPU: 1512 - Core: - RAM:
System rootfs drive (/) has been detected as /dev/mmcblk0p1 (mmcblk0p1)
Starting INXI hardware identification...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1062k 100 1062k 0 0 1234k 0 --:--:-- --:--:-- --:--:-- 1234k
System:
Host: orangepizero2 Kernel: 4.9.255-sun50iw9 arch: aarch64 bits: 64 compiler: gcc v: 8.3.0
Console: pty pts/0 Distro: Armbian GNU/Linux 11 (bullseye)
Machine:
Type: ARM System: Orange Pi Zero 2 details: N/A
CPU:
Info: quad core model: N/A variant: cortex-a53 bits: 64 type: MCP arch: ARMv8 rev: 4
Speed (MHz): avg: 480 min/max: 480/1512 cores: 1: 480 2: 480 3: 480 4: 480 bogomips: N/A
Features: Use -f option to see features
Graphics:
Device-1: sunxi-disp driver: disp v: N/A bus-ID: N/A
Device-2: sunxi-hdmi driver: allwinner,sunxi_hdmi v: N/A bus-ID: N/A
Device-3: mali-midgard driver: N/A bus-ID: N/A
Display: unspecified server: N/A driver: N/A note: X driver n/a tty: 116x57
Message: Unable to show GL data. Required tool glxinfo missing.
Network:
Device-1: sunxi-gmac driver: sunxi_gmac v: kernel port: N/A bus-ID: N/A
IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 36:cd:5d:1c:3d:9b
Device-2: sunxi-wlan driver: sunxi_wlan v: N/A bus-ID: N/A
IF-ID-1: dummy0 state: down mac: 1e:8c:a8:cc:78:c3
IF-ID-2: gre0 state: down mac: 00:00:00:00
IF-ID-3: gretap0 state: down mac: 00:00:00:00:00:00
IF-ID-4: ip6_vti0 state: down mac: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
IF-ID-5: ip6tnl0 state: down mac: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
IF-ID-6: ip_vti0 state: down mac: 00:00:00:00
IF-ID-7: sit0 state: down mac: 00:00:00:00
IF-ID-8: tunl0 state: down mac: 00:00:00:00
IF-ID-9: wlan0 state: dormant mac: 28:16:99:4a:89:d6
Drives:
Local Storage: total: 29.81 GiB used: 1.53 GiB (5.1%)
ID-1: /dev/mmcblk0 model: JB1RT size: 29.81 GiB
Message: No optical or floppy data found.
Partition:
ID-1: / size: 28.92 GiB used: 1.53 GiB (5.3%) fs: ext4 dev: /dev/mmcblk0p1
Info:
Processes: 173 Uptime: 18m Memory: 965.2 MiB used: 190.1 MiB (19.7%) Init: systemd runlevel: 5
Compilers: gcc: 10.2.1 Packages: 565 Shell: Bash v: 5.1.4 inxi: 3.3.15
Running additional hardware identification tests...
Additional hardware identification tests completed.
Starting MMC/SD identification...


Interestingly If I break the card information code in parts this happens:

root@orangepizero2:/home/pihole# # Check for Micro SD / MMC card
if [[ "$BootDrive" == "mmcblk" ]]; then

Determine if MMC or Micro SD

RootDrive=$(echo "$BootDrive" | cut -dp -f1 | cut -d/ -f3)
MMCType=$(cat /sys/block/"$RootDrive"/device/type)

^C


So once again that just hangs there but I am able to CTRL C to break from it.

If I run the second part of the set of instructions I get this:

root@orangepizero2:/home/pihole# # Get card information
Manufacturer=$(echo "$Test_udevadm" | grep -m 1 "manfid" | cut -d= -f3 | cut -d" -f2 | xargs)
if [ -z "$Manufacturer" ]; then
Manufacturer=$(cat /sys/block/"$RootDrive"/device/manfid)
Product=$(cat /sys/block/"$RootDrive"/device/type)
Firmware=$(cat /sys/block/"$RootDrive"/device/fwrev)
DateManufactured=$(cat /sys/block/"$RootDrive"/device/date)
Model=$(cat /sys/block/"$RootDrive"/device/name)
Version=$(cat /sys/block/"$RootDrive"/device/hwrev)
Vendor=$(cat /sys/block/"$RootDrive"/device/oemid)
SSR=$(cat /sys/block/"$RootDrive"/device/ssr)
SCR=$(cat /sys/block/"$RootDrive"/device/scr)
CID=$(cat /sys/block/"$RootDrive"/device/cid)
CSD=$(cat /sys/block/"$RootDrive"/device/csd)
OCR=$(cat /sys/block/"$RootDrive"/device/ocr)
else
Product=$(echo "$Test_udevadm" | grep -m 1 "{type}" | cut -d= -f3 | cut -d" -f2 | xargs)
Firmware=$(echo "$Test_udevadm" | grep -m 1 "{fwrev}" | cut -d= -f3 | cut -d" -f2 | xargs)
DateManufactured=$(echo "$Test_udevadm" | grep -m 1 "date" | cut -d= -f3 | cut -d" -f2 | xargs)
Model=$(echo "$Test_udevadm" | grep -m 1 "{name}" | cut -d= -f3 | cut -d" -f2 | xargs)
Version=$(echo "$Test_udevadm" | grep -m 1 "{hwrev}" | cut -d= -f3 | cut -d" -f2 | xargs)
Vendor=$(echo "$Test_udevadm" | grep -m 1 "oemid" | cut -d= -f3 | cut -d" -f2 | xargs | xxd -r)
SSR=$(echo "$Test_udevadm" | grep -m 1 "{ssr}" | cut -d= -f3 | cut -d" -f2 | xargs)
SCR=$(echo "$Test_udevadm" | grep -m 1 "{scr}" | cut -d= -f3 | cut -d" -f2 | xargs)
CID=$(echo "$Test_udevadm" | grep -m 1 "{cid}" | cut -d= -f3 | cut -d" -f2 | xargs)
CSD=$(echo "$Test_udevadm" | grep -m 1 "{csd}" | cut -d= -f3 | cut -d" -f2 | xargs)
OCR=$(echo "$Test_udevadm" | grep -m 1 "{ocr}" | cut -d= -f3 | cut -d" -f2 | xargs)
fi
cat: /sys/block//device/manfid: No such file or directory
cat: /sys/block//device/type: No such file or directory
cat: /sys/block//device/fwrev: No such file or directory
cat: /sys/block//device/date: No such file or directory
cat: /sys/block//device/name: No such file or directory
cat: /sys/block//device/hwrev: No such file or directory
cat: /sys/block//device/oemid: No such file or directory
cat: /sys/block//device/ssr: No such file or directory
cat: /sys/block//device/scr: No such file or directory
cat: /sys/block//device/cid: No such file or directory
cat: /sys/block//device/csd: No such file or directory
cat: /sys/block//device/ocr: No such file or directory


So I think it may be something in the first part of that code that does not work well with either the Orange Pi Zero 2 or Armbian.

By the way. Below is the System info I get when I log into Armbian

pihole@192.168.1.3's password:


/ _ | _ () |__ /__ _ __ |
| | | | |) | | / // _ \ '__/ _ \ __) |
| |
| | /| | / /| / | | () / /
_
/|
| || /____|_| _
/_____|

Welcome to Armbian 22.02.1 with Linux 4.9.255-sun50iw9

System load: 27% Up time: 8 min
Memory usage: 13% of 965M IP: 192.168.1.3
CPU temp: 47°C Usage of /: 6% of 29G

[ General system configuration (beta): armbian-config ]


Please let me know if I can be of any more help. I don't mind running the program for you to test, but if it is too difficult and it is not worth the time invested to try to make it run it is fine. I was just curious about the performance of the cards in the OPZ2 compared to the RasPi4B and RasPi400.

I mean the Orange is just being used for a pihole so not really that demanding.

Thank you.

@TheRemote
Copy link
Owner

TheRemote commented May 11, 2022

Great finds! It looks like it's getting stuck to me. That's hugely important that you can Ctrl+C it. It means the device isn't actually locked up. It's waiting for something.

I have a theory. I wonder if it's this line:

Vendor=$(echo "$Test_udevadm" | grep -m 1 "oemid" | cut -d= -f3 | cut -d\" -f2 | xargs | xxd -r)

The reason I'm thinking of this is that xxd -r may be waiting for piped input but if there's none coming maybe it's getting stuck.

I think this is definitely worth investigating here. I think we're getting close. I'm guessing that for every one person like you that takes the benchmark there is at least 10 that will try to take it and have a problem and I'll never find out about it. Who knows how many other people have already dealt with this before over the years and never said anything.

Can you try running it again here? The Vendor field is no longer used so I'm commenting it out here and let's see if it's xxd that is trapping it!

@munecito
Copy link
Author

I can't ctrl C it if I'm running the whole script. For some reason if I do it that way it actually freezes and I lose all the internet connectivity (pihole is a DHCP and recursive DNS server)

I'll run it again and report back.

@munecito
Copy link
Author

If I run only that previous line it does not give me any error.

But if I run the whole script it freezes. Once again I can't break out of it when that happens and it is only after I power back on that it comes out of the loop:

root@orangepizero2:/home/pihole# Vendor=$(echo "$Test_udevadm" | grep -m 1 "oemid" | cut -d= -f3 | cut -d" -f2 | xargs | xxd -r)
root@orangepizero2:/home/pihole# #!/bin/bash

Storage benchmark by James A. Chambers (https://jamesachambers.com/)

Benchmarks your storage and anonymously submits result to https://pibenchmarks.com

Results and discussion available at https://jamesachambers.com/2020s-fastest-raspberry-pi-4-storage-sd-ssd-benchmarks/

To run the benchmark use the following command:

sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

Terminal colors

BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
LIME_YELLOW=$(tput setaf 190)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
BRIGHT=$(tput bold)
NORMAL=$(tput sgr0)
BLINK=$(tput blink)
REVERSE=$(tput smso)
UNDERLINE=$(tput smul)

Prints a line with color using terminal codes

cd ~ || return^C directory.com/$NORMAL"esults at:"5s\n" " " "Score: $Score" " "($fio4kRandWriteSpeed KB/s)""form "HostMa
root@orangepizero2:/home/pihole# #!/bin/bash

Storage benchmark by James A. Chambers (https://jamesachambers.com/)

Benchmarks your storage and anonymously submits result to https://pibenchmarks.com

Results and discussion available at https://jamesachambers.com/2020s-fastest-raspberry-pi-4-storage-sd-ssd-benchmarks/

To run the benchmark use the following command:

sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

Terminal colors

BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
LIME_YELLOW=$(tput setaf 190)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
BRIGHT=$(tput bold)
NORMAL=$(tput sgr0)
BLINK=$(tput blink)
REVERSE=$(tput smso)
UNDERLINE=$(tput smul)

Prints a line with color using terminal codes

cd ~ || return^C directory.com/$NORMAL"esults at:"5s\n" " " "Score: $Score" " "($fio4kRandWriteSpeed KB/s)""form "HostMa
root@orangepizero2:/home/pihole# #!/bin/bash

Storage benchmark by James A. Chambers (https://jamesachambers.com/)

Benchmarks your storage and anonymously submits result to https://pibenchmarks.com

Results and discussion available at https://jamesachambers.com/2020s-fastest-raspberry-pi-4-storage-sd-ssd-benchmarks/

To run the benchmark use the following command:

sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

Terminal colors

BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
LIME_YELLOW=$(tput setaf 190)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
BRIGHT=$(tput bold)
NORMAL=$(tput sgr0)
BLINK=$(tput blink)
REVERSE=$(tput smso)
UNDERLINE=$(tput smul)

Prints a line with color using terminal codes

cd ~ || returnme directory.com/$NORMAL"esults at:"5s\n" " " "Score: $Score" " "($fio4kRandWriteSpeed KB/s)""form "HostMa
Board information: Manufacturer: - Model: Orange Pi Zero 2 - Architecture: aarch64 - OS: Debian GNU/Linux 11 (bullseye)
Fetching required components ...
Hit:2 http://security.debian.org bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye InRelease
Hit:1 http://au-mirror.bret.dk/armbian/apt bullseye InRelease
Get:4 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:5 http://deb.debian.org/debian bullseye-backports InRelease [44.2 kB]
Hit:6 http://giteduberger.fr rpimonitor/ InRelease
Fetched 83.6 kB in 4s (21.9 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
bc is already the newest version (1.07.1-2+b2).
curl is already the newest version (7.74.0-1.3+deb11u1).
dmidecode is already the newest version (3.3-2).
fio is already the newest version (3.25-2).
hdparm is already the newest version (9.60+ds-1).
hwinfo is already the newest version (21.72-1).
libxml-dumper-perl is already the newest version (0.81-1.3).
lshw is already the newest version (02.18.85-0.7).
lsscsi is already the newest version (0.31-1).
nvme-cli is already the newest version (1.12-5).
pciutils is already the newest version (1:3.7.0-5).
sdparm is already the newest version (1.10-1).
smartmontools is already the newest version (7.2-1).
usbutils is already the newest version (1:013-3).
xxd is already the newest version (2:8.2.2434-3+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
iozone3 is already the newest version (489-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Clock speeds: CPU: 1512 - Core: - RAM:
System rootfs drive (/) has been detected as /dev/mmcblk0p1 (mmcblk0p1)
Starting INXI hardware identification...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1062k 100 1062k 0 0 1405k 0 --:--:-- --:--:-- --:--:-- 1403k
System:
Host: orangepizero2 Kernel: 4.9.255-sun50iw9 arch: aarch64 bits: 64 compiler: gcc v: 8.3.0
Console: pty pts/0 Distro: Armbian GNU/Linux 11 (bullseye)
Machine:
Type: ARM System: Orange Pi Zero 2 details: N/A
CPU:
Info: quad core model: N/A variant: cortex-a53 bits: 64 type: MCP arch: ARMv8 rev: 4
Speed (MHz): avg: 480 min/max: 480/1512 cores: 1: 480 2: 480 3: 480 4: 480 bogomips: N/A
Features: Use -f option to see features
Graphics:
Device-1: sunxi-disp driver: disp v: N/A bus-ID: N/A
Device-2: sunxi-hdmi driver: allwinner,sunxi_hdmi v: N/A bus-ID: N/A
Device-3: mali-midgard driver: N/A bus-ID: N/A
Display: unspecified server: N/A driver: N/A note: X driver n/a tty: 120x27
Message: Unable to show GL data. Required tool glxinfo missing.
Network:
Device-1: sunxi-gmac driver: sunxi_gmac v: kernel port: N/A bus-ID: N/A
IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 36:cd:5d:1c:3d:9b
Device-2: sunxi-wlan driver: sunxi_wlan v: N/A bus-ID: N/A
IF-ID-1: dummy0 state: down mac: 1e:8c:a8:cc:78:c3
IF-ID-2: gre0 state: down mac: 00:00:00:00
IF-ID-3: gretap0 state: down mac: 00:00:00:00:00:00
IF-ID-4: ip6_vti0 state: down mac: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
IF-ID-5: ip6tnl0 state: down mac: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
IF-ID-6: ip_vti0 state: down mac: 00:00:00:00
IF-ID-7: sit0 state: down mac: 00:00:00:00
IF-ID-8: tunl0 state: down mac: 00:00:00:00
IF-ID-9: wlan0 state: dormant mac: 28:16:99:4a:89:d6
Drives:
Local Storage: total: 29.81 GiB used: 1.52 GiB (5.1%)
ID-1: /dev/mmcblk0 model: JB1RT size: 29.81 GiB
Message: No optical or floppy data found.
Partition:
ID-1: / size: 28.92 GiB used: 1.52 GiB (5.2%) fs: ext4 dev: /dev/mmcblk0p1
Info:
Processes: 172 Uptime: 6h 35m Memory: 965.2 MiB used: 204.1 MiB (21.1%) Init: systemd
runlevel: 5 Compilers: gcc: 10.2.1 Packages: 565 Shell: Bash v: 5.1.4 inxi: 3.3.15
Running additional hardware identification tests...
^C
^C
^X^C
^C

^C
^C
client_loop: send disconnect: Connection reset


For some reason it does not pass the additional hardware identification tests again.

Earlier it did. I may have something to do with running the other parts of the code on their own?

pihole@orangepizero2:~$ sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash
[sudo] password for pihole:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 33782 100 33782 0 0 58345 0 --:--:-- --:--:-- --:--:-- 58345
Board information: Manufacturer: - Model: Orange Pi Zero 2 - Architecture: aarch64 - OS: Debian GNU/Linux 11 (bullseye)
Fetching required components ...
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://security.debian.org bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 http://deb.debian.org/debian bullseye-backports InRelease
Hit:5 http://au-mirror.bret.dk/armbian/apt bullseye InRelease
Hit:6 http://giteduberger.fr rpimonitor/ InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
bc is already the newest version (1.07.1-2+b2).
curl is already the newest version (7.74.0-1.3+deb11u1).
dmidecode is already the newest version (3.3-2).
fio is already the newest version (3.25-2).
hdparm is already the newest version (9.60+ds-1).
hwinfo is already the newest version (21.72-1).
libxml-dumper-perl is already the newest version (0.81-1.3).
lshw is already the newest version (02.18.85-0.7).
lsscsi is already the newest version (0.31-1).
nvme-cli is already the newest version (1.12-5).
pciutils is already the newest version (1:3.7.0-5).
sdparm is already the newest version (1.10-1).
smartmontools is already the newest version (7.2-1).
usbutils is already the newest version (1:013-3).
xxd is already the newest version (2:8.2.2434-3+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
iozone3 is already the newest version (489-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Clock speeds: CPU: 1512 - Core: - RAM:
System rootfs drive (/) has been detected as /dev/mmcblk0p1 (mmcblk0p1)
Starting INXI hardware identification...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1062k 100 1062k 0 0 1733k 0 --:--:-- --:--:-- --:--:-- 1730k
System:
Kernel: 4.9.255-sun50iw9 arch: aarch64 bits: 64 compiler: gcc v: 8.3.0 Console: pty pts/0
Distro: Armbian GNU/Linux 11 (bullseye)
Machine:
Type: ARM System: Orange Pi Zero 2 details: N/A
CPU:
Info: quad core model: N/A variant: cortex-a53 bits: 64 type: MCP arch: ARMv8 rev: 4
Speed (MHz): avg: 480 min/max: 480/1512 cores: 1: 480 2: 480 3: 480 4: 480 bogomips: N/A
Features: Use -f option to see features
Graphics:
Device-1: sunxi-disp driver: disp v: N/A bus-ID: N/A
Device-2: sunxi-hdmi driver: allwinner,sunxi_hdmi v: N/A bus-ID: N/A
Device-3: mali-midgard driver: N/A bus-ID: N/A
Display: unspecified server: N/A driver: N/A note: X driver n/a tty: 80x40
Message: Unable to show GL data. Required tool glxinfo missing.
Network:
Device-1: sunxi-gmac driver: sunxi_gmac v: kernel port: N/A bus-ID: N/A
IF: eth0 state: up speed: 1000 Mbps duplex: full mac:
Device-2: sunxi-wlan driver: sunxi_wlan v: N/A bus-ID: N/A
IF-ID-1: dummy0 state: down mac:
IF-ID-2: gre0 state: down mac:
IF-ID-3: gretap0 state: down mac:
IF-ID-4: ip6_vti0 state: down mac:
IF-ID-5: ip6tnl0 state: down mac:
IF-ID-6: ip_vti0 state: down mac:
IF-ID-7: sit0 state: down mac:
IF-ID-8: tunl0 state: down mac:
IF-ID-9: wlan0 state: dormant mac:
Drives:
Local Storage: total: 29.81 GiB used: 1.52 GiB (5.1%)
ID-1: /dev/mmcblk0 model: JB1RT size: 29.81 GiB
Message: No optical or floppy data found.
Partition:
ID-1: / size: 28.92 GiB used: 1.52 GiB (5.2%) fs: ext4 dev: /dev/mmcblk0p1
Info:
Processes: 181 Uptime: 3m Memory: 965.2 MiB used: 193.9 MiB (20.1%) Init: systemd runlevel: 5
Compilers: gcc: 10.2.1 Packages: 565 Client: Sudo v: 1.9.5p2 inxi: 3.3.15
Running additional hardware identification tests...

@TheRemote
Copy link
Owner

TheRemote commented May 11, 2022

Very interesting. When you are running the lines individually it doesn't look like the variables are populated. For example /sys/block//device/manfid: No such file or directory should be /sys/block/mmcblk0/device/manfid on that system. This must be getting populated when the script is running but not when being ran on the shell separately I think.

You could try pasting the entire contents of the script right on the shell. So far everything has ran properly when you tried it directly. If you paste the entire script in all of those variable should be populated. Theoretically it would stop at exactly the same place because there is some kind of really really weird problem going on here.

It doesn't look like it's making it through the tests here but pasting that section on the command line should be the same. My guess is that maybe it's freezing on udevadm? What happens if you run:

udevadm info -a -n /dev/mmcblk0p1 2>&1 | sed 's/;/!/g' | sed '/^[[:space:]]*$/d'

udevadm crashing things is a thing apparently. It does try to communicate directly with the drive. If there's some kind of driver or firmware bug on this board this could explain it.

This would probably kill it:

BootDrive="/dev/mmcblk0p1"
BootDriveSuffix="mmcblk0p1"
Test_udevadm=$(udevadm info -a -n "$BootDrive" 2>&1 | sed 's/;/!/g' | sed '/^[[:space:]]*$/d')
Test_lsblk=$(lsblk -l -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL 2>&1 | sed 's/;/!/g')
Test_lshw=$(lshw 2>&1 | sed 's/;/!/g')
Test_lsusb=$(lsusb 2>&1 | sed 's/;/!/g')
Test_lsscsi=$(lsscsi -Lv 2>&1 | sed 's/;/!/g')
Test_lscpu=$(lscpu 2>&1 | sed 's/;/!/g')
Test_lspci=$(lspci -v 2>&1 | sed 's/;/!/g')
Test_findmnt=$(findmnt -n 2>&1 | sed 's/;/!/g')
Test_diskbyid=$(ls /dev/disk/by-id 2>&1 | sed 's/;/!/g')
Test_df=$(df -h 2>&1 | sed 's/;/!/g')
Test_cpuinfo=$(cat /proc/cpuinfo 2>&1 | sed 's/;/!/g')
Test_dmesg=$(dmesg -Lnever 2>&1 | grep usb | sed 's/;/!/g')
Test_fstab=$(cat /etc/fstab 2>&1 | sed 's/;/!/g')
Test_dmidecode=$(dmidecode 2>&1 | sed 's/;/!/g')
Test_hwinfo=$(hwinfo --arch --bios --block --bridge --disk --framebuffer --gfxcard --hub --ide --isapnp --listmd --memory --mmc-ctrl --monitor --netcard --partition --pci --pcmcia --pcmcia-ctrl --redasd --scsi --sound --storage-ctrl --sys --tape --usb --usb-ctrl 2>&1 | sed 's/;/!/g')
Test_nvme=$(nvme list -o json 2>&1)
Test_nvme+=$(nvme show-regs "$BootDrive" -H 2>&1 | sed 's/;/!/g')
Test_smartctl=$(smartctl -x "$BootDrive" 2>&1 | sed 's/;/!/g')
Test_smartctl=$(sudo sdparm --long --verbose "$BootDrive" 2>&1 | sed 's/;/!/g')
Capacity=$(lsblk -l 2>&1 | grep "$BootDriveSuffix" -m 1 | awk 'NR==1{ print $4 }' | sed 's/,/./g')

I think it has to be one of the tests here that uses either $BootDrive or $BootDriveSuffix. When you ran your test before those weren't populated and it's not making it past the testing section. That narrows it down to only a few options at least.

It leaves udevadm, test_nvme and test_smartctl as well as capacity. One of those is locking up this system for some reason here! Are there any firmware updates available for these boards? This is something I would expect something like a firmware update to fix.

@munecito
Copy link
Author

Ok If I run udevadm it does hang up but does not freeze the Orange. So I seem to be able to CTRL C out and I keep internet conectivity

It just stays on the blank line and does not move

PS C:\Users\Will> ssh pihole@192.168.1.3
pihole@192.168.1.3's password:


/ _ | _ () |__ /__ _ __ |
| | | | |) | | / // _ \ '__/ _ \ __) |
| |
| | /| | / /| / | | () / /
_
/|
| || /____|_| _
/_____|

Welcome to Armbian 22.02.1 with Linux 4.9.255-sun50iw9

System load: 28% Up time: 17 min Local users: 2
Memory usage: 14% of 965M IP: 192.168.1.3
CPU temp: 45°C Usage of /: 6% of 29G

Last login: Thu May 12 01:39:48 2022 from 192.168.1.6
pihole@orangepizero2:~$ sudo su
[sudo] password for pihole:
root@orangepizero2:/home/pihole# udevadm info -a -n /dev/mmcblk0 2>&1 | sed 's/;/!/g' | sed '/^[[:space:]]*$/d


Running the big chunk of code freezes it again.

I am going to try to run it line by line.

This is as far as I got before every line started hanging. The board froze but I did not see when. I am going to run again from the last one that froze before every when bad.

The ones with the Ctrl C are the ones that seemed to get hung. But after coming out of them I was able to continue.

pihole@orangepizero2:~$ sudo su

[sudo] password for pihole:
root@orangepizero2:/home/pihole# BootDrive="/dev/mmcblk0p1"
root@orangepizero2:/home/pihole# BootDriveSuffix="mmcblk0p1"
root@orangepizero2:/home/pihole# Test_udevadm=$(udevadm info -a -n "$BootDrive" 2>&1 | sed 's/;/!/g' | sed '/^[[:space:]]*$/d')
root@orangepizero2:/home/pihole# Test_lsblk=$(lsblk -l -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL 2>&1 | sed 's/;/!/g')
root@orangepizero2:/home/pihole# Test_lshw=$(lshw 2>&1 | sed 's/;/!/g')
^C
root@orangepizero2:/home/pihole# Test_lsusb=$(lsusb 2>&1 | sed 's/;/!/g')
root@orangepizero2:/home/pihole# Test_lsscsi=$(lsscsi -Lv 2>&1 | sed 's/;/!/g')
^C
root@orangepizero2:/home/pihole# Test_lscpu=$(lscpu 2>&1 | sed 's/;/!/g')
root@orangepizero2:/home/pihole# Test_lspci=$(lspci -v 2>&1 | sed 's/;/!/g')
^C
root@orangepizero2:/home/pihole# Test_findmnt=$(findmnt -n 2>&1 | sed 's/;/!/g')
root@orangepizero2:/home/pihole# Test_diskbyid=$(ls /dev/disk/by-id 2>&1 | sed 's/;/!/g')
root@orangepizero2:/home/pihole# Test_df=$(df -h 2>&1 | sed 's/;/!/g')
root@orangepizero2:/home/pihole# Test_cpuinfo=$(cat /proc/cpuinfo 2>&1 | sed 's/;/!/g')
root@orangepizero2:/home/pihole# Test_dmesg=$(dmesg -Lnever 2>&1 | grep usb | sed 's/;/!/g')
root@orangepizero2:/home/pihole# Test_fstab=$(cat /etc/fstab 2>&1 | sed 's/;/!/g')
root@orangepizero2:/home/pihole# Test_dmidecode=$(dmidecode 2>&1 | sed 's/;/!/g')
^C

@TheRemote
Copy link
Owner

TheRemote commented May 11, 2022

Excellent. I started investigating freezes like this when running udevadm and found these:

https://forums.raspberrypi.com/viewtopic.php?t=93753
https://forums.raspberrypi.com/viewtopic.php?t=13382

That was all I found on the entire internet. Only for Raspberry Pi and only using ancient kernels (like 3.X.X kernels). I was not able to find an example of this happening within the past 5+ years or so.

Is that the era this Orange Pi is from? Is it running a 3.X.X kernel? I have a lot of boards from this era too like the Tinker Board that I could imagine if it was using the stock eMMC image would be running a kernel this old and potentially do this.

Does this happen to be the official image for PiHole or did you install PiHole on a normal OS install? Or is this a fully up to date image from http://www.orangepi.org/downloadresources/?

If it's the main PiHole image I wonder if this would happen using a different OS but I hate to ask you to go that far (unless you have a bunch of extra SD cards around and it's not something that will take you very long).

@munecito
Copy link
Author

munecito commented May 11, 2022

Hello James.

I am not so sure about the answers as I am quite new to the world of SBC and the Orange pi was bought because prices and availability for RasPi are ridiculous.

So I am going to answer to the best of my knowledge.

The Orange Pi Zero 2 information can be found at:

http://www.orangepi.org/Orange%20Pi%20Zero2/

Does this happen to be the official image for PiHole or did you install PiHole on a normal OS install? Or is this a fully up
to date image from http://www.orangepi.org/downloadresources/?

I have installed Armbian official. The Software offered by the makers of Orange pi is quite old (2020) The Armbian version I installed is Armbian 22.02 Bullseye
Kernel 4.9.y, Size: 340Mb, Updated: Mar 7, 2022

That can be found here:

https://www.armbian.com/orange-pi-zero-2/

In the Pihole forums I read that it was best not to use the one from the link you posted as it was too out of date.

If it's the main PiHole image I wonder if this would happen using a different OS but I hate to ask you to go that far (unless you have a bunch of extra SD cards around and it's not something that will take you very long).

I installed Pihole over Armbian using the official installation code

curl -sSL https://install.pi-hole.net | bash

I have also tried your Benchmark test on a clean Armbian install with no pihole.

I can probably try a different OS on a different SD card. But I don't know what other distros can be run in the Orange Pi.

Now. Regarding the running of the code line by line, I did a few more tests. What I found is that the lines getting hung were related to a previous line of code.

If I omit:

Test_udevadm=$(udevadm info -a -n "$BootDrive" 2>&1 | sed 's/;/!/g' | sed '/^[[:space:]]*$/d')

Then I can run the rest of the code without crashing. But If I include that line, then I get other lines failing at random until the whole OPZ2 freezes.

root@orangepizero2:/home/pihole# Test_lsblk=$(lsblk -l -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL 2>&1 | sed 's/;/!/g')
Test_lshw=$(lshw 2>&1 | sed 's/;/!/g')
Test_lsusb=$(lsusb 2>&1 | sed 's/;/!/g')
Test_lsscsi=$(lsscsi -Lv 2>&1 | sed 's/;/!/g')
Test_lscpu=$(lscpu 2>&1 | sed 's/;/!/g')
Test_lspci=$(lspci -v 2>&1 | sed 's/;/!/g')
Test_findmnt=$(findmnt -n 2>&1 | sed 's/;/!/g')
Test_diskbyid=$(ls /dev/disk/by-id 2>&1 | sed 's/;/!/g')
Test_df=$(df -h 2>&1 | sed 's/;/!/g')
Test_cpuinfo=$(cat /proc/cpuinfo 2>&1 | sed 's/;/!/g')
Test_dmesg=$(dmesg -Lnever 2>&1 | grep usb | sed 's/;/!/g')
Test_fstab=$(cat /etc/fstab 2>&1 | sed 's/;/!/g')
Test_dmidecode=$(dmidecode 2>&1 | sed 's/;/!/g')
Test_hwinfo=$(hwinfo --arch --bios --block --bridge --disk --framebuffer --gfxcard --hub --ide --isapnp --listmd --memory --mmc-ctrl --monitor --netcard --partition --pci --pcmcia --pcmcia-ctrl --redasd --scsi --sound --storage-ctrl --sys --tape --usb --usb-ctrl 2>&1 | sed 's/;/!/g')
Test_nvme=$(nvme list -o json 2>&1)
Test_nvme+=$(nvme show-regs "$BootDrive" -H 2>&1 | sed 's/;/!/g')
Test_smartctl=$(smartctl -x "$BootDrive" 2>&1 | sed 's/;/!/g')
Test_smartctl=$(sudo sdparm --long --verbose "$BootDrive" 2>&1 | sed 's/;/!/g')
Capacity=$(lsblk -l 2>&1 | grep "$BootDriveSuffix" -m 1 | awk 'NR==1{ print $4 }' | sed 's/,/./g')
root@orangepizero2:/home/pihole#


So I suppose you are correct in saying that udevadm may have something to do with this issue.

I am going to go to bed now (late in Australia) and I will continue testing whatever you deem convenient tomorrow.

Thanks.

@TheRemote
Copy link
Owner

TheRemote commented May 11, 2022

Perfect, we've pretty much fully diagnosed this now. Let's move to the fixing stage!

I was just reading the udevadm documentation and found something that may be able to help:

-w[SECONDS], --wait-for-initialization[=SECONDS]
Wait for device to be initialized. If argument SECONDS is not specified, the default is to wait forever.

Waiting forever. That is exactly what it's doing. Okay, can you try this command:

Test_udevadm=$(udevadm info -w15 -a -n "$BootDrive" 2>&1 | sed 's/;/!/g' | sed '/^[[:space:]]*$/d')

If I got this right it should wait 15 seconds and fail (but continue the rest of the test). It should then continue normally if udevadm freezes like this. Who knows how many other devices this may help as well!

I've uploaded these changes in the script to try at your convenience. Thanks a ton for this. I am certain this must happen on some other devices and it's why this flag exists. This should make the test a lot more robust if it indeed fixes it for you!

This is also a model I don't have a test for yet. I'm going to try to preload it in there and if it actually shows up live on the site when you take the test then that means I got the board put in there correctly!

@munecito
Copy link
Author

Hello again James.

You caught me with that answer just before I turned my computer off.

I tried that line on its own, and added to the partial set of instructions.

On its own it runs with no error but if it is part of the whole set of instructions it freezes the system pretty much automatically so it is unable to continue after the set amount of time. I gave it a couple of minutes each time but as soon as it it run. The system goes out of line and becomes unresponsive so a hard reset is needed every time.

pihole@orangepizero2:~$ sudo su
[sudo] password for pihole:
root@orangepizero2:/home/pihole# BootDrive="/dev/mmcblk0p1"
BootDriveSuffix="mmcblk0p1"
Test_udevadm=$(udevadm info -w15 -a -n "$BootDrive" 2>&1 | sed 's/;/!/g' | sed '/^[[:space:]]*$/d')
Test_lsblk=$(lsblk -l -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL 2>&1 | sed 's/;/!/g')
Test_lshw=$(lshw 2>&1 | sed 's/;/!/g')
Test_lsusb=$(lsusb 2>&1 | sed 's/;/!/g')
Test_lsscsi=$(lsscsi -Lv 2>&1 | sed 's/;/!/g')
Test_lscpu=$(lscpu 2>&1 | sed 's/;/!/g')
Test_lspci=$(lspci -v 2>&1 | sed 's/;/!/g')
Test_findmnt=$(findmnt -n 2>&1 | sed 's/;/!/g')
Test_diskbyid=$(ls /dev/disk/by-id 2>&1 | sed 's/;/!/g')
Test_df=$(df -h 2>&1 | sed 's/;/!/g')
Test_cpuinfo=$(cat /proc/cpuinfo 2>&1 | sed 's/;/!/g')
Test_dmesg=$(dmesg -Lnever 2>&1 | grep usb | sed 's/;/!/g')
Test_fstab=$(cat /etc/fstab 2>&1 | sed 's/;/!/g')
Test_dmidecode=$(dmidecode 2>&1 | sed 's/;/!/g')
Test_hwinfo=$(hwinfo --arch --bios --block --bridge --disk --framebuffer --gfxcard --hub --ide --isapnp --listmd --memory --mmc-ctrl --monitor --netcard --partition --pci --pcmcia --pcmcia-ctrl --redasd --scsi --sound --storage-ctrl --sys --tape --usb --usb-ctrl 2>&1 | sed 's/;/!/g')
Test_nvme=$(nvme list -o json 2>&1)
Test_nvme+=$(nvme show-regs "$BootDrive" -H 2>&1 | sed 's/;/!/g')
Test_smartctl=$(smartctl -x "$BootDrive" 2>&1 | sed 's/;/!/g')
Test_smartctl=$(sudo sdparm --long --verbose "$BootDrive" 2>&1 | sed 's/;/!/g')
Capacity=$(lsblk -l 2>&1 | grep "$BootDriveSuffix" -m 1 | awk 'NR==1{ print $4 }' | sed 's/,/./g')


It also hungs on the same spot if I run the sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash

I am going to try now copying the whole script in the terminal.

Below is what happens when I try to run the contents of Storage.sh

PS C:\Program Files\PowerShell\7> ssh pihole@192.168.1.3
pihole@192.168.1.3's password:
Permission denied, please try again.
pihole@192.168.1.3's password:


/ _ | _ () |__ /__ _ __ |
| | | | |) | | / // _ \ '__/ _ \ __) |
| |
| | /| | / /| / | | () / /
_
/|
| || /____|_| _
/_____|

Welcome to Armbian 22.02.1 with Linux 4.9.255-sun50iw9

System load: 31% Up time: 25 min
Memory usage: 13% of 965M IP: 192.168.1.3
CPU temp: 44°C Usage of /: 6% of 29G

[ General system configuration (beta): armbian-config ]

Last login: Thu May 12 03:39:12 2022 from 192.168.1.6
pihole@orangepizero2:~$ sudo su
[sudo] password for pihole:
root@orangepizero2:/home/pihole# #!/bin/bash
ark by Jroot@orangepizero2:/home/pihole# # Storage benchmark by James A. Chambers (https://jamesachambers.com/)
root@orangepizero2:/home/pihole# # Benchmarks your storage and anonymously submits result to https://pibenchmarks.com
ommand:

sudo curl https://raw.githubusercontent.comroot@orangepizero2:/home/pihole# # Results and discussion available at https://jamesachambers.com/2020s-fastest-raspberry-pi-4-storage-sd-ssd-benchmarks/

root@orangepizero2:/home/pihole# #
root@orangepizero2:/home/pihole# # To run the benchmark use the following command:
=$(tput sgr0)
BLINK=$(tput blink)
REVERSE=$(root@orangepizero2:/home/pihole# # sudo curl https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash
() {
local BinaryStr
BinaryStr=$(prroot@orangepizero2:/home/pihole#
p | xxd -b | cut -d: root@orangepizero2:/home/pihole# # Terminal colors
!ba;s/\n//g')
echo "$BinaryStr"root@orangepizero2:/home/pihole# BLACK=$(tput setaf 0)

$1 - Binary String

$2 - BitsStart

$3 - BitsCount

$4 - Structure size in bits

local BitsStart=$(($4 - $2 - $3))
local BinaryStr=$(printf "$1")
echo "${BinaryStr:BitsStart:$3}"
}

Get decimal from binary

Get_Decimal() {
echo "$((2#$1))"
}

Get hex from binary

Get_Hex() {
printf '%x\n' "$((2#$1))"
}

Get string of text froroot@orangepizero2:/home/pihole# RED=$(tput setaf 1)

1; do printf "%x\n" $((2#$a)); done | xxd -r -p
}

Check if script is rroot@orangepizero2:/home/pihole# GREEN=$(tput setaf 2)

n
Print_Style "Benchmarks must be ran as root! Example: sudo ./Storage.sh" "$RED"
exit 1
fi

Trim drives for more accurate benchmarking

fstrim -av
sync
sync

Initialize variables

Score=0
DDWriteResult=0
fio4kRandReadIOPS=0
fio4kRandWriteIOPS=0
IO4kRead=0
IO4kWrite=0
Iroot@orangepizero2:/home/pihole# YELLOW=$(tput setaf 3)
ndRead=0
IO4kRandWrite=0

Did the user give a folder ?

ChosenPartition=""
if [ "$1" = "" ]; then
#root@orangepizero2:/home/pihole# LIME_YELLOW=$(tput setaf 190)
User did not provide a partition/folder, change directory to rootfs
cd /
else
if [ ! -d "$1" ]; then
Print_Style "Your chosen partition (folder) does not exist! Provide a good one or run withouroot@orangepizero2:/home/pihole# POWDER_BLUE=$(tput setaf 153)
t parameters to check the rootfs" "$RED"
exit 1
else
ChosenPartition="$1"
cd "$ChosenPartition"
fi
fi

Get host board information

HostArchitecture=$(uname -m)
HostOSInfo=$(cat /etc/os-release | sed 's/;/!/groot@orangepizero2:/home/pihole# BLUE=$(tput setaf 4)
')
HostOS=$(echo "$HostOSInfo" | grep "PRETTY_NAME" | cut -d= -f2 | xargs)

if [[ "$HostArchitecture" == "x86" || "$HostArchitecture" == "amd64" ]]; then

X86 or X86_64 system -- use dmidecode

HostModel=$(dmidecode -t1 | grep 'Product root@orangepizero2:/home/pihole# MAGENTA=$(tput setaf 5)
HostManufacturer=$(dmidecode -t1 | grep 'Manufacturer' -m 1 | cut -d: -f2 | xargs)
else

ARM system

HostModel=$(tr -d '\0' </proc/device-tree/model)
if [[ "$HostModel" == "Raspberry Pi" ]]; then
HostManufacturer="Raspberry Pi Foundation"
elif [[ "$HostModel" == "Tiroot@orangepizero2:/home/pihole# CYAN=$(tput setaf 6)
ard"
]]; then
HostManufacturer="ASUSTeK"
else
HostManufacturer=""
fi
fi
Print_Style "Board information: Manufacturer: $HostManufacturer - Model: $HostModel - Archroot@orangepizero2:/home/pihole# WHITE=$(tput setaf 7)
: $HostArchitecture - OS: $HostOS" "$YELLOW"

Install required components

Print_Style "Fetching required components ..." "$YELLOW"

Test for apt first (all Debian based distros)

if [[ -n "$(which apt)" ]]; then
apt-get update

Check if root@orangepizero2:/home/pihole# BRIGHT=$(tput bold)

stModel == "Raspberry Pi" ]]; then
# Check for vcgencmd (measures clock speeds)root@orangepizero2:/home/pihole# NORMAL=$(tput sgr0)
d)" ]; then
apt-get install libraspberrypi-bin -y
fi
fi

Retrieve dependencies -- these are all bare minimum system tools to identify the hardware (many will already be built in)

apt-get install lshw pciutils usbutils lsscsi bc curl hwinfo hdparm nvme-cli dmidecode smartmontools fio sdparm xxd libxml-dumper-perroot@orangepizero2:/home/pihole# BLINK=$(tput blink)
f [ -z "$(which lshw)" ]; then apt-get install --no-install-recommends lshw -y; fi
if [ -z "$(which lspci)" ]; then apt-get install --no-install-recommends pciutils -y; fi
if [ -z "$(which lsroot@orangepizero2:/home/pihole# REVERSE=$(tput smso)
--no-install-recommends usbutils -y; fi
if [ -z "$(which lsscsi)" ]; then apt-get install --no-install-recommends lsscsi -y; fi
if [ -z "$(which bc)" ]; then apt-get install --no-install-recommends bc -y; fi
if [ -z "$(which curl)" ]; then apt-get install --nroot@orangepizero2:/home/pihole# UNDERLINE=$(tput smul)
o-install-recommends curl -y; fi
if [ -z "$(which hwinfo)" ]; then apt-get install --no-install-recommends hwinfo -y; fi
if [ -z "$(which hdparm)" ]; then apt-get install --no-install-recommends hdparm -y; fi
if [ -z "$(which dmidecode)root@orangepizero2:/home/pihole#
root@orangepizero2:/home/pihole# # Prints a line with color using terminal codes
install-recommenroot@orangepizero2:/home/pihole# Print_Style() {
ds dmidecode -y; fi
if> printf "%s\n" "${2}$1${NORMAL}"

}
]; then apt-get install fio -y; fi
iroot@orangepizero2:/home/pihole#
root@orangepizero2:/home/pihole# # Get binary from string
pt-get iroot@orangepizero2:/home/pihole# Get_Binary() {
local BinaryStr
BinaryStr=$(printf "$1" | xxd -r -p | xxd -b | cut -d: -f 2 | sed 's/ .*//; s/ //g' | sed ':a;N;$!ba;s/\n//g')
echo "$BinaryStr"
}
ends nvme-cli -y; fi
iroot@orangepizero2:/home/pihole#
$(which smartctl)" root@orangepizero2:/home/pihole# # Get specific bits from binary string
]; then apt-get install --no-install-recroot@orangepizero2:/home/pihole# Get_Bits() {
ommends > # $1 - Binary String

$2 - BitsStart

$3 - BitsCount

$4 - Structure size in bits

ch sdparm)" ]; then ap> local BitsStart=$(($4 - $2 - $3))

local BinaryStr=$(printf "$1")
echo "${BinaryStr:BitsStart:$3}"
}
fi
if root@orangepizero2:/home/pihole#
[ -z "$root@orangepizero2:/home/pihole# # Get decimal from binary
root@orangepizero2:/home/pihole# Get_Decimal() {
echo "$((2#$1))"
}
root@orangepizero2:/home/pihole#
root@orangepizero2:/home/pihole# # Get hex from binary
root@orangepizero2:/home/pihole# Get_Hex() {
printf '%x\n' "$((2#$1))"
}
commendsroot@orangepizero2:/home/pihole#
fi

Droot@orangepizero2:/home/pihole# # Get string of text from binary
pkgArch=$(dproot@orangepizero2:/home/pihole# Get_Text() {

for a in $1; do printf "%x\n" $((2#$a)); done | xxd -r -p
}
root@orangepizero2:/home/pihole#
root@orangepizero2:/home/pihole# # Check if script is running as root first
root@orangepizero2:/home/pihole# if [[ "$(whoami)" != "root" ]]; then
HostArchitecture" == > Print_Style "Benchmarks must be ran as root! Example: sudo ./Storage.sh" "$RED"
exit 1
fi
"* ]]; then
curl -o iozone3.deb http://ftp.us.debian.org/debian/pool/non-free/i/iozone3/iozone3_429-3+b1_armhf.deb
dpkg --install iozone3.deb
rm iozone3.deb
elif [[ "$DpkgArch" == "arm64" || "$HostArchitecture" == *"aarch64"root@orangepizero2:/home/pihole#
root@orangepizero2:/home/pihole# # Trim drives for more accurate benchmarking
root@orangepizero2:/home/pihole# fstrim -av

  • || "$HostArchitecture" == "arm64" ]]; then
    curl -o iozone3.deb http://ftp.us.debian.org/debian/pool/non-free/i/iozone3/iozone3_429-3+b1_arm64.deb
    dpkg --install iozone3.deb
    root@orangepizero2:/home/pihole# sync
    root@orangepizero2:/home/pihole# sync
    root@orangepizero2:/home/pihole#
    root@orangepizero2:/home/pihole# # Initialize variables
    root@orangepizero2:/home/pihole# Score=0
    root@orangepizero2:/home/pihole# DDWriteResult=0
    root@orangepizero2:/home/pihole# fio4kRandReadIOPS=0
    root@orangepizero2:/home/pihole# fio4kRandWriteIOPS=0
    root@orangepizero2:/home/pihole# IO4kRead=0
    root@orangepizero2:/home/pihole# IO4kWrite=0
    root@orangepizero2:/home/pihole# IO4kRandRead=0
    root@orangepizero2:/home/pihole# IO4kRandWrite=0
    root@orangepizero2:/home/pihole#
    root@orangepizero2:/home/pihole# # Did the user give a folder ?
    root@orangepizero2:/home/pihole# ChosenPartition=""
    root@orangepizero2:/home/pihole# if [ "$1" = "" ]; then

User did not provide a partition/folder, change directory to rootfs

cd /
else
if [ ! -d "$1" ]; then
Print_Style "Your chosen partition (folder) does not exist! Provide a good one or run without parameters to check the rootfs" "$RED"
exit 1
else
ChosenPartition="$1"
cd "$ChosenPartition"
fi
fi
root@orangepizero2:/#
root@orangepizero2:/# # Get host board information
root@orangepizero2:/# HostArchitecture=$(uname -m)
root@orangepizero2:/# HostOSInfo=$(cat /etc/os-release | sed 's/;/!/g')
root@orangepizero2:/# HostOS=$(echo "$HostOSInfo" | grep "PRETTY_NAME" | cut -d= -f2 | xargs)
root@orangepizero2:/#
root@orangepizero2:/# if [[ "$HostArchitecture" == "x86" || "$HostArchitecture" == "amd64" ]]; then

X86 or X86_64 system -- use dmidecode

HostModel=$(dmidecode -t1 | grep 'Product Name' -m 1 | cut -d: -f2 | xargs)
HostManufacturer=$(dmidecode -t1 | grep 'Manufacturer' -m 1 | cut -d: -f2 | xargs)
else

ARM system

HostModel=$(tr -d '\0' </proc/device-tree/model)
if [[ "$HostModel" == "Raspberry Pi" ]]; then
HostManufacturer="Raspberry Pi Foundation"
elif [[ "$HostModel" == "Tinker Board" ]]; then
HostManufacturer="ASUSTeK"
else
HostManufacturer=""
fi
fi
root@orangepizero2:/# Print_Style "Board information: Manufacturer: $HostManufacturer - Model: $HostModel - Architecture: $HostArchitecture - OS: $HostOS" "$YELLOW"
Board information: Manufacturer: - Model: Orange Pi Zero 2 - Architecture: aarch64 - OS: Debian GNU/Linux 11 (bullseye)root@orangepizero2:/#
root@orangepizero2:/# # Install required components
root@orangepizero2:/# Print_Style "Fetching required components ..." "$YELLOW"
Fetching required components ...
root@orangepizero2:/#
root@orangepizero2:/# # Test for apt first (all Debian based distros)
root@orangepizero2:/# if [[ -n "$(which apt)" ]]; then
apt-get update

Check if we are on a Raspberry Pi

if [[ $HostModel == "Raspberry Pi" ]]; then
# Check for vcgencmd (measures clock speeds)
if [ -z "$(which vcgencmd)" ]; then
apt-get install libraspberrypi-bin -y
fi
fi

Retrieve dependencies -- these are all bare minimum system tools to identify the hardware (many will already be built in)

apt-get install lshw pciutils usbutils lsscsi bc curl hwinfo hdparm nvme-cli dmidecode smartmontools fio sdparm xxd libxml-dumper-perl --no-install-recommends -y
if [ -z "$(which lshw)" ]; then apt-get install --no-install-recommends lshw -y; fi
if [ -z "$(which lspci)" ]; then apt-get install --no-install-recommends pciutils -y; fi
if [ -z "$(which lsusb)" ]; then apt-get install --no-install-recommends usbutils -y; fi
if [ -z "$(which lsscsi)" ]; then apt-get install --no-install-recommends lsscsi -y; fi
if [ -z "$(which bc)" ]; then apt-get install --no-install-recommends bc -y; fi
if [ -z "$(which curl)" ]; then apt-get install --no-install-recommends curl -y; fi
if [ -z "$(which hwinfo)" ]; then apt-get install --no-install-recommends hwinfo -y; fi
if [ -z "$(which hdparm)" ]; then apt-get install --no-install-recommends hdparm -y; fi
if [ -z "$(which dmidecode)" ]; then apt-get install --no-install-recommends dmidecode -y; fi
if [ -z "$(which fio)" ]; then apt-get install fio -y; fi
if [ -z "$(which iozone3)" ]; then apt-get install iozone3 -y; fi
if [ -z "$(which nvme)" ]; then apt-get install --no-install-recommends nvme-cli -y; fi
if [ -z "$(which smartctl)" ]; then apt-get install --no-install-recommends smartmontools -y; fi
if [ -z "$(which sdparm)" ]; then apt-get install -no-install-recommends sdparm -y; fi
if [ -z "$(which xxd)" ]; then apt-get install --no-install-recommends xxd -y; fi

DpkgArch=$(dpkg --print-architecture)
if [ -z "$(which iozone)" ]; then
# Attempt to install iozone from package
if [[ "$HostArchitecture" == "armv7" || "$HostArchitecture" == "armhf" ]]; then
curl -o iozone3.deb http://ftp.us.debian.org/debian/pool/non-free/i/iozone3/iozone3_429-3+b1_armhf.deb
dpkg --install iozone3.deb
rm iozone3.deb
elif [[ "$DpkgArch" == "arm64" || "$HostArchitecture" == "aarch64" || "$HostArchitecture" == "arm64" ]]; then
curl -o iozone3.deb http://ftp.us.debian.org/debian/pool/non-free/i/iozone3/iozone3_429-3+b1_arm64.deb
dpkg --install iozone3.deb
rm iozone3.deb
elif [[ "$DpkgArch" == "armel" ]]; then
curl -o iozone3.deb http://ftp.us.debian.org/debian/pool/non-free/i/iozone3/iozone3_429-3+b1_armel.deb
dpkg --install iozone3.deb
rm iozone3.deb
elif [[ "$HostArchitecture" == "x86_64" || "$HostArchitecture" == "amd64" ]]; then
curl -o iozone3.deb http://ftp.us.debian.org/debian/pool/non-free/i/iozone3/iozone3_429-3+b1_amd64.deb
dpkg --install iozone3.deb
rm iozone3.deb
elif [[ "$HostArchitecture" == "i386" ]]; then
curl -o iozone3.deb http://ftp.us.debian.org/debian/pool/non-free/i/iozone3/iozone3_429-3+b1_i386.deb
dpkg --install iozone3.deb
rm iozone3.deb
fi
fi

Test if we were able to install iozone3 from a package and don't install build-essential if we were

if [ -z "$(which iozone)" ]; then
apt-get install build-essential -y
fi

Next test for Pac-Man (Arch Linux)

elif [ -n "$(which pacman)" ]; then
pacman -Syy
pacman --needed --noconfirm -S
base-devel
bc
curl
dmidecode
fio
hdparm
lshw
lsscsi
pciutils
usbutils
nvme-cli
sdparm
vim

Install iozone

if ! command -v iozone; then
echo "Please install iozone via the AUR for this script to work" >&2
echo "https://aur.archlinux.org/packages/iozone/" >&2
exit 3
fi

Check if running on a Raspberry Pi

if [[ $HostModel == "Raspberry Pi" ]]; then
if [ -z "$(which vcgencmd)" ]; then
# Create soft link for vcgencmd
ln -s /opt/vc/bin/vcgencmd /usr/local/bin
fi
fi
else
Print_Style "No package manager found!" "$RED"
fi
Hit:2 http://security.debian.org bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye InRelease
Hit:4 http://deb.debian.org/debian bullseye-updates InRelease
Hit:5 http://deb.debian.org/debian bullseye-backports InRelease
Hit:1 http://sg-mirror.bret.dk/armbian/apt bullseye InRelease
Hit:6 http://giteduberger.fr rpimonitor/ InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
bc is already the newest version (1.07.1-2+b2).
curl is already the newest version (7.74.0-1.3+deb11u1).
dmidecode is already the newest version (3.3-2).
fio is already the newest version (3.25-2).
hdparm is already the newest version (9.60+ds-1).
hwinfo is already the newest version (21.72-1).
libxml-dumper-perl is already the newest version (0.81-1.3).
lshw is already the newest version (02.18.85-0.7).
lsscsi is already the newest version (0.31-1).
nvme-cli is already the newest version (1.12-5).
pciutils is already the newest version (1:3.7.0-5).
sdparm is already the newest version (1.10-1).
smartmontools is already the newest version (7.2-1).
usbutils is already the newest version (1:013-3).
xxd is already the newest version (2:8.2.2434-3+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
iozone3 is already the newest version (489-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@orangepizero2:/#
root@orangepizero2:/# if [ -z "$(which lsblk)" ]; then
Print_Style "Unable to locate the utility lsblk. Please install lsblk for your distro!" "$RED"
# Return to home directory
exit 3
fi
root@orangepizero2:/#
root@orangepizero2:/# if [ -z "$(which fio)" ]; then
Print_Style "Unable to locate the utility fio. Please install fio for your distro!" "$RED"
# Return to home directory
exit 3
fi
root@orangepizero2:/#
root@orangepizero2:/# # Get clock speeds
root@orangepizero2:/# if [[ "$HostArchitecture" == "x86" || "$HostArchitecture" == "amd64" ]]; then

X86 or X86_64 system -- use dmidecode

HostCPUClock=$(dmidecode -t4 | grep -m 1 'Max Speed' | cut -d: -f2 | cut -d' ' -f2 | xargs)
HostCoreClock=""
HostRAMClock=$(dmidecode -t17 | grep -m 1 "Speed: " | cut -d' ' -f2 | xargs)
else

Check for vcgencmd

if [ -n "$(which vcgencmd)" ]; then
HostConfig=$(vcgencmd get_config int)
HostCPUClock=$(echo "$HostConfig" | grep -m 1 arm_freq= | cut -d= -f2 | xargs)
if [ -z "$HostCPUClock" ]; then
HostCPUClock=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq | xargs)
HostCPUClock=$(echo "scale=0; $HostCPUClock / 1000" | bc)
fi
HostCoreClock=$(echo "$HostConfig" | grep -m 1 core_freq= | cut -d= -f2 | xargs)
if [ -z "$HostCoreClock" ]; then
HostCoreClock=$(echo "$HostConfig" | grep -m 1 gpu_freq= | cut -d= -f2 | xargs)
fi
if [ -z "$HostCoreClock" ]; then
HostCoreClock=$(vcgencmd measure_clock core | cut -d= -f2 | xargs)
HostCoreClock=$(echo "scale=0; $HostCoreClock / 1000000" | bc)
fi
HostRAMClock=$(echo "$HostConfig" | grep -m 1 sdram_freq= | cut -d= -f2 | xargs)
if [ -z "$HostRAMClock" ]; then
HostRAMClock=""
fi
HostConfig+=$(echo " ")
HostConfig+=$(vcgencmd get_config str)
else
HostConfig+=$(echo " ")
HostCPUClock=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq)
HostCPUClock=$(echo "scale=0; $HostCPUClock / 1000" | bc)
HostCoreClock=""
HostRAMClock=""
fi
fi
root@orangepizero2:/# Print_Style "Clock speeds: CPU: $HostCPUClock - Core: $HostCoreClock - RAM: $HostRAMClock" "$YELLOW"
Clock speeds: CPU: 1512 - Core: - RAM:
root@orangepizero2:/#
root@orangepizero2:/# # Retrieve and build iozone
root@orangepizero2:/# if [ -z "$(which iozone)" ]; then
if [ ! -f iozone/src/current/iozone ]; then
Print_Style "Building iozone ..." "$YELLOW"
DownloadURL=$(curl -N iozone.org | grep -m 1 -o 'src/current/iozone3_[^"]')
curl -o iozone.tar "http://www.iozone.org/$DownloadURL"
tar -xf iozone.tar
rm iozone.tar
mv iozone3_
iozone
cd iozone/src/current
make --quiet linux-arm
cd ../../..
fi
fi
root@orangepizero2:/#
root@orangepizero2:/# # Run sync to make sure all changes have been written to disk
root@orangepizero2:/# sync
root@orangepizero2:/#
root@orangepizero2:/# if [ -z "$ChosenPartition" ]; then

User did not provide a partition/folder, continue with rootfs

--Get system boot drive information--

Find from mountpoint first

BootDrive=$(findmnt -n -o SOURCE /)

Find by matching device IDs to / next

if [ -z "$BootDrive" ]; then
RDEV=$(mountpoint -d /)

for file in /dev/*; do
  DeviceIDP1=$(stat --printf="0x%t" "$file")
  DeviceIDP2=$(stat --printf="0x%T" "$file")
  DeviceID=$(printf "%d:%d" "$DeviceIDP1" "$DeviceIDP2")
  if [ "$DeviceID" = "$RDEV" ]; then
    BootDrive=$file
    break
  fi
done

fi

Fall back to finding from lsblk

if [ -z "$BootDrive" ]; then
BootDrive=$(lsblk -l | grep -v "0 part /boot" | grep -m 1 "0 part /" | awk 'NR==1{ print $1 }' | sed 's/[/@]//g')
if [ -n "$BootDrive" ]; then
BootDrive="/dev/"$BootDrive
fi
fi

Fall back to finding from df

if [ -z "$BootDrive" ]; then
BootDrive=$(df -H | grep -m 1 boot | awk 'NR==1{ print $1 }' | sed 's/[/@]//g')
fi
else
BootDrive=$(findmnt -n -o SOURCE "$ChosenPartition" | sed 's/[/@]//g')
fi
root@orangepizero2:/#
root@orangepizero2:/# # Detect BootDrive suffix
root@orangepizero2:/# BootDriveSuffix=$(echo "$BootDrive" | cut -d"/" -f3)
root@orangepizero2:/# if [ -z "$BootDriveSuffix" ]; then
BootDriveSuffix=$(echo "$BootDrive" | cut -d"/" -f2)
fi
root@orangepizero2:/# if [ -z "$BootDriveSuffix" ]; then
BootDriveSuffix=$(echo "$BootDrive" | cut -d"/" -f1)
fi
root@orangepizero2:/# if [ -z "$BootDriveSuffix" ]; then
BootDriveSuffix="$BootDrive"
fi
root@orangepizero2:/#
root@orangepizero2:/# if [ -z "$ChosenPartition" ]; then
Print_Style "System rootfs drive (/) has been detected as $BootDrive ($BootDriveSuffix)" "$YELLOW"
else
Print_Style "Chosen partition ($ChosenPartition) has been detected as $BootDrive ($BootDriveSuffix)" "$YELLOW"
fi
System rootfs drive (/) has been detected as /dev/mmcblk0p1 (mmcblk0p1)
root@orangepizero2:/#
root@orangepizero2:/# Print_Style "Starting INXI hardware identification..." "$YELLOW"
Starting INXI hardware identification...
root@orangepizero2:/# # Retrieve inxi hardware identification utility (https://github.com/smxi/inxi for more info)
root@orangepizero2:/# curl -o inxi https://raw.githubusercontent.com/smxi/inxi/master/inxi
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1062k 100 1062k 0 0 1676k 0 --:--:-- --:--:-- --:--:-- 1676k
root@orangepizero2:/# chmod +x inxi
root@orangepizero2:/# Test_inxi=$(./inxi -F -v8 -c0 -M -m -d -f -i -l -m -o -p -r -t -u -xxx 2>&1 | sed 's/;/!/g')
root@orangepizero2:/# ./inxi -v4 -d -c0 2>&1
System:
Host: orangepizero2 Kernel: 4.9.255-sun50iw9 arch: aarch64 bits: 64 compiler: gcc v: 8.3.0
Console: pty pts/0 Distro: Armbian GNU/Linux 11 (bullseye)
Machine:
Type: ARM System: Orange Pi Zero 2 details: N/A
CPU:
Info: quad core model: N/A variant: cortex-a53 bits: 64 type: MCP arch: ARMv8 rev: 4
Speed (MHz): avg: 480 min/max: 480/1512 cores: 1: 480 2: 480 3: 480 4: 480 bogomips: N/A
Features: Use -f option to see features
Graphics:
Device-1: sunxi-disp driver: disp v: N/A bus-ID: N/A
Device-2: sunxi-hdmi driver: allwinner,sunxi_hdmi v: N/A bus-ID: N/A
Device-3: mali-midgard driver: N/A bus-ID: N/A
Display: unspecified server: N/A driver: N/A note: X driver n/a tty: 293x72
Message: Unable to show GL data. Required tool glxinfo missing.
Network:
Device-1: sunxi-gmac driver: sunxi_gmac v: kernel port: N/A bus-ID: N/A
IF: eth0 state: up speed: 1000 Mbps duplex: full mac: 36:cd:5d:1c:3d:9b
Device-2: sunxi-wlan driver: sunxi_wlan v: N/A bus-ID: N/A
IF-ID-1: dummy0 state: down mac: 1e:8c:a8:cc:78:c3
IF-ID-2: gre0 state: down mac: 00:00:00:00
IF-ID-3: gretap0 state: down mac: 00:00:00:00:00:00
IF-ID-4: ip6_vti0 state: down mac: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
IF-ID-5: ip6tnl0 state: down mac: 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
IF-ID-6: ip_vti0 state: down mac: 00:00:00:00
IF-ID-7: sit0 state: down mac: 00:00:00:00
IF-ID-8: tunl0 state: down mac: 00:00:00:00
IF-ID-9: wlan0 state: dormant mac: 28:16:99:4a:89:d6
Drives:
Local Storage: total: 29.81 GiB used: 1.53 GiB (5.1%)
ID-1: /dev/mmcblk0 model: JB1RT size: 29.81 GiB
Message: No optical or floppy data found.
Partition:
ID-1: / size: 28.92 GiB used: 1.53 GiB (5.3%) fs: ext4 dev: /dev/mmcblk0p1
Info:
Processes: 173 Uptime: 26m Memory: 965.2 MiB used: 203.1 MiB (21.0%) Init: systemd runlevel: 5
Compilers: gcc: 10.2.1 Packages: 565 Shell: Bash v: 5.1.4 inxi: 3.3.15
root@orangepizero2:/# rm -f inxi
root@orangepizero2:/#
root@orangepizero2:/# Print_Style "Running additional hardware identification tests..." "$YELLOW"
Running additional hardware identification tests...
root@orangepizero2:/# Test_udevadm=$(udevadm info -w20 -a -n "$BootDrive" 2>&1 | sed 's/;/!/g' | sed '/^[[:space:]]*$/d')
root@orangepizero2:/# Test_lsblk=$(lsblk -l -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL 2>&1 | sed 's/;/!/g')
root@orangepizero2:/# Test_lshw=$(lshw 2>&1 | sed 's/;/!/g')


That is as far as it gets and the whole system pretty much hangs there with no chance of recovering. I gave it about 10 minutes last time to see if it came back but nothing happened.

@munecito
Copy link
Author

James. Would it be helpful if I was to contribute with your project by donating one of these orange pi boards?

I just feel that I may be missing on passing some critical information and maybe having one for you to tinker with may help more than me trying to explain what happens each time. It is not that it bothers me to keep trying, it is the actual concern that I may be missing on passing some information that is relevant to the case.

I will be learning a bit of Phyton soon on a short course offered by a Technical college as part of a government initiative to give people new on demand skills post COVID. So hopefully I can be more useful soon enough.

@TheRemote
Copy link
Owner

TheRemote commented May 11, 2022

Ah hah! Now it's freezing on lshw it looks like. I may just use the generic Linux timeout command and do something similar for this one. This one seems like a "hard" freeze here since you can't Ctrl+C out of it. I wonder why both methods are triggering the freeze.

I'd definitely graciously accept the boards as I don't have any Orange Pi ones. Normally I just buy these things but right now we are in a Raspberry Pi shortage where they're being scalped for $200 on Amazon, cryptocurrency is all crashed out and IT across the board is in a major pullback so I don't have much cashflow at the moment to drop on boards for testing.

That is exciting that you're getting into some programming/coding! I use Python quite a bit even though I don't have any repositories for it at the moment (I'm trying to start publishing more of the stuff I've already done and use personally). You've been incredibly helpful and we've already fixed one potential freeze I wasn't aware of.

Now for the lshw one. What happens if you run lshw in the console? I am wondering if it is going to freeze on "PCI (sysfs)". I'm wondering because of this thread. The output of the lshw isn't on the screen since it's being piped into that variable (to be submitted with the benchmark). If you type it in the console we should be able to find out exactly what it's freezing on.

Some more references to this issue:
https://www.reddit.com/r/linux4noobs/comments/2eaekj/lshw_bug_help_please/
https://forum.manjaro.org/t/lspci-lshw-commands-cause-total-freeze-kernel-5-12/65484
https://lists.debian.org/debian-user/2010/04/msg00283.html

These are from all over the place as far as a timeline. The theme I seem to keep running into is it's some kind of kernel bug. Is this for sure completely up to date with a sudo apt update && sudo apt dist-upgrade? It we are lucky maybe there's a kernel upgrade in there.

Before we go too far with that let's look at the exact output you're getting from lshw before the freeze occurs if you just type:
lshw
or
sudo lshw

The point where it freezes seems to tell us a lot from what I'm finding about related issues. Thanks again!

@munecito
Copy link
Author

James.

I'm sending you an email to your Gmail account that is linked to PayPal.

@munecito
Copy link
Author

No freezing running lshw

root@orangepizero2:/home/pihole# lshw
orangepizero2
description: Computer
product: Orange Pi Zero 2
width: 64 bits
capabilities: smp cp15_barrier setend swp
*-core
description: Motherboard
physical id: 0
*-cpu:0
description: CPU
product: cpu
physical id: 0
bus info: cpu@0
size: 1512MHz
capacity: 1512MHz
capabilities: fp asimd aes pmull sha1 sha2 crc32 cpufreq
*-cpu:1
description: CPU
product: cpu
physical id: 1
bus info: cpu@1
size: 1512MHz
capacity: 1512MHz
capabilities: fp asimd aes pmull sha1 sha2 crc32 cpufreq
*-cpu:2
description: CPU
product: cpu
physical id: 2
bus info: cpu@2
size: 1512MHz
capacity: 1512MHz
capabilities: fp asimd aes pmull sha1 sha2 crc32 cpufreq
*-cpu:3
description: CPU
product: cpu
physical id: 3
bus info: cpu@3
size: 1512MHz
capacity: 1512MHz
capabilities: fp asimd aes pmull sha1 sha2 crc32 cpufreq
*-cpu:4 DISABLED
description: CPU
product: idle-states
physical id: 4
bus info: cpu@4
*-memory
description: System memory
physical id: 5
size: 965MiB
*-usbhost:0
product: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
vendor: Linux 4.9.255-sun50iw9 ehci_hcd
physical id: 1
bus info: usb@1
logical name: usb1
version: 4.09
capabilities: usb-2.00
configuration: driver=hub slots=1 speed=480Mbit/s
*-usbhost:1
product: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
vendor: Linux 4.9.255-sun50iw9 ehci_hcd
physical id: 2
bus info: usb@2
logical name: usb2
version: 4.09
capabilities: usb-2.00
configuration: driver=hub slots=1 speed=480Mbit/s
*-usbhost:2
product: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
vendor: Linux 4.9.255-sun50iw9 ehci_hcd
physical id: 3
bus info: usb@3
logical name: usb3
version: 4.09
capabilities: usb-2.00
configuration: driver=hub slots=1 speed=480Mbit/s
*-usbhost:3
product: SW USB2.0 'Open' Host Controller (OHCI) Driver
vendor: Linux 4.9.255-sun50iw9 ohci_hcd
physical id: 4
bus info: usb@4
logical name: usb4
version: 4.09
capabilities: usb-1.10
configuration: driver=hub slots=1 speed=12Mbit/s
*-usbhost:4
product: SW USB2.0 'Open' Host Controller (OHCI) Driver
vendor: Linux 4.9.255-sun50iw9 ohci_hcd
physical id: 5
bus info: usb@5
logical name: usb5
version: 4.09
capabilities: usb-1.10
configuration: driver=hub slots=1 speed=12Mbit/s
*-usbhost:5
product: SW USB2.0 'Open' Host Controller (OHCI) Driver
vendor: Linux 4.9.255-sun50iw9 ohci_hcd
physical id: 6
bus info: usb@6
logical name: usb6
version: 4.09
capabilities: usb-1.10
configuration: driver=hub slots=1 speed=12Mbit/s
*-network:0 DISABLED
description: Ethernet interface
physical id: 7
logical name: gretap0
capabilities: ethernet physical
configuration: broadcast=yes multicast=yes
*-network:1 DISABLED
description: Ethernet interface
physical id: 8
logical name: dummy0
serial: 1e:8c:a8:cc:78:c3
capabilities: ethernet physical
configuration: broadcast=yes driver=dummy driverversion=1.0
*-network:2
description: Ethernet interface
physical id: 9
logical name: eth0
serial: 36:cd:5d:1c:3d:9b
size: 1Gbit/s
capacity: 1Gbit/s
capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=sunxi_geth driverversion=SUNXI Gbgit driver V1.1 duplex=full ip=192.168.1.3 link=yes multicast=yes port=MII speed=1Gbit/s
*-network:3
description: Ethernet interface
physical id: a
logical name: wlan0
serial: 28:16:99:4a:89:d6
capabilities: ethernet physical
configuration: broadcast=yes driver=unisoc_wifi multicast=yes
root@orangepizero2:/home/pihole#

@TheRemote
Copy link
Owner

TheRemote commented May 12, 2022

That is very puzzling! It definitely seemed to be freezing on the lshw test. Does it still stop there if you run it the other way?

Can you give the results of uname -a? Basically extremely serious kernel and driver problems are the only thing that can explain this. Most of the results say these are all fixed in newer kernels that I'm seeing. It looks like a current kernel would be something like 5.10+ for the current Armbian Buster branch.

https://forum.armbian.com/topic/12577-orange-pi-zero-plus2-h5-wifi-unstable/
https://forum.armbian.com/topic/19237-armbian-upgrade-from-buster-to-bullseye/

I'm seeing a massive amount of complaints of the old drivers / kernel on the armbian forums so we definitely want to make sure yours is up to date. The older ones seem like they're an absolute mess and we can pretty much personally attest that the currently installed kernel can't handle a hdparm or a lshw (reliably) which are core system utilities basically.

Is this running bullseye? It looks extremely annoying to upgrade the kernel on armbian and looks like it requires using armbian-config to upgrade it. I wanted to mention this because it looks like if you have done the steps to properly upgrade this you will know it as they aren't easy or intuitive.

Because of this and how many driver / firmware related issues I'm seeing related to the Orange Pi Zero 2 and the difficulty of upgrading unless this is a recent install I'm guessing it's going to be a 4.X kernel. It's very possible all of these issues are completely fixed but that it may take reimaging with the latest image or doing some tricky upgrades.

Let's grab the kernel config with uname -a as it's honestly so bad (way beyond anything to do with the script) that I feel like there has to be some sort of older kernel going on potentially! This seems to be extremely common due to the higher difficulty of upgrading although both Ubuntu and Raspberry Pi OS have their own quirks like this too when you want to jump releases.

Since you are planning on potentially donating one of these boards you can also feel free to leave it to me as I love playing with this stuff but if we're lucky one key upgrade might solve this!

@munecito
Copy link
Author

As far as I can see in the Armbian page the kernel used in the version for the orange pi zero 2 is 4.9.y

They offer two other variants with newer kernels but I am really not sure if they are better or not. One of a version of Arbian Focal with kernel 5.16.y and the other one is a Jammy(autobuild) with kernel 5.17.5

Focal |   |   |   |   | stable | 5.16.y | SHA | ASC | 287M | Mar 7, 2022
Jammy (autobuild) |   | n/a | n/a | n/a | rolling | 5.17.5 | SHA | ASC | 317M | May 12, 2022

Both are at the bottom of the page:

https://www.armbian.com/orange-pi-zero-2/#kernels-archive-all

I am using the stable bullseye offered at the top with 4.9.y.

The results of uname are below:

root@orangepizero2:/home/pihole# uname -a
Linux orangepizero2 4.9.255-sun50iw9 #1 SMP PREEMPT Tue Mar 1 23:28:34 UTC 2022 aarch64 GNU/Linux
root@orangepizero2:/home/pihole#

Thank you James.

@TheRemote
Copy link
Owner

TheRemote commented May 12, 2022

Ahh, perfect, that helps a lot! So I can definitely explain their options here. They have two flavors. One is Debian-based (Bullseye right now) and the other one is Ubuntu based (Focal).

Focal is Ubuntu 20.04 which is the current LTS release. Kernel 5.16 would probably be a good choice to try to see which of these issues may be resolved.

Bullseye is the current Debian release and Jammy is the next one. The images page for Jammy says it's a rolling release which are usually less stable. It looks like to me that the Focal one is the most stable (and according to them as well) besides Bullseye but we know Bullseye still has that really old kernel.

That's probably why Bullseye is listed first or as the most "stable" but just like long term support versions on other distros/flavors that can sometimes mean really old kernels that may not get fixes backported to the old versions for some of these hardware problems.

http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=5905
https://www.reddit.com/r/OrangePI/comments/swabzt/endess_kernel_loading_on_orange_pi_zero_2/

That last one is an example of .dtb issues on the Pi Zero 2 that switching between the Ubuntu and Debian flavors actually seemed to impact the behavior.

I also found this interesting article:

https://medium.com/nerd-for-tech/fixing-a-defective-orange-pi-r1-a95ba7901fcf

In that case it was actually a hardware error causing the kernel to crash. He resoldered a part that came loose and then it stopped crashing.

I checked my jamesachambers.com server running Ubuntu 20.04 (LTS, nothing new or special) to see it's kernel:

ubuntu@jamesachambers:~$ uname -a
Linux jamesachambers.com 5.13.0-1022-aws #24~20.04.1-Ubuntu SMP Thu Apr 7 22:10:15 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

on my Ubuntu 22.04 desktop it's:

james@jamesgigabyte-linux:~/PhoenixMiner$ uname -a
Linux jamesgigabyte-linux 5.15.0-27-generic #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

and finally I checked my Raspberry Pi running normal Raspberry Pi OS (notorious for being behind and outdated):

pi@pi400:~ $ uname -a
Linux pi400 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux

The 4.X kernel branch strikes me as ancient and I couldn't find any device I had running anything like that (except for vendor IoT devices that I'm probably not even supposed to know how to get in).

It strikes me as you have nothing to lose here. The kernel definitely seems to have major issues with that board and I wasn't able to find any examples of it ever making it worse from upgrading (it only seemed to help).

I'm guessing most of the "stable" part for that kernel has to do more with software and not hardware/drivers. A lot of software packages don't like kernel jumps very much and it's probably for them that they have this as a recommendation but for a PiHole I would go for the best hardware compatibility with a newer kernel.

Maybe Jammy is fine too though. It's the "rolling" userspace. Are you using the Bullseye one for any specific reason or does it not really matter and that is just the one you picked originally? Either route would get a much newer kernel and I'd be very curious to see what kind of impacts it has on this board for sure!

@munecito
Copy link
Author

In not running bullseye because of any specific needs. I just saw it was a stable version and went with it.

I'm going to backup my pihole configuration and install the Ubuntu one to run the benchmark again.

There's nothing running the that can't be redeployedb within a couple of hours.

@munecito
Copy link
Author

munecito commented May 13, 2022

I tried to install Bullseye and Focal from the official Armbian page and they both fail to even start.

Seraching online I found a Facebook post from Orange pi themselves with new releases for the Zero 2 in both Debian and Ubuntu with kernel 5.16 and 5.13 respectively. They were released two days ago.

https://www.facebook.com/groups/1620838934806045/permalink/3129296583960265/

I am currently downloading them and will report back.

The direct links to a google drive of those downloads are:

https://drive.google.com/drive/folders/1Xk7b1jOMg-rftowFLExynLg0CyuQ7kCM?fbclid=IwAR3kjmlLbhTrXosS38JI9urzKCNHWVSh3zDmygUMuvUZZ35D1tjaAxwgtdY

https://drive.google.com/drive/folders/1ohxfoxWJ0sv8yEHbrXL1Bu2RkBhuCMup?fbclid=IwAR0C4Kvy-FkJ6cojv2ksFibLj0pvkpbpI04j4FS5oZzMWd6Jpxg5duf5Zlk

@munecito
Copy link
Author

I think it was the old Kernel giving us all those headaches!!!

https://pibenchmarks.com/benchmark/59644

At the end of the test I got a lot of garbled test.

I will now flash ubuntu to test again and may even test with desktop versions.

I must admit that the SD reader in the Orange Pi is quite disappointing compared to the Raspberry pi 4 and 400.

For some reason the board also doesn't like armbian versions of Focal. It is a shame as I really liked the armbian -config command that brought a configuration interface that was very nice. Now I need to try to learn if that can be migrated into these versions.

So I think you can close this issue James.

Thank you.

@TheRemote
Copy link
Owner

TheRemote commented May 13, 2022

Hey munecito,

Great outcome! I'm glad we were able to narrow things down. This is one of the tougher ones I've done in a while but I really want to dive into these new boards. I'm sure there are hundreds if not thousands of other boards out there I've never heard of.

I learned a lot for sure. I totally understand about the SD reader being a slight disappointment. That is a very nice SD card you have in it (the score is off by about 43%).

I had a feeling that this might bear some fruit because working with the Pi for probably almost a decade now I've seen how long the hardware fixes for the Pi take to get into the modern kernel versions. It's sometimes years before they make it from being finished/fixed to actually available in the public repositories (this has got better in the past year or two but traditionally this was a problem).

Given this background I think there was an excellent reason to expect that a lot of those changes will never be backported to the older kernel for something like Orange Pi (although I was impressed with their site and resources they are nowhere near the size of Raspberry Pi at this point and nobody is really even close at the moment). I think you're definitely on the right track to improve your experience on these boards (no matter what they turn out to be capable of performance wise). I imagine it's possible to get those issues fixed on armbian by somehow getting the newer kernel working on it.

I got the preload wrong on your board. If you refresh your benchmark I fixed it now (I had it as Zero 2 and it came through as Zero2 without the space). There is also a board category (with a total of 1 benchmark) here: https://pibenchmarks.com/board/OrangePi_Zero2

Thank you for your extremely comprehensive investigation and time on this! I definitely enjoyed it and learned a lot. I definitely know how to help people with issues like this in the future (and how to investigate the causes a little better). This was kind of a trial run for diagnosing other boards that I'm not as familiar with and don't even have in some cases. Take care!

@munecito
Copy link
Author

No worries. I'm trying now the Ubuntu image.

Then I'll try the desktop versions as the Ubuntu is something different again.

Then I'll make up my mind about what distro to use.

Thank you for all your help.

@TheRemote
Copy link
Owner

TheRemote commented Jul 13, 2022 via email

@munecito
Copy link
Author

munecito commented Jul 13, 2022 via email

@TheRemote
Copy link
Owner

TheRemote commented Jul 14, 2022 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants