Dismounting a Filesystem home, users

grpid Create files with BSD semantics for the propagation of the group ID. Under this option, files inherit the GID of the directory in which they are created, regardless of the directorys SGID bit. noauto Do not mount the filesystem automatically, only explicitly ignore option −a. remount A filesystem mounted read−only can be remounted read−write used in conjunction with rw. intr nointr Allow, or do not allow, keyboard interrupts to terminate a process that is waiting for an operation on a locked filesystem; the default is intr. quota noquota Filesystem usage limits are enforced, or are not enforced; the default is noquota. rq Read−write with quota turned on equivalent to rw,quota. largefiles nolargefiles Attempt to enable or disable the creation of files greater than 2GB in size; the filesystem must be created especially to support large files. The default is nolargfiles. Note: It is highly recommended that you check the manual pages for the mount command before attempting to implement it. A few examples of how to use the mount command follow; the presented situations are hypothetical. To mount the local filesystem devxy0g in the directory usr: mount devxy0g usr • To mount the hfs filesystem devdskc1d2s0 in the directory home: mount −t hfs devdskc1d2s0 home • To fake an entry for nd root: mount −ft 4.2 devnd0 • To list the filesystems that are currently mounted: mount • To mount all ufs file systems: mount −at ufs • To save the current mount state: mount −p etcvfstab •

5.3.2 Dismounting a Filesystem

Dismounting is the reverse process of mounting. Every mounted filesystem can be dismounted except the root filesystem. When system shutdown is required, before the system stops entirely, all filesystems are dismounted. This is actually the only situation when the root filesystem is dismounted. The umount command is used to dismount a filesystem. Using the command is somewhat easier than mounting; you simply type: umount name where 118 i.e., the directory at which the filesystem is mounted The single argument is sufficient for full identification of the mounted filesystem. The umount command looks in the filesystem status file etcmnttab or, etcmtab for another argument. If a specified name cannot be found, it simply means there is no need for dismounting because the specified filesystem is not mounted at all. umount supports the same options as the mount command. Online UNIX documentation often presents both commands in the same manual pages. A few examples: To dismount the filesystem devdskc1d2s0 mounted at home: umount devdskc1d2s0 or umount home • To dismount all filesystems described in the filesystem status file etcmtab: umount −a Pay attention that the root filesystem can never be dismounted. • A filesystem can be dismounted only if it is not busy. A filesystem is busy as long as any running process is requiring any resource within the filesystem. For example, when a user changes a directory within a certain filesystem by executing the cd command, that filesystem becomes busy, and the superuser cannot dismount it. The only way to dismount a busy filesystem is to first make it free by destroying all related running processes. Once all processes release the filesystem, it can be dismounted. For example, to dismount the home filesystem supposing it as a separate filesystem, all users must log out. Releasing a busy filesystem is not a simple task. It is not always easy to determine which processes are associated with the filesystem. The fuser command could be instrumental in this case: fuser [option] fsname where fsname The name of the filesystem, specified as a special device file recommended or a mount directory option wo option Lists all involved processes, identified by their PIDs −u Lists all involved processes; the login user name is added in parentheses besides the PIDs −k Destroys all involved processes and makes the filesystem free The −k option of the fuser command is dangerous, and must be used with extreme caution; for example, fuser −k home will kick−out all logged−in users from the system.

5.3.3 Automatic Filesystem Mounting