/mnt/hdd is an ExFAT filesystem, which does not actually have a concept of Unix-style file ownerships nor permissions, and so cannot store them. This is why your
chown command is failing.
The ownerships and permissions displayed by
ls -l are actually created on-the-fly by the
exfat-fuse driver according to the mount options. Since the default list of mount options includes
allow_other, the driver is currently allowing full access to all the files and directories in this filesystem to any user on the system.
You could use the
id www-data command to display the user and group ID numbers of the
www-data user. If the
www-data has UID of 33 and primary GID of also 33, you could change your
/etc/fstab line to:
/dev/sda1 /mnt/hdd exfat-fuse default_permissions,allow_root,uid=33,gid=33,nosuid,nodev,relatime,blksize=4096 0 0
Then unmount & re-mount the filesystem:
Now all the file and directory ownerships and permissions in the
/mnt/hdd filesystem should have changed.
Note that this kind of Unix ownership and permission emulation for filesystems that don't have the capability to store Unix-style ownership/permission information is restricted to what you can specify with mount options: usually, it means that all the files and all the directories in that filesystem will have a single, fixed set of ownership/permission settings and they cannot be changed with
chmod commands at all. If this is too inflexible for you, I'm afraid the only option would be to use another filesystem type.
It this is a temporary setup, using an ExFAT filesystem to hold web server data (as indicated by the username
www-data) might be fine. But if this is supposed to be a permanent setup, you should seriously consider reformatting
/dev/sda1 to another filesystem type that allows native Unix-style file ownerships and permissions before starting to use it.