See here an example of a custom Linux mount script, written in Python, that can be used to mount disks with /etc/fstab. The mount script is installed at /usr/bin/ and is executable.

#!/usr/bin/env python3

import sys
import subprocess

device = sys.argv[1]
mount_point = sys.argv[2]
options = sys.argv[4]

# Any customization could be done here to the `mount` command that is run.
mount_command = ['mount', '-o', options, device, mount_point]

output =

if output.returncode != 0:
	print("error mounting")

See here how the custom script can then be used in /etc/fstab like any “normal” mount.

/dev/sdX /mnt/my-mount my-command defaults,nofail 0 0