Special Filesystems

While network and disk-based filesystems enable the user to handle information stored outside the kernel, special filesystems may provide an easy way for system programs and administrators to manipulate the data structures of the kernel and to implement special features of the operating system. Table 12-8 lists the most common special filesystems used in Linux; for each of them, the table reports its mount point and a short description.

Notice that a few filesystems have no fixed mount point (keyword "any" in the table). These filesystems can be freely mounted and used by the users. Moreover, some other special filesystems do not have a mount point at all (keyword "none" in the table). They are not for user interaction, but the kernel can use them to easily reuse some of the VFS layer code; for instance, we'll see in Chapter 19 that, thanks to the pipefs special filesystem, pipes can be treated in the same way as FIFO files.

Table 12-8. Most common special filesystems

Name

Mount point

Description

bdev

none

Block devices (see Chapter 13)

binfmt_misc

any

Miscellaneous executable formats (see Chapter 20)

devfs

/dev

Virtual device files (see Chapter 13)

devpts

/dev/pts

Pseudoterminal support (Open Group's Unix98 standard)

pipefs

none

Pipes (see Chapter 19)

proc

/proc

General access point to kernel data structures

rootfs

none

Provides an empty root directory for the bootstrap phase

shm

none

IPC-shared memory regions (see Chapter 19)

sockfs

none

Sockets (see Chapter 18)

tmpfs

any

Temporary files (kept in RAM unless swapped)

Special filesystems are not bound to physical block devices. However, the kernel assigns to each mounted special filesystem a fictitious block device that has the value 0 as major number and an arbitrary value (different for each special filesystem) as a minor number. The get_unnamed_dev( ) function returns a new fictitious block device identifier, while the put_unnamed_dev( ) function releases it. The unnamed_dev_in_use array contains a mask of 256 bits that record what minor numbers are currently in use. Although some kernel designers dislike the fictitious block device identifiers, they help the kernel to handle special filesystems and regular ones in a uniform way.

We see a practical example of how the kernel defines and initializes a special filesystem in the later section Section 12.4.1.

Continue reading here: Filesystem Type Registration

Was this article helpful?

+1 0