Friday, May 1, 2020

Raspi3 B+ external SSD USB freezes and hangs

For some time I've tried to get my Raspi3+ext SSD Setup working. Currently I do a complete Backup via dd towards a NAS drive. The Image sizes are rougly about 100 GB.
between 2GB und 100 GB the Backup always crashes.
The SSD ist connected directly to the USB Port without additional Powersupply.

So far I've had the following errors:
<pre class="brush: csharp">// Comment
watchdog: BUG: soft lockup - CPU#2 stuck fpr 23s: [kworker/2:0:3391]
....
watchdog: BUG: soft lockup - CPU#2 stuck fpr 23s: [ksoftirqd/1:18]
...
watchdog: BUG: soft lockup - CPU#2 stuck fpr 23s: [swapper/2:0]
....
rcu: $1-...0: (2ticks this >GP) idle=......02 softirq=12313/123123 fqs=18361
...
cpufrq: __target_index: failed to change cpu frequency: -22
....
watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [(d-logind):5635]
....
rcu sched kthread starved for 1233 jiffies
RCU grace period k-thread stack dump
</pre>


So far I've tested the following:

External Power Supply for ssd
Differen connector for SSD
USB Stick instead SSD
Backup from SSD to USB Stick
Backup from SSD to SD Card
Backup from USB Stick to SD Card

Everytime I get some kind of Kernel error, cpufreq error aso.

Next Step ist to test Raspbian instead of ubuntu.
Till now, raspbian was able to do a successfull backup to sd card in the same pi.
Next Step ist Backup to Network NAS.
If that works as well I'll try my ssd with Raspbian an Backup to NAS.

Actually, the only solution was a Raspbian native install on SSD. Everything works as perfect since then. qed.

Friday, April 3, 2020

Saturday, March 21, 2020

Raspi Ubuntu Raid 1

Raid 1 on ubuntu setup
https://ourcodeworld.com/articles/read/736/how-to-implement-a-software-raid-1-array-mirror-in-ubuntu-16-04


:/home/shares$ sudo mdadm --detail --scan

ARRAY /dev/md0 metadata=1.2 name=iOBroker1:0 UUID=ae338e6c:87421f87:56adea0f:e4e066c0

:/home/shares$ sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf

ARRAY /dev/md0 metadata=1.2 name=iOBroker1:0 UUID=ae338e6c:87421f87:56adea0f:e4e066c0







debugging and getting info:

~$ sudo mdadm  -E /dev/sdc

/dev/sdc:

   MBR Magic : aa55

Partition[0] :   4294967295 sectors at            1 (type ee)

:~$ cat /proc/mdstat

Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]

md0 : active raid1 sdb[1] sda[0]

      244066432 blocks super 1.2 [2/2] [UU]

      bitmap: 0/2 pages [0KB], 65536KB chunk



Statusanzeige des Software-RAIDs
~# mdadm -D /dev/mdN


sudo mdadm -D /dev/md0

 sudo cat /etc/mdadm/mdadm.conf


regular error with mount.cifs -2 can relate to version being

Try options vers=1.0  or vers=2.0


Diagnose: 
cat /proc/mdstat


https://www.thomas-krenn.com/de/wiki/Mdadm_checkarray

Monday, March 9, 2020

Raspi 4GB problem Ubuntu

https://askubuntu.com/questions/94542/how-can-i-repair-my-installation



In the meantime, developers can use a temporary workaround to enable USB on the 4GB RAM version. The temporary solution will consist in editing the file /boot/firmware/usercfg.txt to limit RAM to 3GB, as follows:
https://ubuntu.com/blog/roadmap-for-official-support-for-the-raspberry-pi-4

total_mem=3072

Saturday, March 7, 2020

Samba CIFS Share ubuntu raspi

https://www.elektronik-kompendium.de/sites/raspberry-pi/2007071.htm


Setup like there:


Error:
Systemfehler 67 aufgetreten.

Der Netzwerkname wurde nicht gefunden.

came from the wrong path in /etc/samba\smb.conf



Check Status of Samba Access:
sudo smbstatus

Usage: [OPTION...]
  -p, --processes                    Show processes only
  -v, --verbose                      Be verbose
  -L, --locks                        Show locks only
  -S, --shares                       Show shares only
  -N, --notify                       Show notifies
  -u, --user=STRING                  Switch to user
  -b, --brief                        Be brief
  -P, --profile                      Do profiling
  -R, --profile-rates                Show call rates
  -B, --byterange                    Include byte range locks
  -n, --numeric                      Numeric uid/gid
  -f, --fast                         Skip checks if processes still exist

