Updated: 28 September 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).
- Check that auditd runs:
systemctl status auditd. - 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
- Load the rules:
augenrules --load, and list them withauditctl -l. - 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.
Ucartz services for this topic
- 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.
- Linux server management: hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.
