The maximum support for hard disk partitions is 2T. Why can mkfs.ext4 / dev/sdb support hard disks larger than 2T?

the maximum support for hard disk partitions is 2T. Why can mkfs.ext4 / dev/sdb support hard disks larger than 2T

< H 3 > ubuntu 16.04 add a 4 T hard drive with parted set to mbr partition (no partition). Direct format, mkfs.ext4 / dev/sdb; mount shows available capacity 3.6T

related codes

root@ubuntu:~-sharp mkfs.ext4 / dev/sdb
mke2fs 1.42.9 (4-Feb-2014)
/ dev/sdb is entire device, not just one partition!
Proceed anyway? Y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
244154368 inodes, 976617472 blocks
48830873 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
29804 block groups
32768blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

root@ubuntu:~-sharp parted-l
Model: DELL PERC H330 Mini (scsi)
Disk / dev/sdb: 4000GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number Start End Size File system Flags
1 0.00B 4000GB 4000GB ext4

root@ubuntu:~-sharp mount / dev/sdb / mnt/
root@ubuntu:~-sharp df-hT / mnt/
Filesystem Type Size Used Avail Use% Mounted on
/ dev/sdb ext4 3.6T 68M 3.4T 1% / mnt

Why is Partition Table loop and supports hard drives larger than 2T?


because your operation is incorrect, you should use

after creating the MBR disk partition table.
mkfs.ext4 /dev/sdb1

instead of

mkfs.ext4 /dev/sdb

disk partitions support a maximum of 2T, which generally refers to the partitions in the MBR partition table. Because MBR uses 32-bit integers to represent the number of sectors, the maximum capacity it can represent is 2 ^ 32 * 512 (here 512 refers to the number of sector bytes), that is, 2T.

now large disks can use GPT partition table, and the capacity of a single partition can reach 2 ^ 33 T.


@ Li Yi
after creating the partition table, there is no partition, so there is no sdb1 partition.
when I tested yesterday, I basically found the reason. Let's see if there are any other ideas, so I won't talk about my answer

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bd7d55-135ed.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bd7d55-135ed.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?