Skip to content
Commit f8faee63 authored by Mike Fleetwood's avatar Mike Fleetwood Committed by Curtis Gedak
Browse files

Avoid whole disk FAT being detected as MSDOS partition table (#743181)

Libparted 1.9.0 to 2.3 inclusive, recognises whole disk device FAT file
systems as MSDOS partition tables.  This causes GParted to do the same.

    # dd if=/dev/zero bs=1M of=/dev/md4
    # mkdosfs -F32 -v -I /dev/md4
    # blkid /dev/md4
    /dev/md4: UUID="53FE-31F2" TYPE="vfat"

    # parted /dev/md4
    GNU Parted 2.1
    Using /dev/md4
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) print
    Model: Unknown (unknown)
    Disk /dev/md4: 536MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number  Start  End  Size  Type  File system  Flags

    (parted) quit

    # /tmp/parted24/bin/parted /dev/md4
    GNU Parted 2.4
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) print
    Model: Linux Software RAID Array (md)
    Disk /dev/md4: 536MB
    Sector size (logical/physical): 512B/512B
    Partition Table: loop

    Number  Start  End    Size   File system  Flags
     1      0.00B  536MB  536MB  fat32

    (parted) quit

This was fixed in libparted 2.4 by commit:

    http://git.savannah.gnu.org/cgit/parted.git/commit/?id=616a2a1659d89ff90f9834016a451da8722df509
    libparted: avoid regression when processing a whole-disk FAT partition

Make GParted immune to this bug by moving blkid performed whole disk
device file system detection before libparted partition detection.  Also
have to always erase old file system signatures on whole disk devices
when creating new partition tables to ensure that blkid doesn't detect
those old signatures before libparted has a chance to detect the new
partition table.

Bug 743181 - Add unpartitioned drive read-write support
parent e7ed2090
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment