Posts

USB sockets on routers to serve media

 I thought it would be terribly handy to have a USB flash drive with some files, eg my favourite movies, attached to my router. I couldn't understand why I couldn't see my  files, until I found a post suggesting that most routers only recognised FAT32. Well, no one has used that for  years I thought, what am I to do? So then I thught, ok, I can format a USB stick FAT32. Only... it's a 128GB USB stick and Windows 10 doesn't allow you to format FAT32 that large. Loads of comments on blogs where the command line was advocated saying that the windows command line also didn't work. So I tried in linux on the Raspberry Pi B+. It really was a simple as lsblk to identify which device, and then sudo mkfs.fat -F 32 /dev/sdb1 to format the USB stick. It took about 10 seconds. I then moved the USB stick to my computer with the mnovie files, copied them across, and put the USB stick in my router.  The router's admin page recognised the USB stick, and VLC showed the media...

Getting PARTUUID and mounting disks in linux

Scenario: modifying /etc/fstab to automatically mount devices (disks) on startup. Process is, find the PARTUUID (reference to the partition) and add details of where you want this mounted to the /etc/fstab file. Using a command link with no window manager, it's harder to cut and paste. So I have found how to use the linux commands to pipe output into other files, and in particular when you need to "sudo" before each fle.  Enter the "tee" command. Help from: https://www.scaler.com/topics/linux-append-to-file/ sudo blkid   (this one gives you the PARTUUID) then pipe to  sudo tee -a /etc/fstab (this one appends to the file) so altogether it looks like this  sudo blkid | sudo tee -a /etc/fstab Then to test that line in fstab it without needing to rebook: sudo mount  /mnt/point (where /mnt/point is the location you've put in fstab to mount the device) A response of  mount: (hint) your fstab has been modified... suggests it went ok. now cd to the mount point ...

Partitioning using command line and parted

Getting this error when trying to partition my disk Warning: The resulting partition is not properly aligned for best performance. Finding this out to get past this took more googling than it should (a hint in parted's response would have saved about 20 minutes here). parted will calculate proper alignment if you use percentages instead of sectors: (parted) mkpart Partition name? []? part1 File system type? [ext2]? ext4 Start? 0% End? 100% from: https://askubuntu.com/questions/932545/the-resulting-partition-is-not-properly-aligned-for-best-performance

Raspberry PI fun with a second hand B+... setting up wifi

Image
 I wasn't sure what I wanted it for, but I wanted it. So I got it, nice n cheap off ebay. I'm thinking it will make a nice very low powered Urbackup server to replace the beast that I only turn on occasionally.  It's a model 1 B+ and the kindly owner included a wifi USB dongle. The installed original Raspbian from 2014 was slow in terms of desktop responsiveness, but riskos is lovely and slick. So it's still useful hardware.  Anyway, I've gone for the "lite" version of the latest Raspian. It has booted fine and I've got the wifi dongle going by doing this: from here https://leoncode.co.uk/articles/enabling-wifi-raspberry-pi-command-line/ don't forget it's  ip addr show  to see network device IPs. Now trying to port forward 22 to my Raspberry pi and I get this when trying to ssh in So I guess I've not enabled ssh. That's to come next...

Starting a service or application at startup

 Even though urbackup instructions say to put the following line into your /etc/rc.local file: Add   /usr/bin/urbackupsrv run –daemon   to your   /etc/rc.local   to start the UrBackup server on server start-up. it seems Arch uses systemd, so the thing to do is put your command in   /etc/systemd/system   You may find it already exists: sudo systemctl list-unit-files --type-service   Here's the reference if you need to create one: https://unix.stackexchange.com/questions/471824/what-is-the-correct-substitute-for-rc-local-in-systemd-instead-of-re-creating-rc https://www.howtogeek.com/687970/how-to-run-a-linux-program-at-startup-with-systemd/    

Error key "xxx...xxx" could not be looked up remotely on ArchLinux

 Here is the answer that worked for me, from: https://superuser.com/questions/1675153/error-key-xxx-xxx-could-not-be-looked-up-remotely-on-archlinux pacman-key --init pacman-key --populate archlinux   Then tried  pacman -Sy sudo again and it was fine!

Getting Arch to boot after install (Syslinux)

 So, it installed on a new hdd. Faster this time as it was a newer drive. BUT! It didn't work. Closer inspection showed that it tried to mount the wrong partition: /dev/sda3 But I only have 2 partitions as I'm using the MBR (not an UEFI compatible motherboard): /dev/sda1 (swap) and  /dev/sda2 (linux) Retracing my steps through the install guide: https://wiki.archlinux.org/title/installation_guide and then onto the Syslinux page: https://wiki.archlinux.org/title/Syslinux I find this line: Warning: The syslinux-install_update script sets a default root partition that possibly will not match your particular system. It is important to point Syslinux to the correct root partition by editing /boot/syslinux/syslinux.cfg , or the OS will fail to boot. "Oh, I don't think I edited that file before" I say to myself.  Sure enough looking in there, the references are to /dev/sda3. Changing them to /dev/sda2 meant that on a restart the system booted perfectly. Niiiice.