Bug 407713

Summary: Program shows incorrect partition table for NTFS formatted device created in Windows
Product: [Applications] partitionmanager Reporter: Andrey E. <pseudo-account>
Component: generalAssignee: Andrius Štikonas <andrius>
Status: REOPENED ---    
Severity: normal CC: pseudo-account
Priority: NOR    
Version: 4.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Partition table of /dev/sdc is shown in KDE Partition Manager, GNOME Disks and lsblk

Description Andrey E. 2019-05-19 08:02:33 UTC
Created attachment 120180 [details]
Partition table of /dev/sdc is shown in KDE Partition Manager, GNOME Disks and lsblk

SUMMARY
My USB stick was formatted with creating only one NTFS partition, but Partition Manager doesn't show it. 

STEPS TO REPRODUCE
1. Fully format device (and don't create any partition table)
2. Format in NTFS in Windows 7
3. Plug formatted device in PC with KDE neon
4. Open KDE Partition Manager and open information about plugged device

OBSERVED RESULT
Device has "impossible" partition table (29,09 GiB device has partitions located after 867,16 GiB of free space)

EXPECTED RESULT
Device has only one 30 GiB NTFS parition

SOFTWARE/OS VERSIONS
Windows: 7 Home Premuim
Operating System: KDE neon 5.15
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.0
Kernel Version: 4.15.0-50-generic
OS Type: 64-bit

ADDITIONAL INFORMATION
Dolphin file manager and GNOME Disks show information as it is shown in Windows.
Bug is like on Bug 281289 (https://bugs.kde.org/show_bug.cgi?id=281289).
Comment 1 Andrius Štikonas 2019-05-19 09:54:14 UTC
I think that's duplicate of #400652.

Although, I'm not sure why it shows "impossible" partition table.

Can you paste output of

lsblk /dev/sdc

sudo sfdisk /dev/sdc --json

*** This bug has been marked as a duplicate of bug 400652 ***
Comment 2 Andrius Štikonas 2019-05-19 16:27:20 UTC
Hmm, now that you posted lsblk output, it seems that the bug might be there.

I don't think other programs explicitely try to ignore bad partition table, but maybe libparted does it for them. In any case...

Well, since kde partition manager shows exactly the same thing as lsblk, I don't think we should try to work around it in KDE Partition Manager.

I would suggest opening bug against util-linux:

https://github.com/karelzak/util-linux