If I set some permission bits on a directory in the file system , for example to be executable and readable and writable only by root, will the permission bits be respected when I plug the external hard drive to a Windows system?
Não, as permissões de arquivo do UNIX não funcionam no Windows.
I would like to find a way to restrict access to a directory on my external hard drive from any OS.
Em geral, cada sistema operacional tem uma maneira diferente de definir permissões, portanto, isso não é possível. Você precisará definir as permissões apropriadas nos arquivos, dependendo de qual SO o sistema de arquivos está atualmente montado.
Citações de esta resposta :
NTFS has Windows ACEs. Unix uses "mode bits" on each file.
On NTFS, each file can have an owner, and zero or more Windows access control entries (ACEs). An ACE consists of a principal (users and groups are principals), a set of operations (Read, Write, Execute, etc.) and whether those operations are allowed or denied. Files can have many ACEs. Other objects in Windows other than files can have ACEs as well, such as registry entries, printer objects, and other things. All ACEs are taken into account when a file operation occurs. Deny takes precedence over allow. Windows ACEs support inheritance where you can set an ACE for a directory and have it automatically propagate to lower level directories.
Files in Unix have an owning user (owner) and an owning group (owner-group). There are three fixed "principals" which are owner, members of the owning group, and everyone else (a.k.a world). For each principal there are three "bits" which cover read, write, and execute abilities. (these have different meanings for directories than files, see this). These bits determine who can perform what operations. This is called the file's mode and is built into the file (there are no separate ACEs).