When I attach a disk to FreeBSD I can list any attached disks by doing:
[root@freenas] ~# sysctl kern.disks kern.disks: xbd2 xbd1 ada0 [root@freenas] ~#
How can I then find out the size of each attached disk?
diskinfo -v ada0 if you just want to see disk size.
If you want to use this info in some script, you can parse
sysctl -n kern.geom.confxml output.
Geometry of each disk can be shown by
fdisk ada0 utility.
Disks used for filesystems are shown by
mount with no args.
Accessible capacity of the filesystem on a disk can be viewed by
df -h <filesystem>