In order to support barriers, the underlying disk device must support flushing its cache, and preferably a write-through mode as well.
SCSI/SAS drives allow writes (and reads) to specify force unit access (FUA), which directly accesses the disk media without using the cache—what's commonly called write-through. They also support a SYNCHRONIZE CACHE call that flushes the entire write cache out to disk.
Early IDE drives implemented a FLUSH CACHE call and were limited to 137 GB in size. The ATA 6 specification added support for larger drives at the same time it introduced the now mandatory FLUSH CACHE EXT call. That's the command you send to a drive that does what filesystems (and the database) want for write cache ...