Skip to content

Instantly share code, notes, and snippets.

@lukasMega
Last active April 14, 2024 20:09
Show Gist options
  • Save lukasMega/722766a2030b11b96215bafcda49ad21 to your computer and use it in GitHub Desktop.
Save lukasMega/722766a2030b11b96215bafcda49ad21 to your computer and use it in GitHub Desktop.
My Unraid server (Odroid H3)

Unraid

πŸ“¦ Tweaks: Install additional packages

install bc

  • Why? Needed for script to enable ASPM
    • Why? In order to achieve lower idle power consumption, when PCI devices
  • go to /boot/extra -> cd /boot/extra
  • download bc package: wget https://slackware.uk/slackware/slackware64-15.0/slackware64/ap/bc-1.07.1-x86_64-5.txz
  • install: upgradepkg --install-new bc-1.07.1-x86_64-5.txz

install neofetch

  • go to /boot/extra -> cd /boot/extra

  • download neofetch package: wget https://slackware.uk/slackware/slackware64-current/slackware64/ap/neofetch-20211210_ccd5d9f5-noarch-1.txz

  • install: upgradepkg --install-new neofetch-20211210_ccd5d9f5-noarch-1.txz

  • sample output
    root@unr:/boot/extra# upgradepkg --install-new neofetch-20211210_ccd5d9f5-noarch-1.txz 
    
    +==============================================================================
    | Installing new package ./neofetch-20211210_ccd5d9f5-noarch-1.txz
    +==============================================================================
    
    Verifying package neofetch-20211210_ccd5d9f5-noarch-1.txz.
    Installing package neofetch-20211210_ccd5d9f5-noarch-1.txz:
    PACKAGE DESCRIPTION:
    # neofetch (system information tool) 
    #
    # Neofetch is a command-line system information tool written in bash
    # 3.2+. Neofetch displays information about your operating system,
    # software and hardware in an aesthetic and visually pleasing way. The
    # overall purpose of Neofetch is to be used in screenshots of your
    # system. Neofetch shows the information other people want to see. There
    # are other tools available for proper system statistic/diagnostics.
    #
    # Homepage: https://github.com/dylanaraps/neofetch/wiki
    #
    Package neofetch-20211210_ccd5d9f5-noarch-1.txz installed.
    root@unr:/boot/extra# neofetch 
                      :::::::                      root@unr 
                :::::::::::::::::::                -------- 
             :::::::::::::::::::::::::             OS: Slackware 15.0 x86_64 (post 15.0 -current) x86_64 
           ::::::::cllcccccllllllll::::::          Host: HARDKERNEL ODROID-H3 
        :::::::::lc               dc:::::::        Kernel: 6.1.64-Unraid 
       ::::::::cl   clllccllll    oc:::::::::      Uptime: 1 hour, 32 mins 
      :::::::::o   lc::::::::co   oc::::::::::     Shell: bash 5.2.15 
     ::::::::::o    cccclc:::::clcc::::::::::::    Terminal: ttyd 
     :::::::::::lc        cclccclc:::::::::::::    CPU: Intel Celeron N5105 (4) @ 2.900GHz 
    ::::::::::::::lcclcc          lc::::::::::::   GPU: Intel JasperLake [UHD Graphics] 
    ::::::::::cclcc:::::lccclc     oc:::::::::::   Memory: 589MiB / 15855MiB 
    ::::::::::o    l::::::::::l    lc:::::::::::
     :::::cll:o     clcllcccll     o:::::::::::                            
     :::::occ:o                  clc:::::::::::                            
      ::::ocl:ccslclccclclccclclc:::::::::::::
       :::oclcccccccccccccllllllllllllll:::::
        ::lcc1lcccccccccccccccccccccccco::::
          ::::::::::::::::::::::::::::::::
            ::::::::::::::::::::::::::::
               ::::::::::::::::::::::
                    ::::::::::::
    

Some useful scripts

(useful for me)

Content of /boot/extra:

root@unr:~# ls -lha /boot/extra/
total 2.4M
drwx------ 2 root root 8.0K Dec 28 21:32 ./
drwx------ 7 root root 8.0K Jan  1  1970 ../
-rw------- 1 root root  165 Dec 28 21:25 aspm-info.sh
-rw------- 1 root root 7.6K Dec 28 21:19 aspm-set.sh
-rw------- 1 root root 114K Feb 13  2021 bc-1.07.1-x86_64-5.txz
-rw------- 1 root root  88K Dec 17  2021 neofetch-20211210_ccd5d9f5-noarch-1.txz
-rw------- 1 root root 2.1M Dec 28 09:16 powertop-2.15-x86_64-1.txz

aspm-info.sh

  • /boot/extra/aspm-info.sh
  • script content:
    # show ASPM info (using lspci):
    
    echo 'ASPM Info script:';
    
    lspci -vvPPDq | awk '/ASPM/{print $0}' RS= | grep --color -P '(^[a-z0-9:./]+|:\sASPM (\w+)?( \w+)? ?((En|Dis)abled)?)';;

