From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) Subject: Re: VFS - Where can I read about it? Date: 22 May 1992 20:19:41 GMT
In article <JES.92May22124113@mbio.med.upenn.edu> jes@mbio.med.upenn.edu (Joe Smith) writes:
>
>What happens with mkfs & fsck? Can these be written using standard
>Unix system calls (through the VFS, and thus are indifferent to fs
>changes), or will we need a separate executable (or switch) for each
>fs? Are we still without source for fsck and if so, will the old one
>work with a 30-char-filename fs? How about mount?
mkfs/fsck will have to be written especially for each filesystem: these
are purely user-level programs which operate directly on the block
device. mkfs is usually very simple to write: the only thing needed is
to set up an empty filesystem so that the kernel can then start
operating on it and fill it with data, but fsck is a very complicated
program, and getting it right is not easy (the current linux fsck is not
very good, and does only a half-hearted job which isn't good enough in
many situations)
As to mount(), this is a kernel primitive, and is part of the filesystem
drivers. Mount is given a extra parameter that indicates which type of
filesystem to mount (the name of the filesystem type), and then
"bootstraps" the filesystem information by filling in the appropriate
inode operations for the root inode of the new filesystem etc.
So to mount a DOS filesystem (if/when it is finally implemented), you'd
use something like "mount /dev/hdb3 /local DOS". The current mount just
gives a NULL for the filesystem name, which the kernel takes to be the
default minix filesystem.
Linus