Posts

Dual boot Linux and windows (separate disks) using Grub2 SHOULDN'T BE THIS TRICKY

ISSUE: has the grub menu disappeared? does your system boot straight into windows? Explanation Each disk has its own OS, and efI bootloader 1) Linux bootlader (xubuntu) is sda1 2) Windows 10 bootloader is sdb2 Now, the grub2 files that matter are: /etc/default/grub in which you need to make sure  GRUB_TIMEOUT_STYLE=menu and doesn't say  GRUB_TIMEOUT_STYLE=hidden This makes sure you see the grub menu and /etc/grub.d/40_custom (see  https://linuxvox.com/blog/grub-config-file-ubuntu /) where we add our extra menu option for Windows 10 (see https://askubuntu.com/questions/661947/add-windows-10-to-grub-os-list ) viz: type  lsblk  to identify your windows EFI partition, then blkid /dev/sda1   (with the partition /dev name) to find the UUID of the EFI (call that  YOUR_WIN_EFI_UUID) then FINALLY, the code to add in the  /etc/grub.d/40_custom\ is menuentry 'Windows 10' { search --fs-uuid --no-floppy --set=root YOUR_WIN_EFI_UUID chainloader (${root}...

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!