From 066e436ece1794b8983a1aed5c96eb3ea080509c Mon Sep 17 00:00:00 2001 From: David Asulin Date: Thu, 14 Aug 2025 12:10:01 +0300 Subject: [PATCH 1/2] fix: only mark non-rotational HDDs as SSD Fixes sr0 incorrectly showing as SSD on RHCOS 4.19. Signed-off-by: David Asulin --- pkg/block/block_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/block/block_linux.go b/pkg/block/block_linux.go index 3542bd72..f4cfc0e9 100644 --- a/pkg/block/block_linux.go +++ b/pkg/block/block_linux.go @@ -331,7 +331,7 @@ func disks(ctx *context.Context, paths *linuxpath.Paths) []*Disk { driveType, storageController := diskTypes(dname) // TODO(jaypipes): Move this into diskTypes() once abstracting // diskIsRotational for ease of unit testing - if !diskIsRotational(ctx, paths, dname) { + if !diskIsRotational(ctx, paths, dname) && driveType == DRIVE_TYPE_HDD { driveType = DRIVE_TYPE_SSD } size := diskSizeBytes(paths, dname) From 7ba525399f23b76c3daf38c26f153d71784332ae Mon Sep 17 00:00:00 2001 From: David Asulin Date: Thu, 14 Aug 2025 14:34:35 +0300 Subject: [PATCH 2/2] Add comment to explain the change in behaviour Signed-off-by: David Asulin --- pkg/block/block_linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/block/block_linux.go b/pkg/block/block_linux.go index f4cfc0e9..6399317a 100644 --- a/pkg/block/block_linux.go +++ b/pkg/block/block_linux.go @@ -331,6 +331,9 @@ func disks(ctx *context.Context, paths *linuxpath.Paths) []*Disk { driveType, storageController := diskTypes(dname) // TODO(jaypipes): Move this into diskTypes() once abstracting // diskIsRotational for ease of unit testing + // Only reclassify HDD to SSD if non-rotational to avoid changing already correct types. + // This addresses changed kernel behavior where rotational detection may be unreliable, + // where some kernels report CD-ROM drives as non-rotational, incorrectly classifying them as SSD. if !diskIsRotational(ctx, paths, dname) && driveType == DRIVE_TYPE_HDD { driveType = DRIVE_TYPE_SSD }