Just before I read this my OH complained about the adverts that appear on Youtube on her elderly iPad. I use uBlock Origin on my PC and never see them at all. Anyway, I thought to myself '
I've got a Raspberry Pi in need of use, so I'll give pi-hole a go.'
When I got the Pi hooked up I found that the version of Raspbian on it is no-longer supported so I decided to upgrade it. My Pi is an early model B which I originally set up to run from a USB stick. Actually, that's not quite correct, it boots from the SD card and then subsequently runs from the USB stick. It is apparently possible to run the newer models from a USB stick completely.
Of course it was some years ago that I set this up and couldn't remember the details of how I'd done it originally.
I found that I needed to:
Copy the latest (Buster) image onto both the CD card and USB stick, then
Get the PARTUUIDs of the boot partition of the SD card and the rootfs partition of the HDD with the
blkid command on the Linux PC.
Then:
Edit /boot/cmdline/txt on the SD CARD and change the PARTUUID to match the PARTUUID of the rootfs partition of the HDD.
And then:
Edit /etc/fstab on the HDD and change the PARTUUIDs to match the PARTUUIDs of the boot partition of the SD Card and the rootfs partition of the HDD.
Then I ran into the first problem, my Debian install didn't recognise
blkid although the files were there and the package manager showed it as having been installed. Re-installing it fixed that.
I duly carried out the PARTUUID edits and then booted up the Pi. It started up but was really slow and as I suspected still running from the SD card. Just too slow.
I looked a bit more closely and realised that I had missed the fact that the 2 partitions on the SD card had the same PARTUUIDs as those on the USB stick (Doh!) and therefore the Pi would have just continued to run from the SD card. One might think that that would be obvious given that the images are identical on both media, but I understand from a little searching that on previous versions that this was not the case. I admit to knowing little about PARTUUIDs but can only guess that in earlier versions the install routine would generate new ones.
So, how to change the PARTUUIDs on one set of media?
A little searching led me to a BASH script to do that, so again I booted up the Pi and found that it was now running properly from the USB stick.
And not only that but the new version of Raspbian now has VNC server set up and ready to go. That's saved me the pain of finding out (again) how to set it up to start each time at boot.
Installing pi-hole was easy and then I proceeded to change the DNS settings on OH's iPad. I started the Youtube app and then chose a video at random. Oh no, an advert
Apparently blocking Youtube adverts is like whack-a-mole, yet uBlock Origin manages.
I think I'll have to see if there's an ad-blocker from the Apple store that will run on an old iPad
RC