ext4パーティションを正常にマウントできます。問題は、パーティション上のすべてのファイルがユーザーID 1000のユーザーによって所有されていることです。あるマシンではユーザーIDは1000ですが、別のマシンでは1010です。ユーザー名は両方のマシンで同じです。 、しかし、ファイルシステムにはユーザー名ではなくユーザーIDが格納されていることに気付きました。
次のような方法でファイルの所有権を修正できます。
find /mnt/example -exec chown -h 1010 {} \;
ただし、この外付けドライブを別のマシンにマウントする場合は、ファイルの所有権を再度1000に修正する必要があります。
mount
実際にファイルを変更する必要がないように、map userid 1000〜1010というオプションを指定したいと思います。これを行う方法はありますか?
bindfsパッケージを見てください。bindfsは、既存のファイルシステム上でファイルパーミッション、ファイル所有権などのさまざまな操作を可能にするFUSEファイルシステムです。
あなたは特にbindfsの--mapオプションを探しています:
--map=user1/user2:@group1/@group2:..., -o map=...
Given a mapping user1/user2, all files owned by user1 are shown as owned by user2. When user2 creates files, they are chowned to user1 in the underlying directory. When files are chowned to user2, they are chowned to user1 in the underlying directory. Works similarly for groups.
A single user or group may appear no more than once on the left and once on the right of a slash in the list of mappings. Currently, the options --force-user, --force-group, --mirror, --create-for-*, --chown-* and --chgrp-* override the corresponding behavior of this option.
Requires mounting as root.
そうでユーザID 1001を使用してファイルをマップするため/mnt/wrong
に/mnt/correct
、ユーザーIDが1234で、次のコマンドを実行します。
sudo bindfs --map=1001/1234 /mnt/wrong /mnt/correct
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加