Cant execute script as root

You can work around this by creating two more units.

  • mount unit - define the mountpoint (do no enable)
  • automount unit - mount when mountpoint is accessed

This will simplify your script - remove the mount check - just access the path with the script - mounting is done by the automount and is unmounted again after predefined idle time.

This is error prone - systemd does not guarantee that a given device is always assigned the same device id, in this case sda.

You have other safer options - like label and uuid - where uuid is the safest identifier

/dev/disk/by-label/<label>
/dev/disk/by-uuid/<uuid>