3tb NTFS 驱动器上的分区表问题

3tb NTFS 驱动器上的分区表问题

我有一个 3tb HDD,它被格式化为 NTFS 并放入 USB 外壳中。在Windows和Linux下使用,一年没有任何问题。最近它在Linux和Windows下停止挂载,当我在Windows上插入它时,会弹出一个窗口,说磁盘未格式化,我应该在使用前格式化它。

我做了一些研究,问题听起来像这里:

GParted 声称整个硬盘未分配并给出有关 GPT 表的警告

因此,我遵循了那里的建议并执行了“sudo gdisk”和“x”“e”“w”,但它似乎没有使驱动器可以在任一操作系统中安装,尽管现在 gdisk 没有显示错误消息。有人可以帮忙吗?

另外,在执行此操作之前,我会使用 ddrescue 将整个驱动器的映像文件备份到另一个驱动器,因此,如果必须的话,我可以通过将映像文件 dd-ing 到原始驱动器上来从头开始,对吗?

/dev/sda是有问题的驱动器,/dev/sdb是我的操作系统驱动器。

gdisk下面记录我所做的和输出

username@computername:~$ 
username@computername:~$ sudo gdisk
[sudo] password for username: 
no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory
GPT fdisk (gdisk) version 0.8.8

Type device filename, or press <Enter> to exit: /dev/sda
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Warning! Secondary partition table overlaps the last partition by
4294964337 blocks!
Try reducing the partition table size by 17179857348 entries.
(Use the 's' item on the experts' menu.)

Command (? for help): p
Disk /dev/sda: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): GUID redacted for internet
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1565565838
Partitions will be aligned on 8-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34          262177   128.0 MiB   0C01  Microsoft reserved part
   2          264192      5860530175   2.7 TiB     0700  Basic data partition

Command (? for help): 

Command (? for help): ?
b   back up GPT data to a file
c   change a partition's name
d   delete a partition
i   show detailed information on a partition
l   list known partition types
n   add a new partition
o   create a new empty GUID partition table (GPT)
p   print the partition table
q   quit without saving changes
r   recovery and transformation options (experts only)
s   sort partitions
t   change a partition's type code
v   verify disk
w   write table to disk and exit
x   extra functionality (experts only)
?   print this menu

Command (? for help): r

Recovery/transformation command (? for help): ?
b   use backup GPT header (rebuilding main)
c   load backup partition table from disk (rebuilding main)
d   use main GPT header (rebuilding backup)
e   load main partition table from disk (rebuilding backup)
f   load MBR and build fresh GPT from it
g   convert GPT into MBR and exit
h   make hybrid MBR
i   show detailed information on a partition
l   load partition data from a backup file
m   return to main menu
o   print protective MBR data
p   print the partition table
q   quit without saving changes
t   transform BSD disklabel partition
v   verify disk
w   write table to disk and exit
x   extra functionality (experts only)
?   print this menu

