Method to test if disks in system are formatted
Depending on how you access the drives, you could use blkid -o list
(deprecated) on them and then parse the output.
The command outputs, among other things, a fs_type label column, that shows the filesystem.
blkid -o list
has been superseded be lsblk -f
.