{
    "content": [
        {
            "type": "text",
            "text": "# systemd.mount(5) (man)\n\n**Summary:** systemd.mount - Mount unit configuration\n\n**Synopsis:** mount.mount\n\n## See Also\n\n- systemd(1)\n- systemctl(1)\n- systemd-system.conf(5)\n- systemd.unit(5)\n- systemd.exec(5)\n- systemd.kill(5)\n- systemd.resource-control(5)\n- systemd.service(5)\n- systemd.device(5)\n- proc(5)\n- mount(8)\n- systemd-fstab-generator(8)\n- systemd.directives(7)\n- systemd-mount(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (37 lines)\n- **AUTOMATIC DEPENDENCIES** (1 lines) — 2 subsections\n  - Implicit Dependencies (15 lines)\n  - Default Dependencies (19 lines)\n- **FSTAB** (19 lines) — 12 subsections\n  - x-systemd.requires= (28 lines)\n  - x-systemd.requires-mounts-for= (4 lines)\n  - x-systemd.device-bound (5 lines)\n  - x-systemd.automount (3 lines)\n  - x-systemd.idle-timeout= (3 lines)\n  - x-systemd.device-timeout= (7 lines)\n  - x-systemd.mount-timeout= (9 lines)\n  - x-systemd.makefs (12 lines)\n  - x-systemd.growfs (8 lines)\n  - x-systemd.rw-only (24 lines)\n  - nofail (5 lines)\n  - x-initrd.mount (9 lines)\n- **OPTIONS** (64 lines)\n- **SEE ALSO** (4 lines)\n- **NOTES** (6 lines)\n\n## Full Content\n\n### NAME\n\nsystemd.mount - Mount unit configuration\n\n### SYNOPSIS\n\nmount.mount\n\n### DESCRIPTION\n\nA unit configuration file whose name ends in \".mount\" encodes information about a file system\nmount point controlled and supervised by systemd.\n\nThis man page lists the configuration options specific to this unit type. See systemd.unit(5)\nfor the common options of all unit configuration files. The common configuration items are\nconfigured in the generic [Unit] and [Install] sections. The mount specific configuration\noptions are configured in the [Mount] section.\n\nAdditional options are listed in systemd.exec(5), which define the execution environment the\nmount(8) program is executed in, and in systemd.kill(5), which define the way the processes\nare terminated, and in systemd.resource-control(5), which configure resource control settings\nfor the processes of the service.\n\nNote that the options User= and Group= are not useful for mount units. systemd passes two\nparameters to mount(8); the values of What= and Where=. When invoked in this way, mount(8)\ndoes not read any options from /etc/fstab, and must be run as UID 0.\n\nMount units must be named after the mount point directories they control. Example: the mount\npoint /home/lennart must be configured in a unit file home-lennart.mount. For details about\nthe escaping logic used to convert a file system path to a unit name, see systemd.unit(5).\nNote that mount units cannot be templated, nor is possible to add multiple names to a mount\nunit by creating additional symlinks to it.\n\nOptionally, a mount unit may be accompanied by an automount unit, to allow on-demand or\nparallelized mounting. See systemd.automount(5).\n\nMount points created at runtime (independently of unit files or /etc/fstab) will be monitored\nby systemd and appear like any other mount unit in systemd. See /proc/self/mountinfo\ndescription in proc(5).\n\nSome file systems have special semantics as API file systems for kernel-to-userspace and\nuserspace-to-userspace interfaces. Some of them may not be changed via mount units, and\ncannot be disabled. For a longer discussion see API File Systems[1].\n\nThe systemd-mount(1) command allows creating .mount and .automount units dynamically and\ntransiently from the command line.\n\n### AUTOMATIC DEPENDENCIES\n\n#### Implicit Dependencies\n\nThe following dependencies are implicitly added:\n\n•   If a mount unit is beneath another mount unit in the file system hierarchy, both a\nrequirement dependency and an ordering dependency between both units are created\nautomatically.\n\n•   Block device backed file systems automatically gain BindsTo= and After= type dependencies\non the device unit encapsulating the block device (see below).\n\n•   If traditional file system quota is enabled for a mount unit, automatic Wants= and\nBefore= dependencies on systemd-quotacheck.service and quotaon.service are added.\n\n•   Additional implicit dependencies may be added as result of execution and resource control\nparameters as documented in systemd.exec(5) and systemd.resource-control(5).\n\n#### Default Dependencies\n\nThe following dependencies are added unless DefaultDependencies=no is set:\n\n•   All mount units acquire automatic Before= and Conflicts= on umount.target in order to be\nstopped during shutdown.\n\n•   Mount units referring to local file systems automatically gain an After= dependency on\nlocal-fs-pre.target, and a Before= dependency on local-fs.target unless nofail mount\noption is set.\n\n•   Network mount units automatically acquire After= dependencies on remote-fs-pre.target,\nnetwork.target and network-online.target, and gain a Before= dependency on\nremote-fs.target unless nofail mount option is set. Towards the latter a Wants= unit is\nadded as well.\n\nMount units referring to local and network file systems are distinguished by their file\nsystem type specification. In some cases this is not sufficient (for example network block\ndevice based mounts, such as iSCSI), in which case netdev may be added to the mount option\nstring of the unit, which forces systemd to consider the mount unit a network mount.\n\n### FSTAB\n\nMount units may either be configured via unit files, or via /etc/fstab (see fstab(5) for\ndetails). Mounts listed in /etc/fstab will be converted into native units dynamically at boot\nand when the configuration of the system manager is reloaded. In general, configuring mount\npoints through /etc/fstab is the preferred approach. See systemd-fstab-generator(8) for\ndetails about the conversion.\n\nThe NFS mount option bg for NFS background mounts as documented in nfs(5) is detected by\nsystemd-fstab-generator and the options are transformed so that systemd fulfills the\njob-control implications of that option. Specifically systemd-fstab-generator acts as though\n\"x-systemd.mount-timeout=infinity,retry=10000\" was prepended to the option list, and\n\"fg,nofail\" was appended. Depending on specific requirements, it may be appropriate to\nprovide some of these options explicitly, or to make use of the \"x-systemd.automount\" option\ndescribed below instead of using \"bg\".\n\nWhen reading /etc/fstab a few special mount options are understood by systemd which influence\nhow dependencies are created for mount points. systemd will create a dependency of type\nWants= or Requires= (see option nofail below), from either local-fs.target or\nremote-fs.target, depending whether the file system is local or remote.\n\n#### x-systemd.requires=\n\nConfigures a Requires= and an After= dependency between the created mount unit and\nanother systemd unit, such as a device or mount unit. The argument should be a unit name,\nor an absolute path to a device node or mount point. This option may be specified more\nthan once. This option is particularly useful for mount point declarations that need an\nadditional device to be around (such as an external journal device for journal file\nsystems) or an additional mount to be in place (such as an overlay file system that\nmerges multiple mount points). See After= and Requires= in systemd.unit(5) for details.\n\nNote that this option always applies to the created mount unit only regardless whether\nx-systemd.automount has been specified.\n\nx-systemd.before=, x-systemd.after=\nIn the created mount unit, configures a Before= or After= dependency on another systemd\nunit, such as a mount unit. The argument should be a unit name or an absolute path to a\nmount point. This option may be specified more than once. This option is particularly\nuseful for mount point declarations with nofail option that are mounted asynchronously\nbut need to be mounted before or after some unit start, for example, before\nlocal-fs.target unit. See Before= and After= in systemd.unit(5) for details.\n\nNote that these options always apply to the created mount unit only regardless whether\nx-systemd.automount has been specified.\n\nx-systemd.wanted-by=, x-systemd.required-by=\nIn the created mount unit, configures a WantedBy= or RequiredBy= dependency on another\nunit. This option may be specified more than once. If this is specified, the normal\nautomatic dependencies on the created mount unit, e.g., local-fs.target, are not\nautomatically created. See WantedBy= and RequiredBy= in systemd.unit(5) for details.\n\n#### x-systemd.requires-mounts-for=\n\nConfigures a RequiresMountsFor= dependency between the created mount unit and other mount\nunits. The argument must be an absolute path. This option may be specified more than\nonce. See RequiresMountsFor= in systemd.unit(5) for details.\n\n#### x-systemd.device-bound\n\nThe block device backed file system will be upgraded to BindsTo= dependency. This option\nis only useful when mounting file systems manually with mount(8) as the default\ndependency in this case is Requires=. This option is already implied by entries in\n/etc/fstab or by mount units.\n\n#### x-systemd.automount\n\nAn automount unit will be created for the file system. See systemd.automount(5) for\ndetails.\n\n#### x-systemd.idle-timeout=\n\nConfigures the idle timeout of the automount unit. See TimeoutIdleSec= in\nsystemd.automount(5) for details.\n\n#### x-systemd.device-timeout=\n\nConfigure how long systemd should wait for a device to show up before giving up on an\nentry from /etc/fstab. Specify a time in seconds or explicitly append a unit such as \"s\",\n\"min\", \"h\", \"ms\".\n\nNote that this option can only be used in /etc/fstab, and will be ignored when part of\nthe Options= setting in a unit file.\n\n#### x-systemd.mount-timeout=\n\nConfigure how long systemd should wait for the mount command to finish before giving up\non an entry from /etc/fstab. Specify a time in seconds or explicitly append a unit such\nas \"s\", \"min\", \"h\", \"ms\".\n\nNote that this option can only be used in /etc/fstab, and will be ignored when part of\nthe Options= setting in a unit file.\n\nSee TimeoutSec= below for details.\n\n#### x-systemd.makefs\n\nThe file system will be initialized on the device. If the device is not \"empty\", i.e. it\ncontains any signature, the operation will be skipped. It is hence expected that this\noption remains set even after the device has been initialized.\n\nNote that this option can only be used in /etc/fstab, and will be ignored when part of\nthe Options= setting in a unit file.\n\nSee systemd-makefs@.service(8).\n\nwipefs(8) may be used to remove any signatures from a block device to force\nx-systemd.makefs to reinitialize the device.\n\n#### x-systemd.growfs\n\nThe file system will be grown to occupy the full block device. If the file system is\nalready at maximum size, no action will be performed. It is hence expected that this\noption remains set even after the file system has been grown. Only certain file system\ntypes are supported, see systemd-makefs@.service(8) for details.\n\nNote that this option can only be used in /etc/fstab, and will be ignored when part of\nthe Options= setting in a unit file.\n\n#### x-systemd.rw-only\n\nIf a mount operation fails to mount the file system read-write, it normally tries\nmounting the file system read-only instead. This option disables that behaviour, and\ncauses the mount to fail immediately instead. This option is translated into the\nReadWriteOnly= setting in a unit file.\n\nnetdev\nNormally the file system type is used to determine if a mount is a \"network mount\", i.e.\nif it should only be started after the network is available. Using this option overrides\nthis detection and specifies that the mount requires network.\n\nNetwork mount units are ordered between remote-fs-pre.target and remote-fs.target,\ninstead of local-fs-pre.target and local-fs.target. They also pull in\nnetwork-online.target and are ordered after it and network.target.\n\nnoauto, auto\nWith noauto, the mount unit will not be added as a dependency for local-fs.target or\nremote-fs.target. This means that it will not be mounted automatically during boot,\nunless it is pulled in by some other unit. The auto option has the opposite meaning and\nis the default.\n\nNote that if x-systemd.automount (see above) is used, neither auto nor noauto have any\neffect. The matching automount unit will be added as a dependency to the appropriate\ntarget.\n\n#### nofail\n\nWith nofail, this mount will be only wanted, not required, by local-fs.target or\nremote-fs.target. Moreover the mount unit is not ordered before these target units. This\nmeans that the boot will continue without waiting for the mount unit and regardless\nwhether the mount point can be mounted successfully.\n\n#### x-initrd.mount\n\nAn additional filesystem to be mounted in the initramfs. See initrd-fs.target description\nin systemd.special(7).\n\nIf a mount point is configured in both /etc/fstab and a unit file that is stored below /usr/,\nthe former will take precedence. If the unit file is stored below /etc/, it will take\nprecedence. This means: native unit files take precedence over traditional configuration\nfiles, but this is superseded by the rule that configuration in /etc/ will always take\nprecedence over configuration in /usr/.\n\n### OPTIONS\n\nMount files must include a [Mount] section, which carries information about the file system\nmount points it supervises. A number of options that may be used in this section are shared\nwith other unit types. These options are documented in systemd.exec(5) and systemd.kill(5).\nThe options specific to the [Mount] section of mount units are the following:\n\nWhat=\nTakes an absolute path of a device node, file or other resource to mount. See mount(8)\nfor details. If this refers to a device node, a dependency on the respective device unit\nis automatically created. (See systemd.device(5) for more information.) This option is\nmandatory. Note that the usual specifier expansion is applied to this setting, literal\npercent characters should hence be written as \"%%\". If this mount is a bind mount and the\nspecified path does not exist yet it is created as directory.\n\nWhere=\nTakes an absolute path of a file or directory for the mount point; in particular, the\ndestination cannot be a symbolic link. If the mount point does not exist at the time of\nmounting, it is created as directory. This string must be reflected in the unit filename.\n(See above.) This option is mandatory.\n\nType=\nTakes a string for the file system type. See mount(8) for details. This setting is\noptional.\n\nOptions=\nMount options to use when mounting. This takes a comma-separated list of options. This\nsetting is optional. Note that the usual specifier expansion is applied to this setting,\nliteral percent characters should hence be written as \"%%\".\n\nSloppyOptions=\nTakes a boolean argument. If true, parsing of the options specified in Options= is\nrelaxed, and unknown mount options are tolerated. This corresponds with mount(8)'s -s\nswitch. Defaults to off.\n\nLazyUnmount=\nTakes a boolean argument. If true, detach the filesystem from the filesystem hierarchy at\ntime of the unmount operation, and clean up all references to the filesystem as soon as\nthey are not busy anymore. This corresponds with umount(8)'s -l switch. Defaults to off.\n\nReadWriteOnly=\nTakes a boolean argument. If false, a mount point that shall be mounted read-write but\ncannot be mounted so is retried to be mounted read-only. If true the operation will fail\nimmediately after the read-write mount attempt did not succeed. This corresponds with\nmount(8)'s -w switch. Defaults to off.\n\nForceUnmount=\nTakes a boolean argument. If true, force an unmount (in case of an unreachable NFS\nsystem). This corresponds with umount(8)'s -f switch. Defaults to off.\n\nDirectoryMode=\nDirectories of mount points (and any parent directories) are automatically created if\nneeded. This option specifies the file system access mode used when creating these\ndirectories. Takes an access mode in octal notation. Defaults to 0755.\n\nTimeoutSec=\nConfigures the time to wait for the mount command to finish. If a command does not exit\nwithin the configured time, the mount will be considered failed and be shut down again.\nAll commands still running will be terminated forcibly via SIGTERM, and after another\ndelay of this time with SIGKILL. (See KillMode= in systemd.kill(5).) Takes a unit-less\nvalue in seconds, or a time span value such as \"5min 20s\". Pass 0 to disable the timeout\nlogic. The default value is set from DefaultTimeoutStartSec= option in systemd-\nsystem.conf(5).\n\nCheck systemd.exec(5) and systemd.kill(5) for more settings.\n\n### SEE ALSO\n\nsystemd(1), systemctl(1), systemd-system.conf(5), systemd.unit(5), systemd.exec(5),\nsystemd.kill(5), systemd.resource-control(5), systemd.service(5), systemd.device(5), proc(5),\nmount(8), systemd-fstab-generator(8), systemd.directives(7), systemd-mount(1)\n\n### NOTES\n\n1. API File Systems\nhttps://www.freedesktop.org/wiki/Software/systemd/APIFileSystems\n\n\n\nsystemd 249                                                                         SYSTEMD.MOUNT(5)\n\n"
        }
    ],
    "structuredContent": {
        "command": "systemd.mount",
        "section": "5",
        "mode": "man",
        "summary": "systemd.mount - Mount unit configuration",
        "synopsis": "mount.mount",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "systemd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd/1/json"
            },
            {
                "name": "systemctl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemctl/1/json"
            },
            {
                "name": "systemd-system.conf",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-system.conf/5/json"
            },
            {
                "name": "systemd.unit",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.unit/5/json"
            },
            {
                "name": "systemd.exec",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.exec/5/json"
            },
            {
                "name": "systemd.kill",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.kill/5/json"
            },
            {
                "name": "systemd.resource-control",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.resource-control/5/json"
            },
            {
                "name": "systemd.service",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.service/5/json"
            },
            {
                "name": "systemd.device",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.device/5/json"
            },
            {
                "name": "proc",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
            },
            {
                "name": "mount",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mount/8/json"
            },
            {
                "name": "systemd-fstab-generator",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-fstab-generator/8/json"
            },
            {
                "name": "systemd.directives",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/systemd.directives/7/json"
            },
            {
                "name": "systemd-mount",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/systemd-mount/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 37,
                "subsections": []
            },
            {
                "name": "AUTOMATIC DEPENDENCIES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Implicit Dependencies",
                        "lines": 15
                    },
                    {
                        "name": "Default Dependencies",
                        "lines": 19
                    }
                ]
            },
            {
                "name": "FSTAB",
                "lines": 19,
                "subsections": [
                    {
                        "name": "x-systemd.requires=",
                        "lines": 28
                    },
                    {
                        "name": "x-systemd.requires-mounts-for=",
                        "lines": 4
                    },
                    {
                        "name": "x-systemd.device-bound",
                        "lines": 5
                    },
                    {
                        "name": "x-systemd.automount",
                        "lines": 3
                    },
                    {
                        "name": "x-systemd.idle-timeout=",
                        "lines": 3
                    },
                    {
                        "name": "x-systemd.device-timeout=",
                        "lines": 7
                    },
                    {
                        "name": "x-systemd.mount-timeout=",
                        "lines": 9
                    },
                    {
                        "name": "x-systemd.makefs",
                        "lines": 12
                    },
                    {
                        "name": "x-systemd.growfs",
                        "lines": 8
                    },
                    {
                        "name": "x-systemd.rw-only",
                        "lines": 24
                    },
                    {
                        "name": "nofail",
                        "lines": 5
                    },
                    {
                        "name": "x-initrd.mount",
                        "lines": 9
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 64,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 6,
                "subsections": []
            }
        ]
    }
}