GNU/Linux >> Linux の 問題 >  >> Linux

Linux でマウント名前空間を表示/操作する

はい。その /proc/$PID/mountinfo を見ることができます または、 findmnt -N を使用できます スイッチ - どの findmnt --help について 言います:

  • -N, --task <tid>
    • 別の名前空間を使用 (/proc/<tid>/mountinfo ファイル)

findmnt PROPAGATION も追跡します mountinfo であるフラグ この情報を正確に報告するフィールド - どのプロセスがどのマウントを共有するか

また、いつでも nsenter できます 好きなタイプの名前空間 - もちろん、適切な権限があれば。

 nsenter --help
Usage:
 nsenter [options] <program> [args...]

Options:
 -t, --target <pid>     target process to get namespaces from
 -m, --mount [=<file>]  enter mount namespace
 -u, --uts   [=<file>]  enter UTS namespace (hostname etc)
 -i, --ipc   [=<file>]  enter System V IPC namespace
 -n, --net   [=<file>]  enter network namespace
 -p, --pid   [=<file>]  enter pid namespace
 -U, --user  [=<file>]  enter user namespace
 -S, --setuid <uid>     set uid in user namespace
 -G, --setgid <gid>     set gid in user namespace
 -r, --root  [=<dir>]   set the root directory
 -w, --wd    [=<dir>]   set the working directory
 -F, --no-fork          do not fork before exec'ing <program>

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see nsenter(1).

Linux
  1. Linuxでの名前空間とコンテナの謎を解き明かす

  2. Linux名前空間

  3. Linux – Linuxでのユニオンマウント?

  1. Linuxで画像メタデータを表示する方法

  2. Linux –カーネル:名前空間のサポート?

  3. Linuxでマウントをバインドする

  1. Linux名前空間でChrootを実行する方法は?

  2. Linux – Linuxで名前空間を一覧表示する方法は?

  3. Linux – Uts名前空間とは何ですか?