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 2026224 - parted reports the type of the fake MBR partition table, created by dosfstools-4.2, as "loop"
Summary: parted reports the type of the fake MBR partition table, created by dosfstool...
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:57 UTC by Laszlo Ersek
Modified: 2021-12-03 00:26 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:26:14 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2026220 1 unspecified CLOSED parted fails to parse the fake MBR partition table created by dosfstools-4.2 for FAT12 images 2021-12-03 00:55:02 UTC
Red Hat Issue Tracker RHELPLAN-103793 0 None None None 2021-11-24 06:59:10 UTC

Internal Links: 1931821 2026220

Description Laszlo Ersek 2021-11-24 06:57:27 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).

In case the chosen FAT variant is FAT16 or FAT32, parted manages to parse the partition table, and prints the one entry in the table correctly. However, parted incorrectly reports the partition table type as "loop", rather than "msdos".

*** 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 255M image
    mkfs.fat -F 16 --mbr=yes image
    parted -m -s -- image unit b print 

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

*** Actual results:

parted prints the following:

(1)

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

(2)

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

Note "loop" in both outputs.

*** Expected results:

Create a "normal" partition table:

  rm -f image
  fallocate -l 255M image
  fdisk image
    Command (m for help): n
    Select (default p): p
    Partition number (1-4, default 1): 1
    First sector ...: [accept default]
    Last sector ...: [accept default]

  Command (m for help): w

List it with "parted":

parted -m -s -- image unit b print

Output:

BYT;
/root/image:267386880B:file:512:512:msdos::;
1:1048576B:267386879B:266338304B:::;

Note that the device line contains "msdos", not "loop".

Comment 1 Brian Lane 2021-12-03 00:26:07 UTC
loop is correct, parted it detecting the filesystem at the start of the disk. It isn't a valid msdos disk, you can't partition it any further without damage, and it isn't even a valid MBR -- it just happens to fit into some extra space in the first 512 bytes of the filesystem. It's safer to treat it as a loop mountable device/image than a real msdos disk.

Comment 2 RHEL Program Management 2021-12-03 00:26:14 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.