diff --git a/man2/pivot_root.2 b/man2/pivot_root.2 index 3e16b430e..3845e5f24 100644 --- a/man2/pivot_root.2 +++ b/man2/pivot_root.2 @@ -52,14 +52,7 @@ changes the root directory and the current working directory of each process or thread in the same mount namespace to .I new_root if they point to the old root directory. -This is necessary in order to prevent kernel threads from keeping the old -root directory busy with their root and current working directory, -even if they never access -the filesystem in any way. -Perhaps one day there may be a mechanism for -kernel threads to explicitly relinquish any access to the filesystem, -such that this fairly intrusive mechanism can be removed from -.BR pivot_root (). +See also NOTES. .PP Note that this also applies to the calling process: .BR pivot_root () @@ -195,6 +188,19 @@ the current root of all relevant processes or threads. A modern use is to set up a root filesystem during the creation of a container. .PP +The fact that +.BR pivot_root () +modifies process root and current working directories in the +manner noted in DESCRIPTION +is necessary in order to prevent kernel threads from keeping the old +root directory busy with their root and current working directory, +even if they never access +the filesystem in any way. +Perhaps one day there may be a mechanism for +kernel threads to explicitly relinquish any access to the filesystem, +such that this fairly intrusive mechanism can be removed from +.BR pivot_root (). +.PP The rootfs (initial ramfs) cannot be .BR pivot_root ()ed. The recommended method of changing the root filesystem in this case is