-
Bug
-
Resolution: Unresolved
-
Minor
-
rhel-10.0
-
None
-
util-linux-2.40.2-14.el10
-
No
-
Low
-
rhel-base-utils-core
-
ssg_core_services
-
22
-
22
-
0
-
False
-
False
-
-
No
-
None
-
Requested
-
None
-
Unspecified Release Note Type - Unknown
-
Unspecified
-
Unspecified
-
Unspecified
-
None
What were you trying to do that didn't work?
I have a disk that was formatted as a FAT filesystem. I created two DOS partitions using fdisk on it:
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS vdb 253:16 0 10G 0 disk ├─vdb1 253:17 0 5G 0 part └─vdb2 253:18 0 5G 0 part
fdisk shows these two partitions properly:
# fdisk -l /dev/vdb Disk /dev/vdb: 10 GiB, 10737418240 bytes, 20971520 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000 Device Boot Start End Sectors Size Id Type /dev/vdb1 2048 10485759 10483712 5G 83 Linux /dev/vdb2 10485760 20971519 10485760 5G 83 Linux
but parted does not even show the partition table (it says that the partition table is loop, not msdos and lists one single FAT partition):
# parted /dev/vdb GNU Parted 3.6 Using /dev/vdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Model: Virtio Block Device (virtblk) Disk /dev/vdb: 10.7GB Sector size (logical/physical): 512B/512B Partition Table: loop Disk Flags: Number Start End Size File system Flags 1 0.00B 10.7GB 10.7GB fat32
Similarly blkid:
# blkid /dev/vdb /dev/vdb: LABEL_FATBOOT="ephemeral0" LABEL="ephemeral0" UUID="6FC7-A4A5" BLOCK_SIZE="512" TYPE="vfat"
I investigated and the reason for this inconsistency seems to be "leftovers" of the FAT file system superblock in the MBR. Using the 'o' command of fdisk (create a new empty DOS partition table) before creating the partitions avoids the issue.
Note though that when fdisk starts, it prints this:
The device contains 'vfat' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
So I should not be expected to use the 'o' command. The wiping of the signature should happen automatically.
In RHEL 8 and RHEL 7 the actual behavior is the same, but fdisk at least does not pretend that it will do it when it will not.
What is the impact of this issue to you?
It results in a disk that some parts of the system (fdisk, kernel) interpret differently than other parts of the system (parted, blkid). This can lead to very confusing behavior, as one usually repartitions disks using fdisk, but parted is often used in automated scripts.
Please provide the package NVR for which the bug is seen:
util-linux-2.37.4-21.el9.x86_64 util-linux-2.40.2-10.el10.x86_64
How reproducible is this bug?:
well reproducible
Steps to reproduce
- 1minutetip --flavor ci.m1.medium.ephemeral -n rhel9
- in the VM
- fdisk /dev/vdb
- n
- <ENTER>
- <ENTER>
- <ENTER>
- 10485759
- n
- <ENTER>
- <ENTER>
- <ENTER>
- <ENTER>
- w
- blkid /dev/vdb
Expected results
/dev/vda: .... PTTYPE="dos"
Actual results
/dev/vdb: LABEL_FATBOOT="ephemeral0" LABEL="ephemeral0" UUID="6FC7-A4A5" BLOCK_SIZE="512" TYPE="vfat"