The umount() function requests that a previously mounted file system contained on a block special device or directory be unmounted. The file argument is a pointer to the absolute pathname of the file system to be unmounted. After unmounting the file system,
the directory upon which the file system was mounted reverts to its ordinary interpretation.
The umount2() function is identical to umount(), with the additional capability of unmounting file systems even if there are open files active. The mflag argument must contain one of the following values:
- Perform a normal unmount that is equivalent to umount(). The umount2() function returns EBUSY if there are open files active within the file system to be unmounted.
- Unmount the file system, even if there are open files active. A forced unmount may resort in loss of data, so it should be used only when a regular unmount is unsuccessful. The umount2() function returns ENOTSUP if the specified file systems does not support MS_FORCE. Currently only nfs- and ufs-type file systems support MS_FORCE.