Red Hat Training

A Red Hat training course is available for RHEL 8

17.5. マウントポイントが複製されないようにする

この手順では、別のマウントポイントに複製されないように、マウントポイントをバインド不可としてマークします。

手順

  • マウントポイントのタイプをバインド不可なマウントに変更するには、以下のコマンドを使用します。

    # mount --bind mount-point mount-point
    # mount --make-unbindable mount-point

    あるいは、選択したマウントポイントとその下のすべてのマウントポイントのマウントタイプを変更する場合は、--make-unbindable の代わりに、--make-runbindable オプションを使用します。

    これ以降、このマウントの複製を作成しようとすると、以下のエラーが出て失敗します。

    # mount --bind mount-point duplicate-dir
    
    mount: wrong fs type, bad option, bad superblock on mount-point,
    missing codepage or helper program, or other error
    In some cases useful info is found in syslog - try
    dmesg | tail  or so

例17.4 /media が複製されないようにする

  • /media ディレクトリーが共有されないようにするには、以下のコマンドを実行します。

    # mount --bind /media /media
    # mount --make-unbindable /media

関連情報

  • mount(8) の man ページ