aspm-set.sh

  • /boot/extra/aspm-set.sh
  • script content: see https://gist.github.com/lukasMega/7c4b5ab51b6f7c135f51af59b29e1df7
  • end of script:
    # -----------------------------------------
    ROOT_COMPLEX="00:1c.0"
    ENDPOINT="01:00.0"
    
    device_present $ENDPOINT not_sure
    if [[ $? -ne 0 ]]; then
            exit
    fi
    
    echo -e "${CYAN}Root complex${NORMAL}:"
    enable_aspm_byte $ROOT_COMPLEX; echo;
    
    echo -e "${CYAN}Endpoint${NORMAL}:"
    enable_aspm_byte $ENDPOINT; echo;
    
    
    # ----------------------------------------
    ROOT_COMPLEX="00:1c.1"
    ENDPOINT="02:00.0"
    
    device_present $ENDPOINT not_sure
    if [[ $? -ne 0 ]]; then
            exit
    fi
    
    echo -e "${CYAN}Root complex${NORMAL}:"
    enable_aspm_byte $ROOT_COMPLEX; echo;
    
    echo -e "${CYAN}Endpoint${NORMAL}:"
    enable_aspm_byte $ENDPOINT; echo;
    

β–Ά Useful commands

CPU Temperature

root@unr:~# sensors | grep --color -P '((Package|Core|CPU Temp|MB Temp).*:\s+\+[\d.Β°C]+)'
CPU Temp:     +31.0Β°C  (high = +105.0Β°C, crit = +105.0Β°C)
Core 0:       +21.0Β°C  (high = +105.0Β°C, crit = +105.0Β°C)
Core 1:       +21.0Β°C  (high = +105.0Β°C, crit = +105.0Β°C)
Core 2:       +21.0Β°C  (high = +105.0Β°C, crit = +105.0Β°C)
Core 3:       +21.0Β°C  (high = +105.0Β°C, crit = +105.0Β°C)
MB Temp:      +28.9Β°C  (low  = -273.1Β°C, high = +81.8Β°C)


# or every 1 sec:
watch -n 1 "sensors | grep --color -P '((Package|Core).*:\s+\+[\d.Β°C]+)'"
  • "MB Temp" is in my case temperature of nvme SSD (Samsung 980 Pro)

CPU actual frequency

root@unr:~# cat /proc/cpuinfo | grep MHz
cpu MHz		: 863.056
cpu MHz		: 1544.432
cpu MHz		: 800.024
cpu MHz		: 1543.135

CPU governor

root@unr:~# /etc/rc.d/rc.cpufreq status
Enabled CPU frequency scaling governor:  powersave

Docker service status

root@unr:~# /etc/rc.d/rc.docker status
status of dockerd: running
running containers: immich postgres14 redis scrutiny

dmesg errors

root@unr:~# dmesg -T -l emerg,alert,crit,err
[Wed Jan  3 14:35:16 2024] db_root: cannot open: /etc/target

PCI devices ASPM status

root@unr:~# sudo lspci -vvPPDq | awk '/ASPM/{print $0}' RS= | grep --color -P '(^[a-z0-9:./]+|:\sASPM (\w+)? ?((En|Dis)abled)?)';

0000:00:1c.4 PCI bridge: Intel Corporation Device 4dbc (rev 01) (prog-if 00 [Normal decode])
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes, Disabled- CommClk+
0000:00:1c.4/03:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 (prog-if 02 [NVM Express])
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes, Disabled- CommClk+

Powertop output from CSV report

root@unr:~# powertop -C &> /dev/null && cat powertop.csv | head -n 42

____________________________________________________________________
			P o w e r T O P

____________________________________________________________________
 *  *  *   System Information   *  *  *

PowerTOP Version;2.15 ran at Sun Apr 14 21:25:02 2024

Kernel Version;Linux version 6.1.79-Unraid
System Name;HARDKERNELODROID-H31.0
CPU Information;4 Intel(R) Celeron(R) N5105 @ 2.00GHz
OS Information;Slackware 15.0 x86_64 (post 15.0 -current)

Target: 1 units/s;System:  284.9 wakeup/s;CPU:  6.2% usage;GPU: 0 ops/s;GFX: 0 wakeups/s;VFS: 0 ops/s;

____________________________________________________________________
 *  *  *   Top 10 Power Consumers   *  *  *

Usage;Events/s;Category;Description
  0.3%;210.9;Timer;tick_sched_timer
  0.0%; 15.8;Process;[PID 15] [rcu_preempt]
  0.0%;  9.5;kWork;bond_mii_monitor
  0.0%;  3.5;Process;[PID 10480] /usr/local/bin/shfs /mnt/user -disks 3 -o default_permissions,allow_other,noatime -o remember=0 
  0.0%;  3.4;Interrupt;[3] net_rx(softirq)
  0.5%;  1.1;Process;[PID 6400] /usr/local/bin/emhttpd 
  0.0%;  3.2;kWork;free_work
  0.0%;  1.9;Process;[PID 45] [kcompactd0]
  0.0%;  1.5;Process;[PID 10478] /usr/local/bin/shfs /mnt/user -disks 3 -o default_permissions,allow_other,noatime -o remember=0 
  0.0%;  1.2;Process;[PID 10479] /usr/local/bin/shfs /mnt/user -disks 3 -o default_permissions,allow_other,noatime -o remember=0 

