Same HDD twice in SMART Status
-
This is just a cosmetic one I guess.
I'm using an old Dell D620 as test machine for my beta install. The same HDD shows up twice in SMART Status.[2.2-BETA][root@beta]/root: mount /dev/ada0s1a on / (ufs, local, noatime)
-
Probably a side effect of it showing under it's current AHCI name (adaX) and the older one. IIRC FreeBSD ads them as symlinks to make upgrades smoother, otherwise people whose disks moved from ad to ada would have failed on reboot.
lrwxr-xr-x 1 root wheel 4 Oct 31 12:07 /dev/ad4 -> ada0 lrwxr-xr-x 1 root wheel 6 Oct 31 12:07 /dev/ad4s1 -> ada0s1 lrwxr-xr-x 1 root wheel 7 Oct 31 12:07 /dev/ad4s1a -> ada0s1a lrwxr-xr-x 1 root wheel 7 Oct 31 12:07 /dev/ad4s1b -> ada0s1b crw-r----- 1 root operator 0x55 Oct 31 12:07 /dev/ada0 crw-r----- 1 root operator 0x58 Oct 31 12:07 /dev/ada0s1 crw-r----- 1 root operator 0x5c Oct 31 12:07 /dev/ada0s1a crw-r----- 1 root operator 0x5e Oct 31 12:07 /dev/ada0s1b
the SMART status could probably check to see if the device node is a symlink before printing.
-
In FreeBSD 8.3 when using ahci(4), the drive name changed (from ad4 to ada0 for example). Now with 10.1, it seems both nodes are populated in /dev. Not sure what to do about that.
I do see this line in dmesg:
Oct 31 07:23:05 pfsense kernel: ada0: Previously was known as ad4
This is the line that populates the devices for SMART (similar one for the widget):
[2.2-BETA][root@pfsense.localdomain]/var/log: grep grep /usr/local/www/diag_smart.php exec("ls /dev | grep '^\(ad\|da\|ada\)[0-9]\{1,2\}$'", $devs);
-
Just pushed a fix for this, should be OK in the next new snapshot after this message.
-
Thanks for looking into this. I have applied the changes in
https://github.com/pfsense/pfsense/commit/ea20169a38b555288416cdcbd86d4cd83b380b8b
by hand for now. Will update to a newer snapshot tomorrow.
The duplicate HDD is gone but it finds the notebooks CD drive now:
-
IMO the check for which disk names to match is not comparing the result of preg_match quite right.
I think this change will make it better: https://github.com/pfsense/pfsense/pull/1330
Can you try that and confirm it now displays just the SMART-capable disk? -
Great, thanks! The CD drive is gone, only ada0 shows up now.
-
Should be merged in now. Must have got the return mixed up with strpos when I wrote that test. Someday PHP needs to make such things more standardized. Or perhaps we'll have rewritten everything in another language by the time that happens. :p