
取引内容は次のとおりです:
私はかなり長い間ハードディスクを使用していましたが、最近 fstab を使用してハードディスクを自動的にマウントしました/media/kevin/toshiba
。
これで、マウントされるたびに、その権限は になりますdrwxrwxrwx
。別のコンピューターにハードディスクを接続すると、明らかに上記ではないデフォルトの権限が表示されます。
デフォルトの権限を保持したまま h をマウントするにはどうすればよいですか。
編集1:
これは私の/etc/fstab
エントリーです:
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=8C3669123668FE98 /media/kevin/kevin-toshiba ntfs defaults 0 0
私もこれを試しました:
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=8C3669123668FE98 /media/kevin/kevin-toshiba ntfs nls=iso8859-1,permissions,users,auto 0 0
答え1
ドライブを自動マウントするもっと簡単な方法は、マウント コマンドを /etc/rc.local に入れることだと分かりました。fstab の使用でいろいろと苦労したので、今はそうしています。/etc/rc.local は、起動時に root によって実行される bash スクリプトです。ドライブをマウントするフォルダーを作成し、/etc/rc.local の「exit」行より上の任意の場所にマウント コマンドを追加して、再起動します。
私のはこんな感じです。
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
#Mounts Storage
mount /dev/sdb1 /mnt/Storage
exit 0