linux解除硬盘2TB限制(1)

一 2TB限制问题

使用3TB(含)以上硬盘安装Windows 7 64位时,硬盘容量仅辩识到约2TB
mkfs设置文件系统的局限

二 解决方法

DOS Partitions (fdisk) and the 2TB Limit
If you are trying to create disk volumes over two terabytes (2TB) you’ll find that fdisk won’t let you do it. The problem lies not with fdisk, but with the old PCDOS disk label used on disks for the last three decades or so. Back in 1981 when the IBM PC was introduced, a disk of over two terabytes would have seemed inconcievable.
Thus, we struggle with the limitations of PCDOS disk labels today.
Some (newer?) versions of fdisk report the problem with large drives, giving this warning:
WARNING: The size of this disk is 8.0 TB (8001389854720 bytes).DOS partition table format can not be used on drives for volumeslarger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUIDpartition table format (GPT).

To get around the size limitation, there is only one solution: dump the PCDOS disk label for another label. The usual recommendation is the GPT (the GUID Partition Table) created by Intel. The GPT has a much larger limit, making 2TB partitions feasable.
However, the Linux utility fdisk does not work with drives that use GPT; thus, you have to use a different partitioning tool. The usual recommendation to Linux users is GNU parted. GNU parted handles multiple partition formats, including GPT. Documentation is available in multiple formats (PDF is one).
The steps to getting a large partition done with parted are simple:
Create a disklabel (partitioning) on disk.
Create a partition of the appropriate size.
Create a filesystem (if needed).
Mount.

First, create the GPT disklabel – in other words, create the partitioning tables to support GPT:

parted /dev/sdcGNU Parted 2.2Using /dev/sdcWelcome to GNU Parted! Type ‘help’ to view a list of commands.(parted) printModel: Ext Hard Disk (scsi)Disk /dev/sdc: 8001GBSector size (logical/physical): 512B/512BPartition Table: msdos Number Start End Size Type File system Flags (parted) mklabel gptWarning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want tocontinue?Yes/No? yes

Then after this, create a partition:
(parted) mkpart primary xfs 0 8001.4GBWarning: The resulting partition is not properly aligned for best performance.Ignore/Cancel? c
This is what happens when the disk is not aligned properly on the appropriate boundary. Traditionally, the boundary was 512 bytes; now it is changing to 4K. GPT also apparently use a significant portion of the beginning of the disk.
To get around the alignment problem, you can use a start position of 1MB and an end position 1MB from the end:
(parted) mkpart primary xfs 1 -1(parted) pModel: Ext Hard Disk (scsi)Disk /dev/sdc: 8001GBSector size (logical/physical): 512B/512BPartition Table: gptNumber Start End Size File system Name Flags 1 1049kB 8001GB 8001GB primary
Parted supports a wide variety of units (and defaults to megabytes), all of which can be specified during numeric input – such as for start and end points. Using an end point of “100%” is probably just as good as using “-1” (1MB from end).
Jamie McClelland has a nice article about 2TB drives and alignment. Don’t blindly trust the tools to get the partitioning right; specify the appropriate numbers and units in order to force correct alignment.
GNU parted also supports an option that at least suggests it will use the best alignment when it can:
parted –align optimal
Again, don’t blindly trust it: check the numbers.

再根据linux下挂载新硬盘,设置为XFS文件系统格式化分区。

参考博客:
linux如何分大于2T的磁盘分区

    原文作者:御浅永夜
    原文地址: https://www.jianshu.com/p/a6088682c763
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