def METHOD_NAME(self, filename: str) -> None:
    """
    Export entries, respect canonical mount order
    :param string filename: path to file name
    """
    fstab_entries_by_path = {}
    for entry in self.fstab:
        fstab_entries_by_path[entry.mountpoint] = entry
    with open(filename, 'w') as fstab:
        for device_path in Path.sort_by_hierarchy(
            sorted(fstab_entries_by_path.keys())
        ):
            entry = fstab_entries_by_path[device_path]
            fstab.write(
                self._file_entry(entry) + os.linesep
            )