-
Notifications
You must be signed in to change notification settings - Fork 43
Better disk detection #1513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Better disk detection #1513
Conversation
|
Required keyword not found in PR title or description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 files reviewed, 7 comments
| // => If this code runs into trouble in the future we might need to migrate to a better detection mechanism | ||
| // However lsblk -o NAME,MAJ:MIN,TYPE is not too helpful, as the type is not useful to use | ||
| // (resolves to sysfs virtual / physical classification) | ||
| // but especially the dynamic devive block mapper might contain unknown disk we want to track or exclude |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'devive' is misspelled
| // but especially the dynamic devive block mapper might contain unknown disk we want to track or exclude | |
| // but especially the dynamic device block mapper might contain unknown disk we want to track or exclude |
| // => If this code runs into trouble in the future we might need to migrate to a better detection mechanism | ||
| // However lsblk -o NAME,MAJ:MIN,TYPE is not too helpful, as the type is not useful to use | ||
| // (resolves to sysfs virtual / physical classification) | ||
| // but especially the dynamic devive block mapper might contain unknown disk we want to track or exclude |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'devive' is misspelled
| // but especially the dynamic devive block mapper might contain unknown disk we want to track or exclude | |
| // but especially the dynamic device block mapper might contain unknown disk we want to track or exclude |
| } | ||
|
|
||
| if (minor_number % 16 != 0) { | ||
| fprintf(stderr, "Partion inside a docker container found. This should not happen: %u:%u rbytes=%llu wbytes=%llu\n", major_number, minor_number, rbytes, wbytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Partion' is misspelled
| fprintf(stderr, "Partion inside a docker container found. This should not happen: %u:%u rbytes=%llu wbytes=%llu\n", major_number, minor_number, rbytes, wbytes); | |
| fprintf(stderr, "Partition inside a docker container found. This should not happen: %u:%u rbytes=%llu wbytes=%llu\n", major_number, minor_number, rbytes, wbytes); |
|
|
||
| ///////////////////// Guideline /////////////////////////// | ||
| // This code should only detect non-partitions and only the main disk, as this is where data is effectively stored | ||
| // This includes network storage as well (as in the end a phyiscal disk is somewhere) - Thus the physical / virtual |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'phyiscal' is misspelled
| // This includes network storage as well (as in the end a phyiscal disk is somewhere) - Thus the physical / virtual | |
| // This includes network storage as well (as in the end a physical disk is somewhere) - Thus the physical / virtual |
|
|
||
| ///////////////////// Guideline /////////////////////////// | ||
| // This code should only detect non-partitions and only the main disk, as this is where data is effectively stored | ||
| // This includes network storage as well (as in the end a phyiscal disk is somewhere) - Thus the physical / virtual |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'phyiscal' is misspelled
| // This includes network storage as well (as in the end a phyiscal disk is somewhere) - Thus the physical / virtual | |
| // This includes network storage as well (as in the end a physical disk is somewhere) - Thus the physical / virtual |
Additional Comments (2)
|
|
Eco CI Output [RUN-ID: 20805776361]: 🌳 CO2 Data: Total cost of whole PR so far:
|
|||||||||||||||||||||||||||||||||||
|
tested on my machine, worked fine |
Greptile Overview
Greptile Summary
Enhanced disk device detection by adding support for NVMe devices (major 259) and additional device mapper ranges (251-254), plus added
lspciandlsblkcommands to hardware info collection for better debugging.lspciandlsblkto hardware info for better system visibilityIssues found: