Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!husc6!bu-cs!mit-eddie!genrad!decvax!decwrl!sun!gorodish!guy
From: guy%gorodish@Sun.COM (Guy Harris)
Newsgroups: comp.unix.questions
Subject: Re: S5 file system magic number (was (Re: Pixel/80 trashed fs)
Message-ID: <10848@sun.uucp>
Date: Mon, 29-Dec-86 02:12:56 EST
Article-I.D.: sun.10848
Posted: Mon Dec 29 02:12:56 1986
Date-Received: Mon, 29-Dec-86 18:36:58 EST
References: <718@cooper.UUCP> <145@piaget.UUCP> <125@tdi2.UUCP>
Sender: news@sun.uucp
Lines: 15
Summary: Old UNIX file systems didn't have a magic number, so it's treated as optional.

> ...but I noted later that sVr2 has a magic number in the superblock.
> ...My question:  if there is a magic number there, why doesn't mount() look
> for it and reject file systems with bad magic numbers?

Because the magic number wasn't in the original V7 file system, used until
S5.  S5 added a magic number to the V7 superblock, but only to distinguish
512-byte-block file systems from 1024-byte-block file systems.  Since the
original V7 file system used 512-byte blocks, any file system with an
unknown magic number was treated as a 512-byte-block file system.
Requiring a valid magic number would have required that the root file
system be fixed before an S5 kernel was booted on it, unless the initial
mount of the root file system was treated as a special case, and required
that a file system be fixed before it was mounted by that kernel, unless a
special option were added to the "mount" system call.  I figure they just
decided this was too much trouble.