الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

umount

Detach a mounted file system from the folder tree.

المستوى
امتحان RHCSA
المجموعة
الأقراص وأنظمة الملفات
يحتاج root
للتغييرات
الحزمة
util-linux

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

ماذا يفعل

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.

طريقة الكتابة

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

الخيارات 18

الأكثر استخدامًا

-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.

أمثلة 10

$ مستخدم عادي# بصلاحية root (أو مع 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.

رموز الخروج

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