Leo*_*ito 2 partitioning mount ntfs hard-drive
我在 SSD 上有一个 Ubuntu 盒,还有一个/dev/sdb
带有一些 NTFS 分区的辅助 HDD ( )。
一些背景:昨天机器没有响应,我不得不强行关闭它(切断电源)。重启后 Ubuntu 会进入紧急模式。我发现 HDD 的 UUID 已经消失(没有出现在 中blkid
),从而导致/etc/fstab
. 我注释掉了磁盘行fstab
并设法启动了 Ubuntu。
现在我正在尝试再次安装硬盘。首先我尝试了 Gparted。这是 libparted 的输出(由 gparted 使用):
======================
libparted : 3.2
======================
end of file while reading /dev/sdb
The primary GPT table is corrupt, but the backup appears OK, so that will be used.
Run Code Online (Sandbox Code Playgroud)
有趣的是,sudo blkid
显示/dev/sdb
为具有 PTUUID 而不是 UUID:
$ sudo blkid
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/sda1: UUID="e407bc1c-4c2d-4dae-80ce-e6bd96346698" TYPE="ext4" PARTUUID="659e6a1e-01"
/dev/sda5: UUID="f9500440-cddf-41f6-8512-5a30e66fbf3d" TYPE="swap" PARTUUID="659e6a1e-05"
/dev/sda6: UUID="18abc384-a610-4f65-8430-0109548a89ef" TYPE="ext4" PARTUUID="659e6a1e-06"
/dev/sdb: PTUUID="a6e9090d-b5ab-412a-8568-2eee08fa3fa8" PTTYPE="gpt"
Run Code Online (Sandbox Code Playgroud)
我确信分区仍然存在,只是无法安装它们。parted
正确列出它们:
$ sudo parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) select /dev/sdb
Using /dev/sdb
(parted) p
Error: end of file while reading /dev/sdb
Retry/Ignore/Cancel? i
Error: The primary GPT table is corrupt, but the backup appears OK, so that will be used.
OK/Cancel? OK
Model: ATA ST1000LM024 HN-M (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 316MB 315MB EFI system partition boot, esp
2 316MB 945MB 629MB ntfs Basic data partition hidden, diag
3 945MB 1079MB 134MB Microsoft reserved partition msftres
4 1079MB 979GB 978GB ntfs Basic data partition msftdata
5 979GB 1000GB 21,5GB ntfs Basic data partition hidden, diag
(parted) q
Run Code Online (Sandbox Code Playgroud)
因此,有 2 个错误 ( Error: end of file while reading /dev/sdb
, Error: The primary GPT table is corrupt, but the backup appears OK, so that will be used.
) 可能导致分区无法挂载。任何想法如何解决它们?
编辑这是输出ntfsfix
:
$ sudo ntfsfix /dev/sdb
Mounting volume... NTFS signature is missing.
FAILED
Attempting to correct errors... NTFS signature is missing.
FAILED
Failed to startup volume: Invalid argument
NTFS signature is missing.
Trying the alternate boot sector
Unrecoverable error
Volume is corrupt. You should run chkdsk.
Run Code Online (Sandbox Code Playgroud)
编辑gdisk 的输出
GPT fdisk (gdisk) version 1.0.1
Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!
Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch! Loaded backup partition table
instead of main partition table!
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: damaged
****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Run Code Online (Sandbox Code Playgroud)
编辑这是我错误执行的导致问题的命令:sudo dd if=/dev/zero of=/dev/sdb bs=512 seek=1