About

Humboldt Solutions Ltd. offers custom software development and consultancy.
View Adrian Cox's profile on LinkedIn

Archives

fsync() Across Platforms

When an application writes a file, the data does not become permanent immediately. The write operation first moves the data into the operating system cache in RAM, where it is vulnerable to system crashes and loss of power. The second step is the transfer to the hard disk, which normally has write caching enabled. The disk acknowledges the data straight away, but keeps it in the disk write cache which is still volatile memory. The data is now safe from system crash1, but is not safe from loss of power. On a modern disk, this may be 16MB or more of data in unknown state.

As performance enhancements in ext4 have made committing data to disk a contentious issue, I’ve written a note on how different platforms handle data consistency.

Continue reading fsync() Across Platforms

  1. Ignoring some worst case scenarios.

A Working TFTP Server for Multi-Homed Linux Systems

Linux machines with multiple network interfaces are unreliable as TFTP servers. This issue has been outstanding for a long time, without any resolution. The patch attached to the Debian bug fixes the problem for an old release of tftpd-hpa, but does not apply cleanly to recent releases.

Recent releases of dnsmasq contain a TFTP server which does not have this problem. While this doesn’t solve every case, it provides a tidy solution for a machine which provides BOOTP and TFTP services to several subnets.

Continue reading A Working TFTP Server for Multi-Homed Linux Systems

Running Linux on a PCI Add-in Card: Hardware

Every so often I see someone attempting to run the Linux kernel on a PCI add-in card. I’ve done this myself, but there are a lot of complications. This article covers the hardware, and a second article will cover software. Don’t take this as chipset selection advice: before you commit to hardware double-check both the errata and the availability of the silicon.

Continue reading Running Linux on a PCI Add-in Card: Hardware

In the Year 2038

I have now seen my first ever year 2038 bug. An embedded Linux system that was installed two years ago became unable to acquire a network address by DHCP. The machine did not require an accurate clock, and nobody had initialised its battery-backed real-time clock. Once installed, it had started counting forward from 1st January [...]

Slow Reboots of NFS Server

After several years of use, the server for my development machines developed a problem. If I rebooted the machine without an internet connection, it would pause for several minutes while starting the NFS service.

The Linux NFS server keeps track of status in several files. Whenever a client mounts a filesystem, the server records this in /var/lib/nfs/rmtab. [...]