Next: , Previous: , Up: System Configuration   [Contents][Index]


6.2.2 File Systems

The list of file systems to be mounted is specified in the file-systems field of the operating system’s declaration (see Using the Configuration System). Each file system is declared using the file-system form, like this:

(file-system
  (mount-point "/home")
  (device "/dev/sda3")
  (type "ext4"))

As usual, some of the fields are mandatory—those shown in the example above—while others can be omitted. These are described below.

Data Type: file-system

Objects of this type represent file systems to be mounted. They contain the following members:

type

This is a string specifying the type of the file system—e.g., "ext4".

mount-point

This designates the place where the file system is to be mounted.

device

This names the “source” of the file system. By default it is the name of a node under /dev, but its meaning depends on the title field described below.

title (default: 'device)

This is a symbol that specifies how the device field is to be interpreted.

When it is the symbol device, then the device field is interpreted as a file name; when it is label, then device is interpreted as a partition label name; when it is uuid, device is interpreted as a partition unique identifier (UUID).

The label and uuid options offer a way to refer to disk partitions without having to hard-code their actual device name.

flags (default: '())

This is a list of symbols denoting mount flags. Recognized flags include read-only, bind-mount, no-dev (disallow access to special files), no-suid (ignore setuid and setgid bits), and no-exec (disallow program execution.)

options (default: #f)

This is either #f, or a string denoting mount options.

needed-for-boot? (default: #f)

This Boolean value indicates whether the file system is needed when booting. If that is true, then the file system is mounted when the initial RAM disk (initrd) is loaded. This is always the case, for instance, for the root file system.

check? (default: #t)

This Boolean indicates whether the file system needs to be checked for errors before being mounted.

create-mount-point? (default: #f)

When true, the mount point is created if it does not exist yet.

The (gnu system file-systems) exports the following useful variables.

Scheme Variable: %base-file-systems

These are essential file systems that are required on normal systems, such as %devtmpfs-file-system (see below.) Operating system declarations should always contain at least these.

Scheme Variable: %devtmpfs-file-system

The devtmpfs file system to be mounted on /dev. This is a requirement for udev (see udev-service).

Scheme Variable: %pseudo-terminal-file-system

This is the file system to be mounted as /dev/pts. It supports pseudo-terminals created via openpty and similar functions (see Pseudo-Terminals in The GNU C Library Reference Manual). Pseudo-terminals are used by terminal emulators such as xterm.

Scheme Variable: %shared-memory-file-system

This file system is mounted as /dev/shm and is used to support memory sharing across processes (see shm_open in The GNU C Library Reference Manual).

Scheme Variable: %binary-format-file-system

The binfmt_misc file system, which allows handling of arbitrary executable file types to be delegated to user space. This requires the binfmt.ko kernel module to be loaded.

Scheme Variable: %fuse-control-file-system

The fusectl file system, which allows unprivileged users to mount and unmount user-space FUSE file systems. This requires the fuse.ko kernel module to be loaded.


Next: , Previous: , Up: System Configuration   [Contents][Index]