.\" -*- coding: UTF-8 -*- .\" Copyright (C) 1993 Rickard E. Faith .\" and Copyright (C) 1994 Andries E. Brouwer .\" and Copyright (C) 2002, 2005 Michael Kerrisk .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" 2008-10-06, mtk: Created this as a new page by splitting .\" umount/umount2 material out of mount.2 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH umount 2 "30 марта 2023 г." "Linux man\-pages 6.05.01" .SH ИМЯ umount, umount2 \- размонтирует файловую систему .SH LIBRARY Standard C library (\fIlibc\fP, \fI\-lc\fP) .SH СИНТАКСИС .nf \fB#include \fP .PP \fBint umount(const char *\fP\fItarget\fP\fB);\fP \fBint umount2(const char *\fP\fItarget\fP\fB, int \fP\fIflags\fP\fB);\fP .fi .SH ОПИСАНИЕ .\" Note: the kernel naming differs from the glibc naming .\" umount2 is the glibc name for what the kernel now calls umount .\" and umount is the glibc name for oldumount Вызовы \fBumount\fP() и \fBumount2\fP() удаляют подключение (самого верхнего уровня) к файловой системе, примонтированной к \fItarget\fP. .PP Для размонтирования файловых систем требуются права (Linux: мандат \fBCAP_SYS_ADMIN\fP). .PP В Linux 2.1.116 добавлен системный вызов \fBumount2\fP(), который, подобно \fBumount\fP(), размонтирует заданный объект, но позволяет указать дополнительные флаги \fIflags\fP, контролирующие поведение операции: .TP \fBMNT_FORCE\fP (начиная с Linux 2.1.116) Попросить файловую систему прервать ожидающие запросы перед попыткой размонтирования. Это может позволить выполнить размонтирование без ожидания недоступного сервера, но может привести к потере данных. Если после прерывания запросов некоторые процессы продолжат обращаться к файловой системе, размонтирование не будет выполнено. В Linux 4.12 \fBMNT_FORCE\fP поддерживается только в следующих файловых системах: 9p (начиная с Linux 2.6.16), ceph (начиная с Linux 2.6.34), cifs (начиная с Linux 2.6.12), fuse (начиная с Linux 2.6.16), lustre (начиная с Linux 3.11) и NFS (начиная с Linux 2.1.116). .TP \fBMNT_DETACH\fP (начиная с Linux 2.4.11) Perform a lazy unmount: make the mount unavailable for new accesses, immediately disconnect the filesystem and all filesystems mounted below it from each other and from the mount table, and actually perform the unmount when the mount ceases to be busy. .TP \fBMNT_EXPIRE\fP (начиная Linux 2.6.8) Mark the mount as expired. If a mount is not currently in use, then an initial call to \fBumount2\fP() with this flag fails with the error \fBEAGAIN\fP, but marks the mount as expired. The mount remains expired as long as it isn't accessed by any process. A second \fBumount2\fP() call specifying \fBMNT_EXPIRE\fP unmounts an expired mount. This flag cannot be specified with either \fBMNT_FORCE\fP or \fBMNT_DETACH\fP. .TP \fBUMOUNT_NOFOLLOW\fP (начиная с Linux 2.6.34) .\" Later added to Linux 2.6.33-stable Не следовать по ссылке, если \fItarget\fP является символьной ссылкой. Это флаг помогает избежать проблем с безопасностью в программах принадлежащих root и с установленным битом set\-user\-ID, которые позволяют непривилегированным пользователям размонтировать файловые системы. .SH "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ" On success, zero is returned. On error, \-1 is returned, and \fIerrno\fP is set to indicate the error. .SH ОШИБКИ Коды ошибок, описанные ниже, не зависят от типа файловой системы. У каждой файловой системы могут быть свои коды ошибок и своё собственное поведение. Подробности смотрите в исходном коде ядра Linux. .TP \fBEAGAIN\fP Вызов \fBumount2\fP() с флагом \fBMNT_EXPIRE\fP успешно пометил незанятую файловую систему как недействительную. .TP \fBEBUSY\fP Объект \fItarget\fP не может быть размонтирован, так как он занят. .TP \fBEFAULT\fP Объект \fItarget\fP указывает вне адресного пространства, доступного пользователю. .TP \fBEINVAL\fP Значение \fItarget\fP не является точкой монтирования. .TP \fBEINVAL\fP \fItarget\fP is locked; see \fBmount_namespaces\fP(7). .TP \fBEINVAL\fP Вызов \fBumount2\fP() был вызван с флагом \fBMNT_EXPIRE\fP и с \fBMNT_DETACH\fP или \fBMNT_FORCE\fP. .TP \fBEINVAL\fP (начиная с Linux 2.6.34) Вызов \fBumount2\fP() был сделан с неверным значением флага \fIflags\fP. .TP \fBENAMETOOLONG\fP Значение пути длиннее чем \fBMAXPATHLEN\fP. .TP \fBENOENT\fP Указан пустой путь или одна из его частей не существует. .TP \fBENOMEM\fP Ядро не может выделить свободную страницу для копирования имени файла или данных. .TP \fBEPERM\fP Вызывающий процесс не имеет требуемых привилегий. .SH СТАНДАРТЫ Linux. .SH ИСТОРИЯ .\" http://sourceware.org/bugzilla/show_bug.cgi?id=10092 \fBMNT_DETACH\fP and \fBMNT_EXPIRE\fP are available since glibc 2.11. .PP Изначально функция \fBumount\fP() вызывалась как \fIumount(device)\fP и возвращала \fBENOTBLK\fP при попытке работы с любым не блочным устройством. В Linux 0.98p4 был добавлен вызов \fIumount(dir)\fP для поддержки анонимных устройств. В Linux 2.3.99\-pre7 был убран вызов \fIumount(device)\fP, остался только \fIumount(dir)\fP (теперь устройства могут быть подключены более чем к одной точке, поэтому указания только устройства недостаточно). .SH ЗАМЕЧАНИЯ .SS "umount() and shared mounts" Shared mounts cause any mount activity on a mount, including \fBumount\fP() operations, to be forwarded to every shared mount in the peer group and every slave mount of that peer group. This means that \fBumount\fP() of any peer in a set of shared mounts will cause all of its peers to be unmounted and all of their slaves to be unmounted as well. .PP This propagation of unmount activity can be particularly surprising on systems where every mount is shared by default. On such systems, recursively bind mounting the root directory of the filesystem onto a subdirectory and then later unmounting that subdirectory with \fBMNT_DETACH\fP will cause every mount in the mount namespace to be lazily unmounted. .PP To ensure \fBumount\fP() does not propagate in this fashion, the mount may be remounted using a \fBmount\fP(2) call with a \fImount_flags\fP argument that includes both \fBMS_REC\fP and \fBMS_PRIVATE\fP prior to \fBumount\fP() being called. .SH "СМ. ТАКЖЕ" \fBmount\fP(2), \fBmount_namespaces\fP(7), \fBpath_resolution\fP(7), \fBmount\fP(8), \fBumount\fP(8) .PP .SH ПЕРЕВОД Русский перевод этой страницы руководства был сделан Azamat Hackimov , Dmitriy Ovchinnikov , Dmitry Bolkhovskikh , Katrin Kutepova , Yuri Kozlov и Иван Павлов . .PP Этот перевод является бесплатной документацией; прочитайте .UR https://www.gnu.org/licenses/gpl-3.0.html Стандартную общественную лицензию GNU версии 3 .UE или более позднюю, чтобы узнать об условиях авторского права. Мы не несем НИКАКОЙ ОТВЕТСТВЕННОСТИ. .PP Если вы обнаружите ошибки в переводе этой страницы руководства, пожалуйста, отправьте электронное письмо на .MT man-pages-ru-talks@lists.sourceforge.net .ME .