Recovery/transformation command (? for help): i
Partition number (1-2): 1
Partition GUID code: E3C9E316-0B5C-4DB8-817D-F92DF00215AE (Microsoft reserved)
Partition unique GUID: 65C662F3-DDA4-4CF3-B223-228B3E203AAF
First sector: 34 (at 17.0 KiB)
Last sector: 262177 (at 128.0 MiB)
Partition size: 262144 sectors (128.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'Microsoft reserved partition'

Recovery/transformation command (? for help): i
Partition number (1-2): 2
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: 591D05F1-E277-4AD9-99E3-3F5834DB601E
First sector: 264192 (at 129.0 MiB)
Last sector: 5860530175 (at 2.7 TiB)
Partition size: 5860265984 sectors (2.7 TiB)
Attribute flags: 0000000000000000
Partition name: 'Basic data partition'

Recovery/transformation command (? for help): 

Recovery/transformation command (? for help): v

Problem: The secondary header's self-pointer indicates that it doesn't reside
at the end of the disk. If you've added a disk to a RAID array, use the 'e'
option on the experts' menu to adjust the secondary header's and partition
table's locations.

Warning! Secondary partition table overlaps the last partition by
4294964337 blocks!
Try reducing the partition table size by 17179857348 entries.
(Use the 's' item on the experts' menu.)

Caution: Partition 1 doesn't begin on a 8-sector boundary. This may
result in degraded performance on some modern (2009 and later) hard disks.

Consult http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
for information on disk alignment.

Identified 2 problems!

Recovery/transformation command (? for help): 


username@computername:~$ sudo gdisk
[sudo] password for username: 
no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory
GPT fdisk (gdisk) version 0.8.8

Type device filename, or press <Enter> to exit: /dev/sda
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Warning! Secondary partition table overlaps the last partition by
4294964337 blocks!
Try reducing the partition table size by 17179857348 entries.
(Use the 's' item on the experts' menu.)

Command (? for help): p
Disk /dev/sda: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): GUID redacted for internet
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1565565838
Partitions will be aligned on 8-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34          262177   128.0 MiB   0C01  Microsoft reserved part
   2          264192      5860530175   2.7 TiB     0700  Basic data partition

Command (? for help): v

Problem: The secondary header's self-pointer indicates that it doesn't reside
at the end of the disk. If you've added a disk to a RAID array, use the 'e'
option on the experts' menu to adjust the secondary header's and partition
table's locations.

Warning! Secondary partition table overlaps the last partition by
4294964337 blocks!
Try reducing the partition table size by 17179857348 entries.
(Use the 's' item on the experts' menu.)

Caution: Partition 1 doesn't begin on a 8-sector boundary. This may
result in degraded performance on some modern (2009 and later) hard disks.

Consult http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
for information on disk alignment.

Identified 2 problems!

Command (? for help): x

Expert command (? for help): ?
a   set attributes
c   change partition GUID
d   display the sector alignment value
e   relocate backup data structures to the end of the disk
g   change disk GUID
h   recompute CHS values in protective/hybrid MBR
i   show detailed information on a partition
l   set the sector alignment value
m   return to main menu
n   create a new protective MBR
o   print protective MBR data
p   print the partition table
q   quit without saving changes
r   recovery and transformation options (experts only)
s   resize partition table
t   transpose two partition table entries
u   Replicate partition table on new device
v   verify disk
w   write table to disk and exit
z   zap (destroy) GPT data structures and exit
?   print this menu

Expert command (? for help): e
Relocating backup data structures to the end of the disk

Expert command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.
username@computername:~$ 

此后我做了以下事情:

sudo gdisk x e- 将备份表移动到磁盘后面w

没有解决问题。然后我做了

sudo gdisk r d use main GPT header (rebuilding backup) w

也没有解决问题。然后我做了

sudo gdisk u Replicate partition table on new device w

这也没有解决问题,所以我这样做了

sudo gdisk o create a new empty GUID partition table (GPT) w

然后重新启动

sudo gdisk n add a new partition分区 1,起始扇区 32,结束扇区 262177,类型 0c01。分区 2,起始扇区 264192,结束扇区 1565565838,类型 0700。w写入磁盘。

然后我意识到我在最后一步中犯了一个错误,我将新分区 2 以 746GiB 结尾,因为这就是驱动器在旧的损坏的 GPT 下显示的内容。所以我回去重新做了一遍,将第二个分区格式化为 2.7GiB。

sudo gdisk o create a new empty GUID partition table (GPT) w

sudo gdisk n add a new partition分区1与之前相同,分区2开始264192,结束56860533134,类型0700。

然而,当我将它放入带有 USB 外壳的 WIndows 7 盒子或 xubuntu 盒子中时,它似乎仍然认为 HDD 物理上是 746GiB 驱动器,并且 2.7TiB 的新分区是错误的,gdisk 建议我修复分区表。这可能是 USB 外壳的问题,所以我将它放回带有 SATA 的盒子中,并再次使用 SystemRescueCD。

答案1

您的分区表声称磁盘大小仅为 0.7 TB,尽管事实上它实际上是 2.7 TB 并且有一个分区使用了这么多空间。用于gdisk创建一个新的空分区表,然后使用完全相同的开始和结束扇区以及类型代码重新创建这两个分区,这样就可以修复它。

相关内容