Page 13 of 20

#181 Re: General Raspberry Pi stuff

Posted: Mon Mar 29, 2021 11:49 am
by Neal
Posted for reference.

Finally getting around to using my Sunbow SSD for the RPi4.

Just in the process of copying files over using the USB-Boot Script here: https://www.raspberrypi.org/forums/view ... c25e158914

Stopped, pinhole, LMS, Portainer and Docker service first then updated the pi in the usual manner and went for the full upgrade to include the new firmware:
sudo apt-get update
sudo apt full-upgrade
sudo reboot

Then sudo bash boot-usb

To get boot-usb onto the Pi I downloaded on to the Mac first and used SCP to copy it over:
sudo scp ~/Downloads/usb-boot/usb-boot pi@192.168.1.3:/home/pi/usb-boot

Its currently copying and taking its time! And I'm getting hate because DNS is down and I can't be bothered to set DNS manually for each phone, iPad etc :D

#182 Re: General Raspberry Pi stuff

Posted: Mon Mar 29, 2021 3:37 pm
by jack
Neal wrote: Mon Mar 29, 2021 11:49 am ...
Its currently copying and taking its time! And I'm getting hate because DNS is down and I can't be bothered to set DNS manually for each phone, iPad etc
8) I know the feeling...

Scheduled downtime is important for engineering upgrades and maintaining quality of service! Sell the positives!

#183 Re: General Raspberry Pi stuff

Posted: Mon Mar 29, 2021 5:04 pm
by Neal
Well it started to a get a bit desperate, 2.5hrs in and it was still going......hmmmm, can't be right so aborted the usb-boot script and started digging, after a lot of disappearing down blind rabbit holes on the internet I decided to manually rsync the SD to the SSD with:

sudo rsync -aAXHv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /mnt

This kicked off fine and as I watched the files scroll by I noticed it was copying my NAS drive and all my other mounts to the SSD Doh! :roll:

Abort again, format the SSD, unmount everything and re-run usb-boot...it finished in 5 mins and I was up and running on the SSD.

The USB-BOOT script is good but it doesn't show you progress during the copy so I had no-idea the mounts where being copied....live 'n' learn!

#184 Re: General Raspberry Pi stuff

Posted: Sat Sep 04, 2021 12:05 pm
by jack
Really good article about SD cards; problems, solutions, what to look for etc.

https://picockpit.com/raspberry-pi/moni ... pberry-pi/

I had problems with my Unifi RPi, so I checked the SD card using:

Code: Select all

sudo fsck -fvn /dev/mmcblk0p2 | tee ~/fsck_p2
Also did the same for p1. P2 showed a bunch of errors, like a lot. You can't run fsck on a mounted filesystem, e.g. the system partition, and that can't be unmounted, so fsck has to be set to run after a reboot.

This is done by adding a command to the bootloader command line which when seen will cause fsck to repair the disk prior to it being mounted:

Code: Select all

sudo nano /boot/cmdline.txt
...and add the string "fsck.mode=force" into the SINGLE LINE command line. Do not include a line break and make very sure you get this right! Note that "fsck.repair=yes" is there by default and basically answers "yes" to any question during the process.
The old method of adding a file called /forcefsck at the root is deprecated and should not be used.

Code: Select all

Sep  4 11:49:06 UniFiController systemd-fsck[136]: Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system.
After a reboot, a read-only fsck shows no errors! Phew.

However, the Unifi DB may still have issues, so I repaired the MongoDB by:

Code: Select all

sudo service unifi stop
sudo mongod --dbpath /usr/lib/unifi/data/db --smallfiles --logpath /usr/lib/unifi/logs/server.log --repair
sudo chown -R unifi:unifi /usr/lib/unifi/logs/server.log
sudo chown -R unifi:unifi /usr/lib/unifi/data/db
sudo service unifi start
Note that just doing a reboot without first orderly shutting down stuff writing to the SD card, e.g. Unifi (as it uses MongoDB), can damage the filesystem.

You can check when fsck was last used on a filesystem by using tune2fs, e.g.

Code: Select all

sudo tune2fs -l /dev/mmcblk0p2 | grep checked
and you can check the systemd log to confirm it ran during boot by using:

Code: Select all

