50 years in filesystems: 1984 BSD FFS
blog.koehntopp.info
blog.koehntopp.info
* https://www.youtube.com/watch?v=1BbMBdGPoHM
* https://en.wikipedia.org/wiki/Marshall_Kirk_McKusick
In the article the classic The Design and Implementation of the 4.4BSD Operating System is mentioned:
* https://www.goodreads.com/book/show/5767.The_Design_and_Impl...
See also the more recent The Design and Implementation of the FreeBSD Operating System:
* https://www.goodreads.com/book/show/112388.The_Design_and_Im...
* https://web.archive.org/web/20170213221835/http://www.nobius...
For example: It's fairly well recorded that FreeBSD switched to Mewburn rc, which it got from NetBSD, in 2002. But what isn't so well recorded, that one can only really find out from the version control history, is that this was actually a regression in one aspect, as FreeBSD had some years earlier finally got rid of an old backwards-compatibility mechanism, that Mewburn rc promptly restored.
* http://jdebp.info/FGA/rc.local-is-history.html
One of the interesting things about FreeBSD et al. is that one can reach back decades in version control and look at this stuff.
Another example: Linux people often talk about BSD-style options to their "ps" command. But they actually aren't, and BSD has not documented any such things for the entire lifetime of any "ps" command on Linux. Inspecting BSD version control history one can find where the BSD "ps" switched to getopt(3) and changed its manual, and it was in 1990, a year before Linux even existed.
Sure, but I'd say even more that SVR4 was the anti-BSD. AT&T should have accepted that BSD rocked and adopted it.
Michael K. Johnson was an undergraduate at St. Olaf College at the time, simply not old enough to have had "years of experience" with commercial Unices. The reality is that this was not written by a bunch of old hands with tonnes of professional Unix experience. Branko Lankester was at the University of Amsterdam.
There's also a series of videos from classes McKusick taught. Back in the 90s/early 2000s I attended some viewings of these at the apartment of some High Voltage Software employees back in IL. They'd convinced their employer to foot the bill on buying the full VHS set (I think it was $1k/tape), and hosted a bunch of viewing "parties".
Whenever McKusick had to explain some virtual memory details, he'd have vi as the running process and some user started up emacs, then he'd walk through all the minutia of paging and swap. It was quite amusing at the time, he was a master at throwing fuel on the emacs vs. vi religious wars.
I was never a huge freebsd fan, but these books were very well done and McKusick a tremendous asset to that community.
The dump program, once the FFS was deployed, had not been modified to backup the last fragment of a file (because it was smaller, possibly than 4k). There was a disk crash on the VAX with the BSD source code and the disk company (Ampex, I think) came out and meticulously scrapped the bits off the disk, so CSRG could recovered the source code. There was no complete backup of it anywhere else.
That was a fun, early lesson in "test your backups".
https://en.wikipedia.org/wiki/DECstation
Also, per recent discussion on the NetBSD tech-kern mailing list, it is better to describe flock as per open since it is not actually tied to the file descriptor itself. The article mentions issues with dup and thinking about it as per descriptor leads to surprises.
This is still a reasonable file system design today via slightly modernized versions of FFS or basic ext2. fsck times are not that bad with SSDs.
It was more the opposite IME (90s-era linux): fsck after a crash was boring and time-consuming, and we grew increasingly impatient as capacities grew.
Prior to having a journaling filesystem and log replay @ reboot/mount, the filesystem was often plain conservatively implemented using methods like two-phase-commits and arguably kept more consistent due to the repeated exhaustive checking process at every dirty mount.
We went through a phase of putting a lot of trust into the hardware keeping things consistent/no-bitrot and more or less assuming everything was fine after a journal replay. Only relatively recently did we start getting checksums of metadata to detect such failures, that's still not a universal feature.
The lack of frequent fscks creates opportunity for hidden corruption from either bugs or hardware errors to go unnoticed until it's far too late to recover from... There's a reason filesystems tend to have a max mount count before a fsck is forced, even if not dirty.
Scrubs / checks / etc for online consistency check.
Journaling did take off in a big way, with NTFS, HFS+, ext3, etc. supporting it. This mostly removed the long fsck on most modern operating systems.
Of course, traditional filesystems + journaling are now rapidly being replaced by CoW filesystems.
Log-structured and CoW are very closely related.
I later manually did the needful to get XFS working as it was faster on deletes, iirc.
https://www.usenix.org/system/files/atc19-jaffer.pdf
It may have improved since then, who knows.