I thank you a lot in advance, but these are not a solution for me.....can somebody help with a real soution...for Pascal Lazarus code??
I cannot say anything about how to do it under Linux because I have no idea how's it's done on that OS.
On Windows, detecting/monitoring disk read/writes as they happen, which is what is needed to implement the led you want, requires a ring 0 device driver. The Diskmon.exe program I linked to in my previous post contains 2 device drivers (as resources) which it loads dynamically to collect disk activity.
For a device driver, forget Lazarus. In FPC, you can specify the application type as "native" which is what you need to implement a driver but, I haven't seen anywhere the Pascal definitions (ring 0 APIs and data structures) you need to implement a driver.
IOW, while it is likely possible to implement the activity led you want using FPC, it is definitely not practical to go that route.
Under Windows, unless you are willing to write a device driver, forget implementing a led to show disk activity.