Sunday, 28 December 2025

NFS - Network File System

Network File System (NFS) is used to mount external sources of files between Linux/Unix servers.

Nowadays, I think most people use SAMBA (SMB) as that also allows Windows to join the club, but I decided to try NFS (again).

I used to work with NFS back in the past, but it seems to still be viable.

On the server

We will be sharing the directory /mnt/raid.

I've edited the file /etc/exports.d/raid.exports to contain2:

/mnt/raid 192.168.2.0/24(rw,sync,no_root_squash)
rw
read and write access
sync
is the default, makes certain new requests only get a reply when changes have been committed to stable storage
no_root_squash
By default root files are re-mapped to nobody, to prevent write-access etc. in my case, I wish to edit files using root. I don't mind the security consequences very much in my home situation

To apply changes to this file, run "exportfs -ra" or restart the NFS server.

Start services:

# systemctl start nfs-server.service
# systemctl enable nfs-server.service

On the client

To view all mountable directories of a certain server, try this:

# mount | grep raid
watson:/mnt/raid on /mnt/raid type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,fatal_neterrors=none,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.2.1,local_lock=none,addr=192.168.2.6)

Or of course try "cat /proc/mounts".

Then, on the client, mount the directory:

# mount -t nfs -o vers=4 watson:/mnt/raid /mnt/raid

Surprisingly, I did not have to actually change any configuration of the NFS service.

Works surprisingly well.

References

[1] Fedora Server User Documentation - File sharing with NFS – Installation
https://docs.fedoraproject.org/en-US/fedora-server/services/filesharing-nfs-installation/
[2] My Blog - My Current MDADM Setup
https://randomthoughtsonjavaprogramming.blogspot.com/2024/09/my-current-mdadm-setup.html

Friday, 12 December 2025

Git: Deleting old local branches

Just looking at old local branches. They tend to proliferate, especially if you have a release cadence.

To list the local branches (the default), or list the branches according to a pattern, see the two examples directly below.

git branch
git branch --list "V2022*"

Small explanation of the output of the command:

  • existing branches are listed
  • the current branch will be highlighted in green and marked with an asterisk
  • any branches checked out in linked worktrees will be highlighted in cyan and marked with a plus sign

I'm usually only interested in local branches, but "-r" shows remote-tracking branches and "-a" shows both remote and local branches, if you're interested.

Removing branches

git branch -D `git branch --list "V2022*"`

Bear in mind that branches that are used by a worktree cannot be deleted. Remove the worktree first.

Actually, I really like that behaviour.

Checking old branches

Apparently you can sort the list of branches based on last comitterdate.

git branch --sort=-committerdate # DESC

In the example above, you'll see branches that have been committed to recently at the top.

Finding a commit

This is nice, you can find which branches contain a certain commit quickly.

git branch --list --contains 089aafb331a08d19ed805fff6fea3846776980a0

Unfortunately, we're currently using git as a local repo, and svn remote, so there's a disconnect between commit hashes.

References

Git - git branch documentation
https://git-scm.com/docs/git-branch
StackOverflow - Can you delete multiple branches in one command with Git?
https://stackoverflow.com/questions/3670355/can-you-delete-multiple-branches-in-one-command-with-git