I can see this on my digital ocean (I see same output on SSD and NVM disks). I don't have HDD disks to check the output. Can you please tell me what output I would get to identify disk type based on rotation rateSo all you want to know: "spinning rust" versus "silly con"? Easiest thing to do: "camcontrol identify" on /dev/adaX, then grep the result for "RPM", and check whether you see a number or "non-rotating". I don't have a SCSI disk handy, so I can't tell you what to look in the output of "camcontrol modepage /dev/xxx -m 4". No packages required, these are all built-in commands.
root@mfsbsd:~ # camcontrol modepage /dev/da0 -m 4
Number of Cylinders: 16383
Number of Heads: 16
Starting Cylinder-Write Precompensation: 16383
Starting Cylinder-Reduced Write Current: 16383
Drive Step Rate: 200
Landing Zone Cylinder: 16777215
RPL: 0
Rotational Offset: 0
Medium Rotation Rate: 5400
root@mfsbsd:~ # camcontrol modepage /dev/ada0 -m 4
camcontrol: mode sense command returned error
That is sort of a silly question. What you are dealing with at a cloud or hosting provider is not a real disk. I don't know how these two companies implement their virtual disk, but guessing from how others do it, they probably use RAID technology underneath to guard against disk failure, then a file system (could be a lightweight one), probably with some snapshot support, and then a disk virtualization layer. The hardware is probably a mix of spinning disks (which still have the best $/capacity and $/throughput) plus SSD/flash/NVRAM for low-latency IOs.Ok, but how to identify its HDD or SSD. does HDD disk also give Medium Rotation Rate: 5400? if i run camcontrol modepage /dev/da0 -m 4. if HDD doesnt have rotation rate or any other property from camcontrol command as compared to SSD then my problem will be solved. so please tell me what i would get if i run camcontrol modepage /dev/da0 -m 4 for HDD disks?
smartctl -x /dev/ada0 | grep Solid
What exactly You mean when say “cache configuration” ? ZFS / UFS with some special settings ?if i found SSD/NVM then i need to create cache configuration
#!/bin/sh
ALL_DISKS=$( sysctl -n kern.disks )
for i in ${ALL_DISKS}; do
trim=$( diskinfo -v ${i} 2>/dev/null | grep TRIM | awk '{printf $1}' )
case "${trim}" in
Yes)
storage_type="ssd"
;;
No)
storage_type="hdd"
;;
*)
storage_type="unknown"
;;
esac
echo "${i} type: ${storage_type}"
done
zpool iostat -lv
- look at syncq_wait read (drives can’t cheat on reads). Spinning rust will be a handful of ms; SSDs will be 10s of us.