Overview
systemd-umount is used to unmount mount points managed by systemd. It is primarily called indirectly via the `systemctl stop <mount_unit_name>` command, but can be used directly in specific situations to control systemd's mount units.
Key Features
The core functionalities of systemd-umount include:
- Manages systemd mount units: Unmounts mount units defined by systemd.
- Similar to general `umount` but integrated with systemd: Functionally similar to the existing `umount` but integrated with systemd's lifecycle management.
- Primarily called indirectly via `systemctl`: In most cases, it is used internally by the `systemctl stop` command.
Key Options
The systemd-umount command provides various options to control the unmounting behavior.
Control Behavior
Specify Target
Generated command:
Try combining the commands.
Description:
`systemd-umount` Executes the command.
Combine the above options to virtually execute commands with AI.
Usage Examples
Examples of unmounting mount points using the systemd-umount command in various ways.
Unmount a Specific Mount Point
systemd-umount /mnt/data
Unmounts the file system mounted at the /mnt/data path.
Force Unmount
systemd-umount --force /mnt/backup
Forces the unmount of the /mnt/backup mount point, which might be in use or experiencing issues.
Recursive Unmount
systemd-umount --recursive /mnt/share
Recursively unmounts /mnt/share and all sub-mount points mounted under it.
Asynchronous Unmount using Device Path
systemd-umount --no-block /dev/sdb1
Asynchronously unmounts the file system mounted on the /dev/sdb1 device, allowing the command to return immediately.
Tips & Notes
Useful tips and points to note when using systemd-umount.
Difference between systemd-umount and umount
Generally, the `umount` command is used for unmounting file systems. `systemd-umount` provides more robust control for mount units managed by systemd and is often used internally by the `systemctl stop <mount_unit_name>` command. It is recommended to prioritize management through `systemctl` rather than direct use.
- `umount`: Traditional file system unmounting tool.
- `systemd-umount`: Works integrated with systemd mount units and is often invoked by `systemctl`.
Caution when using Force Unmount (--force)
The `--force` option can unmount file systems even when they are in use. However, this can lead to data corruption or loss. Use it cautiously and only when absolutely necessary.