Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2180041

Summary: ReaR fails while verifying the disklayout when a disk has a 0 size
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: rearAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED MIGRATED QA Contact: CS System Management SST QE <rhel-cs-system-management-subsystem-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.7CC: casantos, ovasik, pcahyna
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-22 03:24:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Renaud Métrich 2023-03-20 15:39:27 UTC
Description of problem:

When plugging in a USB multi-card reader (SD / MicroSD) which has no card insert, the device (/dev/sda) has a 0 size.
This leads to layout verification to fail:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
No partition label type for 'disk /dev/sda' (may cause 'rear recover' failure)
/dev/sda size 0 is not a positive integer
ERROR: 
====================
BUG in /root/rear/usr/share/rear/layout/save/default/950_verify_disklayout_file.sh line 254:
'Entries in /root/rear/var/lib/rear/layout/disklayout.conf are broken ('rear recover' would fail)'
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This happens when AUTOEXCLUDE_DISKS=n (which is not the default).

The root cause is the code snippet in /usr/share/rear/layout/save/GNU/Linux/200_partition_layout.sh, which doesn't skip disks with $devsize == 0 :
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
415                 devsize=$(get_disk_size ${disk#/sys/block/})
416                 disktype=$(parted -s $devname print | grep -E "Partition Table|Disk label" | cut -d ":" -f "2" | t    r -d " ")
 :
430                     echo "disk $devname $devsize $disktype"
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

This leads to creating entry disk sda 0, which is invalid entry (missing $disktype).

I think the solution is to skip those 0 size disks completely.

Version-Release number of selected component (if applicable):

rear-2.6+

How reproducible:

Always, see above.

Comment 1 Pavel Cahyna 2023-03-20 16:04:32 UTC
Looks similar to https://github.com/rear/rear/issues/2810, but that one appeared only with new code added in ReaR 2.7 (PR https://github.com/rear/rear/pull/2804), while this happens with ReaR 2.6.

In that issue we were not able to get details of the USB device. @rmetrich can you please provide details about the USB device (lsusb output)?

Comment 2 Pavel Cahyna 2023-03-21 16:48:31 UTC
USB device details:
Bus 002 Device 007: ID 8564:4000 Transcend Information, Inc. microSD/SD/CF UHS-II Card Reader [RDF8, RDF9]

Comment 3 RHEL Program Management 2023-09-22 03:21:33 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-09-22 03:24:41 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.