• [^] # Re: idee 1

    Posté par . En réponse au message Creer une copie read-only d'un ensemble de repertoires (mirror). Évalué à 3.

    Chezmoiçamarche

    frost / # mkdir mnt2
    frost / # mount -o ro --bind /mnt/ mnt2/
    frost / # touch /mnt2/test
    touch: impossible de faire un touch « /mnt2/test »: Système de fichiers accessible en lecture seulement

    Après, la page de manuel de mount propose deux syntaxes alternatives:

    since v2.27 allow to change the options by passing the -o option along with --bind for example:
    mount --bind,ro foo foo

    This feature is not supported by Linux kernel and it is implemented in userspace by additional remount mount(2) syscall. This > solution is not atomic.
    The alternative (classic) way to create a read-only bind mount is to use remount operation, for example:
    mount --bind olddir newdir
    mount -o remount,ro,bind olddir newdir