summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/inc/parser.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/statistics/inc/parser.inc.php')
-rw-r--r--modules-available/statistics/inc/parser.inc.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules-available/statistics/inc/parser.inc.php b/modules-available/statistics/inc/parser.inc.php
index d697c733..bdf021a6 100644
--- a/modules-available/statistics/inc/parser.inc.php
+++ b/modules-available/statistics/inc/parser.inc.php
@@ -199,6 +199,12 @@ class Parser {
} elseif (preg_match('/^Logical sector size:\s*(\d+)/i', $line, $out)) {
// --- GPT: Line that tells us the logical sector size used everywhere ---
$sectorToMbFactor = $out[1] / (1024 * 1024);
+ } elseif (isset($hdd) && preg_match('/^First usable sector.* is (\d+)$/i', $line, $out)) {
+ // --- Some fdisk versions are messed up and report 2^32 as the sector count in the first line,
+ // but the correct value in the "last usable sector is xxxx" line below ---
+ if ($out[1] > $hdd['sectors']) {
+ $hdd['sectors'] = $out[1];
+ }
} elseif (isset($hdd) && $mbrToMbFactor !== 0 && preg_match(',^/dev/(\S+)\s+.*\s(\d+)[\+\-]?\s+(\d+)[\+\-]?\s+\d+[\+\-]?\s+([0-9a-f]+)\s+(.*)$,i', $line, $out)) {
// --- MBR: Partition entry ---
// Some partition