____________________________________________________________________
 *  *  *   Processor Idle State Report   *  *  *

Package;0
C2 (pc2);  4.8%
C3 (pc3);  0.0%
C6 (pc6);  0.0%
C7 (pc7);  0.5%
C8 (pc8);  0.0%
C9 (pc9);  0.0%
C10 (pc10); 85.4%
;

Docker useful monitoring commands

List containers

root@unr:~# docker ps --all
CONTAINER ID   IMAGE                                     COMMAND                  CREATED             STATUS                     PORTS                                       NAMES
983b4c3c1d64   ghcr.io/imagegenius/immich:latest         "/init"                  30 minutes ago      Up 30 minutes              0.0.0.0:8080->8080/tcp, :::8080->8080/tcp   immich
13d367659450   tensorchord/pgvecto-rs:pg14-v0.1.11       "docker-entrypoint.s…"   34 minutes ago      Exited (0) 3 minutes ago                                               postgres14
c4b6b89dc388   redis                                     "docker-entrypoint.s…"   34 minutes ago      Up 30 minutes              0.0.0.0:6379->6379/tcp, :::6379->6379/tcp   redis
80f8977a9a18   ghcr.io/analogj/scrutiny:master-omnibus   "/init"                  About an hour ago   Up About an hour           0.0.0.0:8085->8080/tcp, :::8085->8080/tcp   scrutiny
c1fcd0d16ff6   lscr.io/linuxserver/firefox               "/init"                  20 hours ago        Exited (0) 20 hours ago                                                firefox

Statistics of running containers

root@unr:~# docker stats --no-stream 
CONTAINER ID   NAME       CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O        PIDS
983b4c3c1d64   immich     0.94%     974.6MiB / 15.48GiB   6.15%     2.66MB / 49.8MB   978MB / 1.7MB    45
c4b6b89dc388   redis      0.31%     14.03MiB / 15.48GiB   0.09%     4.71MB / 1.57MB   20.8MB / 442kB   5
80f8977a9a18   scrutiny   0.00%     104.3MiB / 15.48GiB   0.66%     6.2kB / 3.05kB    158MB / 0B       28

Other sources

//TODO finish it




my current NAS:

Odroid H3 with Unraid

 Unraid NAS                                (12V / 4Wh)
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Odroid H3                       β”‚
β”‚                                                     β”‚
β”‚  Intel N5105                          Unraid 6.12.6 β”‚
β”‚  1x 16GB DDR4                                       β”‚
β”‚                                                     β”‚
β”‚                 2.5G  2.5G                          β”‚
β”‚     SATA SATA   LAN   LAN#2               USB2  USB2β”‚
β”‚M.2   #1   #2     #1   unused               #1    #2 β”‚
β””β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”˜
  β”‚    β”‚    β”‚      β”‚                          β”‚     β”‚
  β”‚    β”‚    β”‚      └──► switch 2.5G           └──┐  β”‚
  β”‚    β”‚    β”‚                                    β”‚  β”‚
  β”‚    β”‚    β”‚                                    β”‚  β”‚
  β”‚    β”‚    β”‚              pool RAID1 (btrfs)    β”‚  β”‚
  β”‚    β”‚    β”‚  (SSD)   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚  β”‚
  β”‚    β”‚    └─────────►│ Samsung 860 EVO 4TB β”‚   β”‚  β”‚
  β”‚    β”‚       (SSD)   β”‚                     β”‚   β”‚  β”‚
  β”‚    └──────────────►│ Samsung 860 EVO 4TB β”‚   β”‚  β”‚
  β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚  β”‚
  β”‚                                              β”‚  β”‚
  β”‚                        pool "Cache" (xfs)    β”‚  β”‚
  β”‚            (SSD)   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚  β”‚
  └───────────────────►│ Samsung 980 Pro 2TB β”‚   β”‚  β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚  β”‚
                                                 β”‚  β”‚
                                                 β”‚  β”‚
     (boot) 16GB Transcend JetFlash 180I   β—„β”€β”€β”€β”€β”€β”˜  β”‚
      industrial-grade flash with ECC, SLC mode     β”‚
                                                    β”‚
                                                    β”‚
     (dummy) 64GB USB2 ADATA Flash Drive   β—„β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      array  for storing backups of bootUSB

⚑Power consumption (idle):

  • ~ 3-4W (on the DC side)
  • ~ 4Wh (on the AC side - measured with Shelly 1PM)

H3_3xSSD_idle_01


2024-04-14 update to v6.12.10

⚑Power consumption (idle, after boot):

H3-idle-2024-04-14-2131(3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment