当前位置: 首页>>技术教程>>正文


由于msdos-partition-table强加的错误导致无法创建3TB ext4分区

,

问题描述

我刚买了一个3TB的WD绿色驱动器,但是当我尝试在gparted中进行分区时,我得到一个错误:

======================
libparted : 2.3
======================
partition length of 5860530176 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295

当我尝试使用Ubuntu “Disk Utility”时,我得到类似的错误:

Error creating partition: helper exited with exit code 1: In part_add_partition: device_file=/dev/sdc, start=0, size=3000592982016, type=0x83
Entering MS-DOS parser (offset=0, size=3000592982016)
MSDOS_MAGIC found
looking at part 0 (offset 0, size 0, type 0x00)
new part entry
looking at part 1 (offset 0, size 0, type 0x00)
new part entry
looking at part 2 (offset 0, size 0, type 0x00)
new part entry
looking at part 3 (offset 0, size 0, type 0x00)
new part entry
Exiting MS-DOS parser
MSDOS partition table detected
containing partition table scheme = 0
got it
got disk
new partition
Error: partition length of 5860528002 sectors exceeds the msdos-partition-table-imposed maximum of 4294967295
ped_disk_add_partition() failed

最佳解决方法

PC上使用的传统分区表格式包括一个32位字段,用于记录特定分区覆盖的扇区数。

使用512字节扇区时,将最大分区大小设置为2TB(512 * 232)。

如果需要大于2TB的分区,则需要使用磁盘的GUID分区表(GPT)格式对驱动器重新分区。如果您没有尝试启动此新磁盘,则不太可能遇到任何兼容性问题。

使用GParted,您可以通过进入Device-> Create Partition Table并从列表中选择”gpt”来完成此操作。

次佳解决方法

为了补充James Henstridge对计算机w /out gparted的回答:你可以通过命令行获得相同的结果。对于下面的示例,我使用驱动器名称sdX(虽然您的可能是sdb,sdc,…)

sudo parted
(parted) select /dev/sdX
(parted) mklabel gpt
(parted) mkpart primary 0% 100%
(parted) quit
sudo mkfs.ext4 /dev/sdX1

第三种解决方法

您也可以使用gdisk。在我的例子中,它能够将具有现有分区和数据的磁盘从MBR转换为GPT,从而保持一切完整。但是,YMMV。

您可以在ArchLinux forums上找到有关它的更多信息。该过程看起来像这样:

$ sudo gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.5

Partition table scan:
 MBR: MBR only
 BSD: not present
 APM: not present
 GPT: not present

***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format.
THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by typing 'q' if
you don't want to convert your MBR partitions to GPT format!
***************************************************************

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/1939.html,未经允许,请勿转载。