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 2026220 - parted fails to parse the fake MBR partition table created by dosfstools-4.2 for FAT12 images
Summary: parted fails to parse the fake MBR partition table created by dosfstools-4.2 ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: parted
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Brian Lane
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-24 06:42 UTC by Laszlo Ersek
Modified: 2021-12-03 00:54 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-03 00:54:36 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2026224 1 unspecified CLOSED parted reports the type of the fake MBR partition table, created by dosfstools-4.2, as "loop" 2021-12-03 00:27:03 UTC
Red Hat Issue Tracker RHELPLAN-103792 0 None None None 2021-11-24 06:43:59 UTC

Internal Links: 1931821 2026224

Description Laszlo Ersek 2021-11-24 06:42:45 UTC
*** Description of problem:

In dosfstools-4.2 a new option appeared, called "--mbr". Under circumstances that matter much to libguestfs, namely when the disk being formatted is (a) non-removable and (b) unpartitioned (that is, a whole disk, not a partition), the "--mbr" option defaults to "yes". (For the sake of the reproducer below, we'll use an explicit "--mbr=yes".) When this option is in effect, "mkfs.fat" overlays the first sector of the medium (the FAT boot sector) with a bogus MBR partition table. The table has one entry, and it describes a partition that spans the entire disk, covering the partition table itself, resident in the first sector of the medium. This is supposed to placate Windows (otherwise Windows does not recognize the FAT filesystem on a non-removable device), and to work with Linux utilities as well (the kernel itself, and blkid, and so on). However, in case the chosen FAT variant is FAT12, parted rejects the partition table with the error message "Invalid partition table - recursive partition".

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

- parted-3.4-6.el9.x86_64
  (it should reproduce with upstream parted too, as of commit b20227adf575)

- dosfstools-4.2-3.el9.x86_64

*** How reproducible:

Always.

*** Steps to Reproduce:

(1) rm -f image
    fallocate -l 1M image
    mkfs.fat --mbr=yes image
    parted -m -s -- image unit b print 

(2) rm -f image
    fallocate -l 255M image
    mkfs.fat -F 12 --mbr=yes image
    parted -m -s -- image unit b print 

(In both cases, FAT12 is used. In the first case, "mkfs.fat" picks FAT12 automatically, based on the size of the image. In the second case, we force FAT12.)

*** Actual results:

parted prints the following:

(1)

(stderr) Error: Invalid partition table - recursive partition on /root/image.
(stdout) BYT;
(stdout) /root/image:1048576B:file:512:512:unknown::;

(2)

(stderr) Error: Invalid partition table - recursive partition on /root/image.
(stdout) BYT;
(stdout) /root/image:267386880B:file:512:512:unknown::;

and parted exits with status 1. No partition information is listed.

*** Expected results:

In case (2), the disk image (255MB) is large enough for us to force either FAT16 or FAT32 (passing "-F 16" and "-F 32" to "mkfs.fat", respectively). In those cases, the partition output is [almost] as expected:

(2 / FAT16)

(stdout) BYT;
(stdout) /root/image:267386880B:file:512:512:loop::;
(stdout) 1:0B:267386879B:267386880B:fat16::;

(2 / FAT32)

(stdout) BYT;
(stdout) /root/image:267386880B:file:512:512:loop::;
(stdout) 1:0B:267386879B:267386880B:fat32::;

(And exit status 0 in both sub-cases.)

The same kind of output is expected with FAT12 as well.

Note: where I wrote "[almost] as expected" above, I alluded to the *separate bug* that "parted" prints the partition table *type* as "loop", instead of "mbr". I'm going to file a separate BZ about that.

Comment 1 Brian Lane 2021-12-03 00:54:29 UTC
This is because parted doesn't support detecting FAT12, which is basically a failure to detect FAT16 or 32, so it would end up causing false positives. And then it tries to parse the fake, invalid, msdos partition and complains.

Comment 2 RHEL Program Management 2021-12-03 00:54:36 UTC
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.


Note You need to log in before you can comment on or make changes to this bug.