processes:mounting_proc
Differences
This shows you the differences between two versions of the page.
processes:mounting_proc [2016/07/04 15:53] – created peter | processes:mounting_proc [2019/12/01 22:41] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Processes - Mounting /proc ====== | ||
- | |||
- | ===== Objective ===== | ||
- | |||
- | To ensure that procfs is mounted as /proc. | ||
- | |||
- | ===== Symptoms ===== | ||
- | |||
- | Errors caused by the absence of /proc often mention the inability to open a pathname within /proc, and in some cases suggest that you check whether procfs has been mounted. | ||
- | |||
- | <code bash> | ||
- | Cannot find / | ||
- | </ | ||
- | |||
- | <code bash> | ||
- | WARNING: | ||
- | </ | ||
- | |||
- | Other messages may be less helpful and state only that some higher-level operation has failed. | ||
- | |||
- | * scheduling, | ||
- | * memory management, | ||
- | * device drivers, and | ||
- | * the network stack. | ||
- | |||
- | ===== Diagnosis ===== | ||
- | |||
- | Checking whether procfs has been mounted can be achieved trivially by listing the content of /proc: | ||
- | |||
- | <code bash> | ||
- | ls /proc | ||
- | </ | ||
- | |||
- | The result should look broadly similar to this: | ||
- | |||
- | <code bash> | ||
- | 1 | ||
- | 101 | ||
- | 1250 2125 | ||
- | 131 | ||
- | 132 | ||
- | 133 | ||
- | 134 | ||
- | 1557 2286 | ||
- | 1570 2288 | ||
- | 2 | ||
- | 2073 2290 | ||
- | 2082 2291 | ||
- | 2091 25840 609 driver | ||
- | 2114 3 742 execdomains | ||
- | </ | ||
- | |||
- | but with details that depend on what processes are running and which kernel modules are loaded. | ||
- | |||
- | Alternatively, | ||
- | |||
- | <code bash> | ||
- | none on /proc type proc (rw) | ||
- | </ | ||
- | |||
- | ===== Possible causes ===== | ||
- | |||
- | ==== /proc is not listed in /etc/fstab ==== | ||
- | |||
- | The most likely reason for procfs not being mounted is it not being listed in /etc/fstab. There should be a line of the form: | ||
- | |||
- | <code bash> | ||
- | none /proc proc defaults 0 0 | ||
- | </ | ||
- | |||
- | This should allow /proc to be mounted manually using the command: | ||
- | |||
- | <code bash> | ||
- | mount /proc | ||
- | </ | ||
- | |||
- | and cause it to be mounted automatically on reboot. | ||
- | |||
- | |||
- | ==== The process is running inside a chroot ==== | ||
- | |||
- | The process of entering a chroot does not cause init or any other boot-time scripts to be run, therefore even if /proc is listed in the copy of /etc/fstab within the chroot it will not be mounted automatically. | ||
- | |||
- | The solution is to mount from outside the chroot using the copy of /etc/fstab that governs the system as a whole. | ||
- | |||
- | * Mounting /proc within a chroot jail is moderately undesirable because the purpose of a jail is to give the process inside it access to as little as possible. | ||
- | * For other purposes, such as running a different version of the OS, you probably should mount /proc (and consider other mount points such as /dev). | ||
- | |||
- | For a chroot environment located at /opt/chroot an appropriate entry in /etc/fstab would be: | ||
- | |||
- | <code bash> | ||
- | /proc / | ||
- | </ | ||
- | |||
- | A bind mount has been used in this example. | ||
- | |||
- | ==== procfs is missing from the kernel ==== | ||
- | |||
- | This is very unlikely. | ||
- | |||
- | Note that the procfs module is normally compiled into the kernel statically, so do not expect to find it in / | ||
- | |||
processes/mounting_proc.1467647603.txt.gz · Last modified: 2020/07/15 09:30 (external edit)