Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

umount

Detach a mounted file system from the folder tree.

Niveau
RHCSA-examen
Groep
Schijven en bestandssystemen
Root nodig
Voor wijzigingen
Pakket
util-linux

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

umount FOLDER (or the device) writes pending data and detaches the file system. It fails with "target is busy" when a process has open files there or uses it as its current folder — also your own shell. Find the process with lsof or fuser, stop it, and try again.

Zo schrijf je het

umount [OPTION]... DIRECTORY|DEVICE
umount -a [-t TYPE] [-O OPTIONS]

Opties 18

Meest gebruikt

-l, --lazy
Detach now, clean up when it is no longer busy.
-f, --force
Force (mainly for unreachable NFS).
-R, --recursive
Also unmount all sub-mounts.
-a, --all
Unmount everything in /proc/self/mountinfo (except proc, sys …).
-A, --all-targets
Unmount all mount points of the device.
-t, --types TYPES
Only these types (with -a).
-O, --test-opts OPTIONS
Only mounts with these options (with -a).
-r, --read-only
Remount read-only if unmount fails.
-d, --detach-loop
Also free the loop device.
-c, --no-canonicalize
Do not resolve paths.
-i, --internal-only
Do not call umount.TYPE helpers.
-n, --no-mtab
Do not write /etc/mtab.
-N, --namespace NS
Work in another mount namespace.
--fake
Do everything except the unmount.
-q, --quiet
No "not mounted" errors.
-v, --verbose
Verbose.
-h, --help
Show help.
-V, --version
Show the version.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1Unmount a folder

    umount /data

    Or umount /dev/vdb1.

  2. 2Target is busy

    umount /data
    umount: /data: target is busy.
    lsof /data
    fuser -vm /data

    Shows the processes; often a shell that is still in /data.

  3. 3Leave the folder yourself

    cd /; umount /data

    The most common cause.

  4. 4Lazy unmount

    umount -l /data

    Disappears now; really freed when the last user is gone.

  5. 5Hanging NFS share

    umount -f -l /mnt/nfs

    When the server is gone.

  6. 6Unmount a tree

    umount -R /mnt/chroot

    Also /mnt/chroot/proc, dev, sys …

  7. 7Unmount an ISO and free the loop device

    umount -d /repo

    Cleans the loop device too.

  8. 8Remount read-only if busy

    umount -r /data

    At least no more writes.

  9. 9Unmount all NFS mounts

    umount -a -t nfs,nfs4

    Before a network change.

  10. 10Check that it is gone

    findmnt /data || echo "not mounted"

    findmnt returns 1 when nothing is mounted.

Exitcodes

0Done.
1Error.
32Unmount failure.
64Some worked (with -a).