sudo cat /var/log/syslog | grep fsck
...
Sep  4 15:05:07 UniFiController kernel: [    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=PARTUUID=74bf6075-02 rootfstype=ext4 elevator=deadline fsck.repair=yes fsck.mode=force rootwait quiet splash plymouth.ignore-serial-consoles
Sep  4 15:05:07 UniFiController systemd-fsck[125]: e2fsck 1.44.5 (15-Dec-2018)
Sep  4 15:05:07 UniFiController systemd-fsck[125]: Pass 1: Checking inodes, blocks, and sizes
Sep  4 15:05:07 UniFiController systemd-fsck[125]: Pass 2: Checking directory structure
Sep  4 15:05:07 UniFiController systemd-fsck[125]: Pass 3: Checking directory connectivity
Sep  4 15:05:07 UniFiController systemd-fsck[125]: Pass 4: Checking reference counts
Sep  4 15:05:07 UniFiController systemd-fsck[125]: Pass 5: Checking group summary information
Sep  4 15:05:07 UniFiController systemd-fsck[125]: rootfs: 121152/943488 files (0.2% non-contiguous), 3089183/3822976 blocks
Sep  4 15:05:07 UniFiController systemd-fsck[254]: fsck.fat 4.1 (2017-01-24)
Sep  4 15:05:07 UniFiController systemd-fsck[254]: /dev/mmcblk0p1: 282 files, 98419/516190 clusters
Sep  4 15:05:36 UniFiController systemd[1]: systemd-fsckd.service: Succeeded.
...

#185 Re: General Raspberry Pi stuff

Posted: Sun Nov 14, 2021 8:07 pm
by jack
Environmental monitoring!!!

I want to use one of my older spare pi cards as an office environment monitor and thought of getting one of these hats:

https://thepihut.com/products/enviro-fo ... 6689887294

...and feeding the output to IFTTT or similar.


Anyone had any experience with these?

#186 Re: General Raspberry Pi stuff

Posted: Wed Dec 15, 2021 12:13 pm
by jack
Stupidly good deals on SanDisk microSD cards:

e.g. 32GB TWIN PACK for £11 delivered. 64GB TWIN PACK for £15. 10 year warranty on these.

Lots of options. The twin pack deal means you get the second card for peanuts.

There's also the SanDisk Extreme which is the latest iteration - probably way over the top for a Pi (maybe not the 4) but comes with a lifetime warranty (typically 30 years).

SanDisk also have recovery software options specifically for their cards: https://lc-tech.com/sandisk-rescuepro-a ... ro-deluxe/

#187 Re: General Raspberry Pi stuff

Posted: Wed May 11, 2022 2:49 pm
by jack
Just installed Docker on the Synology DS218+ SAN in my office. Adding the UniFi Controller to that, so it'll run in the SAN (which spends 99% of it's time doing nothing), so that'll free up a RPi. Being a Unix box, you can run Portainer.io on it too...

This has the added advantage that the UniFi Controller backups will be saved to the SAN by default without having to mess with cron jobs, rcopy & TFTP etc. so much simpler.

I see that you can run Pi-hole from a Docker container on a Synology box too, so that could free up yet another RPi...

#188 Re: General Raspberry Pi stuff

Posted: Wed May 11, 2022 5:40 pm
by pre65
jack wrote: Wed May 11, 2022 2:49 pm Just installed Docker on the Synology DS218+ SAN in my office. Adding the UniFi Controller to that, so it'll run in the SAN (which spends 99% of it's time doing nothing), so that'll free up a RPi. Being a Unix box, you can run Portainer.io on it too...

This has the added advantage that the UniFi Controller backups will be saved to the SAN by default without having to mess with cron jobs, rcopy & TFTP etc. so much simpler.

I see that you can run Pi-hole from a Docker container on a Synology box too, so that could free up yet another RPi...
I don't understand any of that. :? :)

#189 Re: General Raspberry Pi stuff

Posted: Wed May 11, 2022 5:47 pm
by andrew Ivimey
Wonderful isn't it!

#190 Re: General Raspberry Pi stuff

Posted: Fri May 13, 2022 7:13 pm
by Mike H
Image

#191 Re: General Raspberry Pi stuff

Posted: Fri May 13, 2022 9:00 pm
by jack
To be fair, this thread is really Ed, Neil, Nick, myself and any other RPi/Unix folk doing nerdy stuff...

Speaking of Neil, he's not been around for a month now...

#192 Re: General Raspberry Pi stuff

Posted: Fri May 13, 2022 10:19 pm
by andrew Ivimey
Don't blame him - snigger

#193 Re: General Raspberry Pi stuff

Posted: Fri May 13, 2022 11:13 pm
by Greg
jack wrote: Fri May 13, 2022 9:00 pm To be fair, this thread is really Ed, Neil, Nick, myself and any other RPi/Unix folk doing nerdy stuff...

Speaking of Neil, he's not been around for a month now...
Maybe because he doesn’t recognise his misspelt name😉

#194 Re: General Raspberry Pi stuff

Posted: Sat Jun 04, 2022 1:24 pm
by Neal
Im still here!

Warning: If running Buster and PiHole in a container do not try to update PiHole it will lead to a whole world of pain:

https://github.com/pi-hole/docker-pi-hole/issues/1048

I've had to delete PiHole until I can get some time to fix the issue. Reverting back to an older version as in the link didn't work for me but I've run out of time and patience for today.... aaarrrrgh!

#195 Re: General Raspberry Pi stuff

Posted: Sun Jun 05, 2022 11:33 am
by Neal
Got there in the end. The issue is the update to Docker running on Buster with an older libseccomp2 library as stated here: https://hub.docker.com/r/pihole/pihole

In the end it is a simple fix, check what version of libseccomp2 your are running:

apt list libseccomp2 -a

If its <2.5 you have a choice of either a whole system update from Buster to Bullseye or update via Backports...I went with update via Backports detailed under option 2 here: https://docs.linuxserver.io/faq

The steps are:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138

echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee -a /etc/apt/sources.list.d/buster-backports.list

sudo apt update

sudo apt install -t buster-backports libseccomp2

Check the version again and if OK install the PiHole container...

It seems every time I update PiHole I run into some sort of issue, I may move it to a standalone RPi to avoid some of these issues going forward.