Mount the flash partition (not necessary but... )
mount -o remount,rw /flash
Normally the external HDD is automatically mounted by LibreELEC, so you just need to format is using ext4 partition datatype
umount /dev/sda2 # check which partition was mounted automatically - `df -h`
mkfs.ext4 /dev/sda –L ExternalData
Reboot the system and the external HDD will be automatically mounted on `/var/media/ExternalData