Platform-Specific Notes
While disk-burnin.sh
is a POSIX-compliant script designed for broad compatibility, certain operating systems have specific requirements or produce unique behaviors that users should be aware of.
FreeBSD / FreeNAS
Users running the script on FreeBSD-based systems, including TrueNAS (formerly FreeNAS), must perform an additional step before execution.
Kernel Geometry Debug Flags
To allow badblocks
to write to the entire disk, you must first alter the kernel's geometry debug flags using the sysctl
command. This is a temporary change that allows low-level write access to the whole device, bypassing certain safeguards.
Execute the following command as root before running the script:
sysctl kern.geom.debugflags=0x10
This setting will reset on the next reboot. If you are testing multiple drives sequentially, you only need to run this command once per session.
set_o_direct
Warning
When running badblocks
on FreeBSD or FreeNAS, you may see the following warning message:
set_o_direct: Inappropriate ioctl for device
This warning can be safely ignored. It is related to differences in how direct I/O is handled between Linux and FreeBSD and does not affect the validity or thoroughness of the disk test.
sed
Compatibility
The script internally handles differences between the GNU sed
found on Linux and the BSD sed
found on FreeBSD. The cleanup_log
function uses slightly different command flags (sed -i -e
vs. sed -i '' -e
) to ensure log file cleanup works correctly on both platforms. This is handled automatically and requires no user intervention.