• Preventing writes to the underlying directory when a mounted filesyste

    From Marcelo Laia@3:633/10 to All on Monday, July 27, 2026 13:50:01
    Subject: Preventing writes to the underlying directory when a mounted filesystem disappears

    Hello everyone,

    I'm designing a logging system on Debian Testing and would appreciate
    some advice regarding a failure scenario that I recently became aware
    of.

    My initial idea is quite simple:

    - Debian Testing
    - rsyslog
    - Log files stored on an external USB SSD
    - The root filesystem should remain as untouched as possible, while
    the SSD receives all log writes.

    While discussing this design elsewhere, someone pointed out an issue
    that I had not considered.

    If the USB SSD is unexpectedly disconnected, the USB bus resets, or the filesystem becomes unmounted for any reason, the mount point directory
    still exists. As I understand it, applications may continue writing to
    that directory, which now belongs to the underlying root filesystem. On
    systems using flash storage, this could eventually wear out the internal storage without immediately being noticed.

    My first thought was to periodically check /proc/mounts (or /proc/self/mountinfo) with a small script and immediately stop rsyslog
    if the filesystem is no longer mounted. This would probably work, but it
    feels like I might be reinventing something that Linux or Debian already provides.

    So my questions are:

    1. Is there a standard or recommended Debian/Linux approach to prevent
    applications from silently writing to the underlying directory after
    a mounted filesystem disappears?
    2. Are there existing mechanisms in systemd, mount units, udev,
    rsyslog, or elsewhere that are intended to handle this situation?
    3. How would you implement a robust solution for this type of logging
    system?

    I'm not looking for a centralized log server in this particular project.
    The goal is simply to make local logging to an external SSD as reliable
    as possible while protecting the root filesystem from unintended writes.

    Any suggestions or references to established best practices would be
    greatly appreciated.

    Thank you very much.

    --
    Marcelo

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Greg Wooledge@3:633/10 to All on Monday, July 27, 2026 14:00:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    On Mon, Jul 27, 2026 at 08:25:40 -0300, Marcelo Laia wrote:
    - Debian Testing
    - rsyslog
    - Log files stored on an external USB SSD
    - The root filesystem should remain as untouched as possible, while the
    SSD receives all log writes.

    If the USB SSD is unexpectedly disconnected, the USB bus resets, or the filesystem becomes unmounted for any reason, the mount point directory
    still exists. As I understand it, applications may continue writing to
    that directory, which now belongs to the underlying root filesystem. On systems using flash storage, this could eventually wear out the internal storage without immediately being noticed.

    My first thought would be to create a subdirectory on the mounted external device, and write the logs to files within that subdirectory.

    If/when the external device goes away, that subdirectory will not
    exist, so you won't be able to create the log files specified in the configuration.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From The Wanderer@3:633/10 to All on Monday, July 27, 2026 14:20:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    On 2026-07-27 at 07:55, Greg Wooledge wrote:
    On Mon, Jul 27, 2026 at 08:25:40 -0300, Marcelo Laia wrote:

    - Debian Testing
    - rsyslog
    - Log files stored on an external USB SSD
    - The root filesystem should remain as untouched as possible, while
    the SSD receives all log writes.

    If the USB SSD is unexpectedly disconnected, the USB bus resets, or
    the filesystem becomes unmounted for any reason, the mount point
    directory still exists. As I understand it, applications may
    continue writing to that directory, which now belongs to the
    underlying root filesystem. On systems using flash storage, this
    could eventually wear out the internal storage without immediately
    being noticed.

    My first thought would be to create a subdirectory on the mounted
    external device, and write the logs to files within that
    subdirectory.

    If/when the external device goes away, that subdirectory will not
    exist, so you won't be able to create the log files specified in the configuration.
    That was my own first thought as well, but it only works if you have
    that much control over the applications that will be writing the files
    (and if they won't automatically create any "missing" directories in the
    path specified for them to write to). I haven't looked at rsyslog
    configuration specifically, this morning, so I don't know whether that consideration would apply in practice.
    The first alternative I've managed to think of would be to look at
    permissions, such that the processes that would be writing the files
    won't have write permission to the underlying directory, only to the
    mounted one. Depending on how the software involved will be configured, however, that could be difficult to adjust - and since this is
    apparently going to be a system-level service (rsyslog), it might kind
    of need some fairly high-end write access, such that this might be
    nontrivial to restrict.
    The only other fallback option that's occurred to me is to mount the
    root filesystem read-only, such that if the mounted writable FS goes
    away, any writes would be rejected for being to a read-only filesystem. Depending on what the situation surrounding this setup is intended to
    be, however, it could be the case that *other* things (external to the
    log daemon) will need to be able to write to the root filesystem - in
    which case that wouldn't be a viable option either.
    --
    The Wanderer
    The reasonable man adapts himself to the world; the unreasonable one
    persists in trying to adapt the world to himself. Therefore all
    progress depends on the unreasonable man. -- George Bernard Shaw


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Ritter@3:633/10 to All on Monday, July 27, 2026 14:30:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    Greg Wooledge wrote:
    On Mon, Jul 27, 2026 at 08:25:40 -0300, Marcelo Laia wrote:
    - Debian Testing
    - rsyslog
    - Log files stored on an external USB SSD
    - The root filesystem should remain as untouched as possible, while the SSD receives all log writes.

    If the USB SSD is unexpectedly disconnected, the USB bus resets, or the filesystem becomes unmounted for any reason, the mount point directory still exists. As I understand it, applications may continue writing to
    that directory, which now belongs to the underlying root filesystem. On systems using flash storage, this could eventually wear out the internal storage without immediately being noticed.

    My first thought would be to create a subdirectory on the mounted external device, and write the logs to files within that subdirectory.

    If/when the external device goes away, that subdirectory will not
    exist, so you won't be able to create the log files specified in the configuration.


    This is the standard approach, and it works very well.

    Example: mount your device at /mnt/logdevice, create
    /mnt/logdevice/logs and use that as the top directory for the
    logs.

    -dsr-

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Nicolas George@3:633/10 to All on Monday, July 27, 2026 14:40:02
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    Marcelo Laia (HE12026-07-27):
    I'm designing a logging system on Debian Testing and would appreciate
    some advice regarding a failure scenario that I recently became aware
    of.

    My initial idea is quite simple:

    - Debian Testing
    - rsyslog
    - Log files stored on an external USB SSD
    - The root filesystem should remain as untouched as possible, while the
    SSD receives all log writes.

    While discussing this design elsewhere, someone pointed out an issue
    that I had not considered.

    If the USB SSD is unexpectedly disconnected, the USB bus resets, or the filesystem becomes unmounted for any reason, the mount point directory
    still exists. As I understand it, applications may continue writing to
    that directory, which now belongs to the underlying root filesystem. On systems using flash storage, this could eventually wear out the internal storage without immediately being noticed.

    My first thought was to periodically check /proc/mounts (or /proc/self/mountinfo) with a small script and immediately stop rsyslog
    if the filesystem is no longer mounted. This would probably work, but it feels like I might be reinventing something that Linux or Debian already provides.

    So my questions are:

    1. Is there a standard or recommended Debian/Linux approach to prevent
    applications from silently writing to the underlying directory after
    a mounted filesystem disappears?
    2. Are there existing mechanisms in systemd, mount units, udev, rsyslog, or elsewhere that are intended to handle this situation?

    systemd can guarantee that the rsyslog service will only run when a
    certain filesystem is mounted. You will need to find your way of twisty
    little directives (Requires, WanteBy, PartsOf?), all alike, but it is
    possible.

    But if the bus or drive has a problem while the filesystem is mounted,
    that will have no effect, as the filesystem does not get unmounted, it
    only goes into I/O error. IIRC, even the device itself does not
    disappear, so a systemd dependency on the device will not work.

    It is probable you get udev events when unplugging a device with a
    mounted filesystem (I do not want to test it right now on my computer),
    I suggest you run `udevadm monitor` and do the experiment. Then you can
    write a rule that stops the service and unmounts the filesystem.

    But then, you might lose logs that were sent during the event. And there
    are logs sent during the event, starting with the logs that tell you
    that the event happened and why. You want those.

    Rather than stopping rsyslog, you probably should mount a tmpfs over it
    and force syslog to reopen its files. Then you can handle the failure,
    repair the drive, remount it, suspend rsyslog, flush the tmpfs to disk
    and resume rsyslog.

    3. How would you implement a robust solution for this type of logging
    system?

    Good question, but not an easy one. Maybe the kernel has some kind of fault-tolerant overlay filesystem. Otherwise, that requires thought.

    Regards,

    --
    Nicolas George

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Nicolas George@3:633/10 to All on Monday, July 27, 2026 14:50:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    The Wanderer (HE12026-07-27):
    That was my own first thought as well, but it only works if you have
    that much control over the applications that will be writing the files

    According to the original statement, that is syslog. If there are other processes logging without going through rsyslog, it makes the issue that
    much difficult.

    The only other fallback option that's occurred to me is to mount the
    root filesystem read-only

    If the OP wants to avoid unwanted writes on the internal devices, I very
    much hope that is the very first thing they did.

    Regards,

    --
    Nicolas George

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Loïc Grenié@3:633/10 to All on Monday, July 27, 2026 15:10:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    On Mon 27 Jul, 2026, at 14:40, Nicolas George wrote:
    The Wanderer (HE12026-07-27):
    That was my own first thought as well, but it only works if you have
    that much control over the applications that will be writing the files

    According to the original statement, that is syslog. If there are other processes logging without going through rsyslog, it makes the issue that
    much difficult.

    The only other fallback option that's occurred to me is to mount the
    root filesystem read-only

    If the OP wants to avoid unwanted writes on the internal devices, I very
    much hope that is the very first thing they did.

    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
    Lo‹c


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Andy Smith@3:633/10 to All on Monday, July 27, 2026 15:30:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    Hi,

    On Mon, Jul 27, 2026 at 08:25:40AM -0300, Marcelo Laia wrote:
    3. How would you implement a robust solution for this type of logging
    system?

    In all honestly I don't find USB storage to be the basis of a reliable
    system and would avoid it if at all possible.

    If the reliability of the logging is what is most important to you then
    logging to redundant storage is what you should be doing. That way you
    have the best chance of it never becoming unavailable.

    What is the basis for the requirement for USB storage?

    Without redundancy it is very hard to reliably handler the unexpected disappearance/failure of block devices, and unexpected
    disappearance/failure is a hallmark of USB storage.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Stefan Monnier@3:633/10 to All on Monday, July 27, 2026 16:00:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    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

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Stefan Monnier@3:633/10 to All on Monday, July 27, 2026 16:10:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    In the same vein, there's also

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

    Or even

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


    === Stefan

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Marcelo Laia@3:633/10 to All on Monday, July 27, 2026 16:30:01
    Subject: Re: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    Hi Andy,

    Thank you for your comments.

    I completely agree that USB storage is not the most reliable solution,
    and if this were a conventional server I would probably choose a
    different architecture.

    The motivation here is a little different. I'm trying to understand how
    Linux behaves when the target filesystem unexpectedly disappears and how
    to prevent applications from silently falling back to the underlying filesystem.

    The USB SSD is simply a convenient and inexpensive way to reproduce that failure mode. The same question could arise with removable SATA devices,
    SD cards, or other storage that may become unavailable unexpectedly.

    Several people have suggested placing the log files inside a
    subdirectory that exists only on the mounted filesystem, which seems
    like a very elegant safeguard. I'm also interested in exploring whether systemd, udev, or the logging daemon itself offer additional mechanisms
    for handling these situations gracefully.

    Thank you again for your observations.

    --
    Marcelo

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Nicolas George@3:633/10 to All on Monday, July 27, 2026 16:30:01
    Subject: Re: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    Marcelo Laia (HE12026-07-27):
    The motivation here is a little different. I'm trying to understand how
    Linux behaves when the target filesystem unexpectedly disappears and how
    to prevent applications from silently falling back to the underlying filesystem.

    As I have said: Linux will not unmount the filesystem and expose the
    directory that served as mount point, it will produce I/O errs on
    filesystem accesses.

    I suggest you test for yourself.

    As for the administrator fumbles and starts the logging without the
    drive, that is an entirely different question, an easily solved one.
    Please keep them separate.

    Regards,

    --
    Nicolas George

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Andy Smith@3:633/10 to All on Monday, July 27, 2026 16:40:01
    Subject: Re: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    Hi,

    On Mon, Jul 27, 2026 at 11:06:13AM -0300, Marcelo Laia wrote:
    The motivation here is a little different. I'm trying to understand how
    Linux behaves when the target filesystem unexpectedly disappears and how
    to prevent applications from silently falling back to the underlying filesystem.

    In practice I don't think that is a problem that happens. If you
    uncleanly yank a storage device, power it off or whatever, it is filesystem-dependent but what tends to happen is:

    - I/O either blocks forever or eventually returns an I/O error
    - I/O errors force the filesystem read-only
    - Later writes fail instantly due to read-only FS, reads may still block
    or return I/O error.

    The filesystem doesn't get unmounted. The block device node itself may
    or may not still be there. Given that rsyslogd would have files open
    inside that broken/missing block device, it is actually very possible
    that you would not then be able to cleanly stop or start rsyslogd from
    then on.

    So this question of, "what if the underlying mount point is exposed?"
    can only really apply either before the filesystem is mounted or if the filesystem becomes cleanly unmounted due to user action. These are
    different problems to device failure.

    Storage redundancy is the correct way to guard against device failure.
    For the misconfiguration case I'd probably look at if there is a systemd dependency type that forcibly stops the rsyslogd service if the specific
    mount unit is not active, but I might not try very hard with this one as
    it's not going to be easy for a user to cleanly unmount such a
    filesystem once rsyslogd is logging to it )it will be in use).

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From nwe@3:633/10 to All on Monday, July 27, 2026 17:40:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    On 7/27/26 9:06 AM, Marcelo Laia wrote:

    The motivation here is a little different. I'm trying to understand how
    Linux behaves when the target filesystem unexpectedly disappears and how
    to prevent applications from silently falling back to the underlying filesystem.

    My observation has been if the target filesystem unexpectedly disappears
    in use, without proper unmounting, it throws write errors rather than
    trying to write to the underlying filesystem. Now if it managed to
    cleanly unmount in the process of disappearing, it might try writing to
    the underlying filesystem.

    Another related angle is when an automatically mounted filesystem does
    not mount at boot and an automatic file backup program starts.

    I just ran into this recently on my workstation. I forgot I'd been
    working on the networking and came back and booted it: no networking. So
    I fixed that and continued working. At this point my nfs file server
    listed in /etc/fstab was not mounted. This machine is due soon for a
    larger ssd, by the way. It is 95% filled.

    I noticed my Deja-dup automatic daily backup was started and gave it no farther thought.

    Soon the application I was running started showing errors: "No more
    space on device" Some quick investigation showed that /home/user/share/backups/workstation-1/ was automatically created by
    deja-dup and started a massive first-time backup.

    In this situation, the fix was relatively easy. I stopped deja-dup,
    confirmed the nfs share is actually not mounted, then deleted everything
    out of /home/user/share

    Next I did (this must be done WITHOUT the share mounted, otherwise you
    are trying to change ownership of the mounted directory):
    sudo chown root:root /home/user/share

    This makes local directory 'share' root owned and nobody else has
    read/write permissions for it. Since deja-dup is not running as root, it
    now stops with 'backup failed' if the share directory did not mount.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From debian-user@3:633/10 to All on Monday, July 27, 2026 17:50:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    Marcelo Laia <marcelolaia@gmail.com> wrote:
    Hello everyone,

    I'm designing a logging system on Debian Testing and would appreciate
    some advice regarding a failure scenario that I recently became aware
    of.

    My initial idea is quite simple:

    - Debian Testing
    - rsyslog
    - Log files stored on an external USB SSD
    - The root filesystem should remain as untouched as possible, while
    the SSD receives all log writes.

    While discussing this design elsewhere, someone pointed out an issue
    that I had not considered.

    If the USB SSD is unexpectedly disconnected, the USB bus resets, or
    the filesystem becomes unmounted for any reason, the mount point
    directory still exists. As I understand it, applications may continue
    writing to that directory, which now belongs to the underlying root filesystem. On systems using flash storage, this could eventually
    wear out the internal storage without immediately being noticed.

    My first thought was to periodically check /proc/mounts (or /proc/self/mountinfo) with a small script and immediately stop rsyslog
    if the filesystem is no longer mounted. This would probably work, but
    it feels like I might be reinventing something that Linux or Debian
    already provides.

    So my questions are:

    1. Is there a standard or recommended Debian/Linux approach to prevent
    applications from silently writing to the underlying directory
    after a mounted filesystem disappears?
    2. Are there existing mechanisms in systemd, mount units, udev,
    rsyslog, or elsewhere that are intended to handle this situation?
    3. How would you implement a robust solution for this type of logging
    system?

    I'm not looking for a centralized log server in this particular
    project. The goal is simply to make local logging to an external SSD
    as reliable as possible while protecting the root filesystem from
    unintended writes.

    Any suggestions or references to established best practices would be
    greatly appreciated.

    Thank you very much.

    What I generally do is just make the mount point read-only. So if the
    mount is not there for some reason, nothing can write to the underlying filesystem in that place.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Joe@3:633/10 to All on Monday, July 27, 2026 17:50:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    On Mon, 27 Jul 2026 11:06:13 -0300
    Marcelo Laia <marcelolaia@gmail.com> wrote:

    Hi Andy,

    Thank you for your comments.

    I completely agree that USB storage is not the most reliable solution,
    and if this were a conventional server I would probably choose a
    different architecture.

    If you are using a small computer booting from a card or similar, most
    will allow the use of a conventional hard drive/SSD as the root
    filesystem. It just complicates the boot a little.

    The motivation here is a little different. I'm trying to understand
    how Linux behaves when the target filesystem unexpectedly disappears
    and how to prevent applications from silently falling back to the
    underlying filesystem.

    That's exactly what a mount point does. The directory must exist, and
    it must continue to exist when nothing is mounted on it. I don't
    believe there are any hooks to allow running a checking script before
    writing to a log, and if there were the logging would be considerably
    slowed down.

    A mount directory will normally be created by root, and will typically
    have root ownership and read-only permissions for anyone else, so only
    if the logging daemon is running as root (one would hope it isn't)
    should it be able to write there with nothing mounted.

    The USB SSD is simply a convenient and inexpensive way to reproduce
    that failure mode. The same question could arise with removable SATA
    devices, SD cards, or other storage that may become unavailable
    unexpectedly.

    You might also give some thought to mounting such a device, as it will
    need to be mounted by device UUID in order to know where it will end
    up. Current Debian unstable will mount a randomly plugged-in USB at /run/media/<your name>/UUID-of-device. Older Debians mount to /media
    rather than /run/media.

    As far as I know, the only way to mount such a device wherever you want
    it is by giving it an entry in /etc/fstab, still using the UUID. If you
    do this and use the systemd automounter, also mark it noauto or else if
    it's not there, boot will hang. It will be automounted at first access.

    But you can't just pick a random USB stick out of a box of them and get
    it mounted where the logging daemon will find it.

    Several people have suggested placing the log files inside a
    subdirectory that exists only on the mounted filesystem, which seems
    like a very elegant safeguard. I'm also interested in exploring
    whether systemd, udev, or the logging daemon itself offer additional mechanisms for handling these situations gracefully.


    Doubtful. They will usually log to somewhere in /var/log, either in the
    root filesystem or on a separate partition permanently mounted on the
    root /var/log. Nothing stops you from moving the logs elsewhere, but I
    wouldn't expect the daemons to deal with a missing mounted destination.

    If you want to offload logging (or the rest of /var, some of which
    is written to frequently) you would be best using a dedicated drive
    mounted at boot by /etc/fstab, and never disconnected.

    --
    Joe

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From nwe@3:633/10 to All on Monday, July 27, 2026 17:50:02
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    correction:

    On 7/27/26 10:39 AM, nwe wrote:
    This makes local directory 'share' root owned and [nobody else has read/write permissions] for it. Since deja-dup is not running as root,
    it now stops with 'backup failed' if the share directory did not mount.

    nobody else has write permissions

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Charles Curley@3:633/10 to All on Monday, July 27, 2026 19:00:02
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    On Mon, 27 Jul 2026 16:46:25 +0100
    Joe <joe@jretrading.com> wrote:

    But you can't just pick a random USB stick out of a box of them and
    get it mounted where the logging daemon will find it

    mount /dev/sdXY /wherever/I/want/it

    And you can automate that sort of thing by adding it to /etc/fstab:

    LABEL=installer /media/installer vfat rw,noauto,user,exec,async,lazytime,noatime 0 0

    --
    Does anybody read signatures any more?

    https://charlescurley.com
    https://charlescurley.com/blog/

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Max Nikulin@3:633/10 to All on Tuesday, July 28, 2026 06:00:01
    Subject: Re: Preventing writes to the underlying directory when a mounted filesystem disappears

    On 27/07/2026 9:37 pm, Andy Smith wrote:
    On Mon, Jul 27, 2026 at 11:06:13AM -0300, Marcelo Laia wrote:
    The motivation here is a little different. I'm trying to understand how
    Linux behaves when the target filesystem unexpectedly disappears and how
    to prevent applications from silently falling back to the underlying
    filesystem.

    In practice I don't think that is a problem that happens.

    I would not be surprised if behavior of udisks (that is often involved
    in the case of USB drives) has some specifics in comparison to
    /etc/fstab entries or to calling mount directly. On the other hand, a directory for logging should not be handled by udisks.

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)