Bug 434663 - Complain if trying to create MBR partitiion table that is larger than 2 TiB - 512B
Summary: Complain if trying to create MBR partitiion table that is larger than 2 TiB -...
Status: CONFIRMED
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (show other bugs)
Version: 20.12.2
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Andrius Štikonas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-20 12:51 UTC by Brian
Modified: 2021-03-22 21:55 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
step 4 (321.68 KB, image/png)
2021-03-20 12:51 UTC, Brian
Details
what KDE Partition Manager creates (70.17 KB, image/png)
2021-03-20 12:52 UTC, Brian
Details
difference between what KDE partition manager thinks it created and what everything else sees (436.61 KB, image/png)
2021-03-20 12:54 UTC, Brian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian 2021-03-20 12:51:30 UTC
Created attachment 136878 [details]
step 4

SUMMARY
Tried to format the hard drive to ext4, 1 full partition. Every time, the partition is smaller than the full disk size. Every other program sees the partition as the correct size (I also ran out of space when copying). Gnome disks shows what I think is the correct partition size is.

STEPS TO REPRODUCE
1. Open KDE Partition Manager
2. Select disk
3. Delete existing partition (I only had 1, it is now all unallocated/unknown)
4. Right click > New. Filesystem: ext4 (attached, don't think I changed anything else)
5. [Apply] on KDE Partition Manager, top left

OBSERVED RESULT
The 3TB hard drive has 1 partition of 802GB. KDE Partition Manager seems to think that it has applied one partition for the whole disk. There doesn't seem to be a problem with the functioning of the created small partition.

EXPECTED RESULT
1 partition of 2,861,568.00 MiB size, ext4

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.10.0-4-amd64
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Gnome Disks formatted the drive correctly, it doesn't seem to be a hardware issue.
Hard drive specs:
Seagate Backup Plus Desktop Drive
Model: SRD0SD0
PN:1DXAD7-500 3 TB

Thanks for your work
Comment 1 Brian 2021-03-20 12:52:48 UTC
Created attachment 136879 [details]
what KDE Partition Manager creates
Comment 2 Brian 2021-03-20 12:54:57 UTC
Created attachment 136880 [details]
difference between what KDE partition manager thinks it created and what everything else sees
Comment 3 Andrius Štikonas 2021-03-20 13:07:06 UTC
Can you try to see if there is any more info in the Details >> view after you click "Apply". There might be some info from sfdisk there.
Comment 4 Brian 2021-03-20 15:57:39 UTC
Delete partition ‘/dev/sdb1’ (2.73 TiB, ext4) 
Job: Delete file system on ‘/dev/sdb1’ 
Command: wipefs --all /dev/sdb1 
Delete file system on ‘/dev/sdb1’: Success

Job: Delete the partition ‘/dev/sdb1’ 
Command: sfdisk --force --delete /dev/sdb 1 
Delete the partition ‘/dev/sdb1’: Success
Delete partition ‘/dev/sdb1’ (2.73 TiB, ext4): Success

Create a new partition (2.73 TiB, ext4) on ‘/dev/sdb’ 
Job: Create new partition on device ‘/dev/sdb’ 
Command: sfdisk --force --append /dev/sdb 
Create new partition ‘/dev/sdb1’: Success

Job: Set the attributes on partition ‘/dev/sdb1’ to "66003200640066" 
Partition table of partition ‘/dev/sdb1’ does not support setting attributes. Job ignored. 
Set the attributes on partition ‘/dev/sdb1’ to "66003200640066": Success

Job: Create file system ‘ext4’ on partition ‘/dev/sdb1’ 
Command: mkfs.ext4 -qF /dev/sdb1 

Command: sfdisk --part-type /dev/sdb 1 83 
Create file system ‘ext4’ on partition ‘/dev/sdb1’: Success

Job: Set the file system label on partition ‘/dev/sdb1’ to "" 
Command: e2label /dev/sdb1 
Set the file system label on partition ‘/dev/sdb1’ to "": Success

Job: Check file system on partition ‘/dev/sdb1’ 
Command: e2fsck -f -y -v /dev/sdb1 
Check file system on partition ‘/dev/sdb1’: Success
Create a new partition (2.73 TiB, ext4) on ‘/dev/sdb’: Success
Comment 5 Alois Wohlschlager 2021-03-21 09:56:10 UTC
Could you give the output of "sudo sfdisk /dev/sdb -l" as well?
Comment 6 Andrius Štikonas 2021-03-21 10:09:45 UTC
Also it might be useful to double check what is filesystem size (as opposed to partition size):

dumpe2fs -h /dev/sdb1 |& awk -F: '/Block count/{count=$2} /Block size/{size=$2} END{print count*size}'
Comment 7 Brian 2021-03-21 13:50:03 UTC
user@tuxedo:~$ sudo sfdisk /dev/sdb -l
Disk /dev/sdb: 2.73 TiB, 3000592977920 bytes, 732566645 sectors
Disk model: Backup+ Desk    
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 268431360 bytes
Disklabel type: dos
Disk identifier: 0x20cf7de4

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1        2048 732563455 732561408  2.7T 83 Linux

user@tuxedo:~$ dumpe2fs -h /dev/sdb1 |& awk -F: '/Block count/{count=$2} /Block size/{size=$2} END{print count*size}'
0
Comment 8 Alois Wohlschlager 2021-03-21 14:10:37 UTC
> Disklabel type: dos

That's what I suspected. MBR partition tables do not work properly with disks larger than 2TB. I recommend creating a new partition table in GPT format.

@Andrius, do you think partitionmanager should complain here?
Comment 9 Andrius Štikonas 2021-03-21 14:43:35 UTC
(In reply to Alois Wohlschlager from comment #8)
> > Disklabel type: dos
> 
> That's what I suspected. MBR partition tables do not work properly with
> disks larger than 2TB. I recommend creating a new partition table in GPT
> format.
> 
> @Andrius, do you think partitionmanager should complain here?

I think it should... Just to avoid situations like this.
Comment 10 Brian 2021-03-22 21:55:05 UTC
(In reply to Alois Wohlschlager from comment #8)
> > Disklabel type: dos
> 
> That's what I suspected. MBR partition tables do not work properly with
> disks larger than 2TB. I recommend creating a new partition table in GPT
> format.
> 
> @Andrius, do you think partitionmanager should complain here?

Thanks. I'll search how to GPT, I didn't even know there was an option. Cheers