Hello!
I've been operating a Fortimail as a VM now for a little over a year, and I'm wondering if there's any way to issue any 'TRIM' commands to the virtual drives to keep the underlying storage freed up? I'm very interested if there's a way to script it and run a cron job, or if there's a built in feature to do this already.
Can anyone elaborate?
Thanks!! :)
Hello DrKrieger01,
Thank you for using the Community Forum. I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible.
Thanks,
Hello,
We are still looking for an answer to your question.
We will come back to you ASAP.
Thanks,
Hello again DrKrieger01,
I found this solution. Can you tell us if it helps, please?
TRIM commands are typically used in SSDs to inform the drive which blocks of data are no longer considered in use and can be wiped internally. When it comes to virtual machines (VMs), the ability to issue TRIM commands can depend on the underlying storage and the virtualization platform you are using.
Virtual Environment: Ensure that your virtualization platform (such as VMware, Hyper-V, or KVM) supports TRIM commands. Some platforms pass these commands directly to the underlying storage.
File System Support: The file system used within your Fortimail VM must also support TRIM. For example, ext4 and Btrfs on Linux support TRIM.
Scripting TRIM: You can typically issue TRIM commands using the fstrim
command in Linux. You can script this command and set it to run as a cron job. Here’s a basic example:
#!/bin/bash
fstrim -v /
Save this script as trim.sh
, make it executable with chmod +x trim.sh
, and then add it to your crontab:
crontab -e
Add a line like this to run it weekly:
0 2 * * 0 /path/to/trim.sh
This example runs the TRIM command every Sunday at 2 AM.
Built-in Features: Some systems may have built-in features to periodically run TRIM, but this varies by configuration. Check the documentation for your specific Fortimail version and the underlying OS.
I'm unable to run these commands directly in the Fortimail console; I suspect there's only a limited command list due to the system being a modified Unix/Linux distro.
When I try and run any of these commands, I get a parsing error.
I've even tried 'exec fstrim -v /', but it also throws a parsing error at 'fstrim'.
Is there a command that I can run to get me into the actual Unix/Linux command line environment, not the limited command shell of the Fortimail system?
User | Count |
---|---|
2546 | |
1354 | |
795 | |
643 | |
455 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.