バインドマウント内のバインドマウント

バインドマウント内のバインドマウント

ファイルを別のファイルにバインドしてマウントし、隠しファイルを削除しようとしています。私はこの問題を次のように解決しようとしています。

folder1# echo a > a
folder1# echo b > b
folder1# mount -o bind a b
folder1# cat b
a #All good - the bind mount worked
folder1# cd ..
# mount -o bind folder1 folder2
# cd folder2
folder2# cat b
b #OK, as expected
folder2# unlink b
rm: cannot remove 'b': Device or resource busy

b物理ディスクから取り外し、バインドマウントをアクティブに保ちたいですa

だからそれが有効な場合は、次のようになります。

# cd folder2
folder2# cat b
b
folder2# unlink b
folder2# cat b
cat: error: No such file or directory
folder2# cd ../folder1
folder1# cat b
a #The bind mount is still active

Linuxを好きな方法で実行するにはどうすればよいですか?

ベストアンサー1

おすすめ記事