Help options:
  -?, --help                         Show this help message
      --usage                        Display brief usage message

Common samba options:
  -d, --debuglevel=DEBUGLEVEL        Set debug level
  -s, --configfile=CONFIGFILE        Use alternate configuration file
  -l, --log-basename=LOGFILEBASE     Base name for log files
  -V, --version                      Print version
      --option=name=value            Set smb.conf option from command line



Restart:
 testparm && sudo systemctl restart smbd & sudo systemctl restart nmdb



https://superuser.com/questions/740375/how-to-login-to-network-share-when-microsoft-account-is-tied-to-windows-login


5.12.2021:
Move to Docker:
https://alexlubbock.com/convert-samba-docker

Friday, February 21, 2020

hdparm

Drives are not suspended correctly
Removed -S in /lib/udev/hdparm in Line 44 in front of -B

Thursday, February 20, 2020

Linux Console automount

Found here: https://askubuntu.com/questions/342188/how-to-auto-mount-from-command-line udisksctl Listing available devices: udisksctl status Mounting is done via: udisksctl mount -b /dev/sdf or udisksctl mount -p block_devices/sdf Unmounting is done via: udisksctl unmount -b /dev/sdf or udisksctl unmount -p block_devices/sdf The object-path can be found out by doing: udisksctl dump Object of type org.freedesktop.UDisks2.Block seem to be valid as object-patch, the /org/freedesktop/UDisks2/ prefix has to be cut from the path for udisksctl to accept them.



Sunday, December 8, 2019

IObroker in Homematic

Finally, after one year with Homematic IP and Homematic running via a Raspi and the ELV expansion module, I'll try to include more Raspis via iobroker into my automation.

Right now, the role or structure for accessing other Raspis GPios through Homematic IP is not clear to me. However I have the following idea:
Setup will be as follows:
- Rasberrymatic with ELV expansion and iobroker addin --> multihost slave
- Raspberry with some kind of ubuntu and iobroker installed --> multihost master



After some thinking I will got with an Iobroker installation on another PI only to test ioBroker.
Simulatneously I installed debmatic:
https://github.com/alexreinert/debmatic
on that pi and will try to link it to the first homematic as well as iobroker.


Next step with IOBroker on second PI was to install RPI extension as well as Vis.
RPI needs config in Instance Menu. If error with writing to certain block occurs,e.g.:
18309) Cannot evaluate: Filesystem 1K-blocks Used Available Use% Mounted on /dev/mmcblk0p2 7318052 4276676 2701448 62% / /1024


Then you probably need to uncheck the Raspberry Checkbox in RPI Config on IoBroker


Iobroker auf raspi 4 installieren
https://technikkram.net/2019/07/funktioniert-iobroker-auf-neuem-raspberry-pi-4-installieren



Io Broker move to new host:
https://forum.iobroker.net/topic/12365/raspberrypi-defekt-daten-retten/6


Break.
Iobroker went to new Raspi4 because of Memory consumption.
Debmatic ist out of discussion as well as running iobroker on the homematic pi.
Now I'm gonna link Iobroker on PI 1 to homematic on Pi 2 via Network.



Problems with radar2.plugin on Raspi3 Ubuntu:
 After reboot i get:
host.RelayPi12020-06-09 21:10:54.654errorCaught by controller[0]: at process._tickCallback (internal/process/next_tick.js:61:11) errno: 19, code: 'ENODEV', syscall: 'bind' }
host.RelayPi12020-06-09 21:10:54.653errorCaught by controller[0]: at process.nextTick (/opt/iobroker/node_modules/@abandonware/noble/lib/noble.js:60:24)
host.RelayPi12020-06-09 21:10:54.653errorCaught by controller[0]: at NobleBindings.init (/opt/iobroker/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:78:13)
host.RelayPi12020-06-09 21:10:54.652errorCaught by controller[0]: at Hci.init (/opt/iobroker/node_modules/@abandonware/noble/lib/hci-socket/hci.js:100:35)
host.RelayPi12020-06-09 21:10:54.652errorCaught by controller[0]: { Error: ENODEV, No such device


Issuing the following command:
sudo hciattach /dev/ttyAMA0 bcm43xx 921600

solves the error till next reboot.