Here's my version, modified from above. Since I don't know the exact date the system was booted (for testing this it was 27 days ago), and I don't know which kern.log contains the data I need (some may be gzipped on my system), I use uptime and date to calculate an approximate system boot date (to the day, anyway), then use zgrep to search through all available kern.log files.

I also slightly modified the second grep statement, since it will now also show an ATAPI CD/DVD drive as well as ATA-* drives.

It could still use refinement (i.e. if system uptime is greater than a year), but should work OK for now.