Updated: 26 November 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

auditd can record every mount and unmount, with the user who did it. These steps are for Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 (install with dnf install audit or apt install auditd).

  1. Check that auditd runs: systemctl status auditd.
  2. Create /etc/audit/rules.d/mount.rules:
-a always,exit -F arch=b64 -S mount -S umount2 -k mount
-a always,exit -F arch=b32 -S mount -S umount -S umount2 -k mount
-w /usr/bin/mount -p x -k mount
-w /usr/bin/umount -p x -k mount
  1. Load the rules: augenrules --load, and list them with auditctl -l.
  2. Test it: mount and unmount something, then search the log: ausearch -k mount -i.

The -w lines also catch the mount command on newer systems (such as Ubuntu 24.04) that use the newer mount system calls. For a summary, run aureport -k.

Note: Rules in /etc/audit/rules.d/ survive reboots; rules added with auditctl alone do not.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $131.99 a month.

Was this answer helpful?

Still stuck? Open a ticket