Re: Preventing writes to the underlying directory when a mounted filesystem disappears

Stefan Monnier <[email protected]> Mon, 27 Jul 2026 09:55:01 -0400
Newsgroups gmane.linux.debian.user
Message-ID <[email protected]>
>     You can also mount a read-only ramdisk in between the root filesystem
>   (if it needs to be mounted read-write) and the usb. Assuming the
>   directory is /mnt/log. Something similar to those lines in /etc/fstab
>   may (untested) work.
>
> tmpfs   /mnt/log        tmpfs   defaults,ro        0 0
> /dev/usb-block  /mnt/log   ext4  defaults  0 0

In the same vein, there's also

    mount -o bind,ro /emptydir /var/log


=== Stefan